[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v2 11/19] Debian: Fixup UEFI boot order during install



Debian inserts itself before any existing entries, including the PXE
one, meaning we otherwise cannot remotely regroove the box. Preseed
some commands to reset the boot order to BootCurrent i.e. how we
booted (so the PXE entry).

There is still a window between the Debian entry being added (by
grub-installer.udeb) and us removing it, a failure (e.g. power cycle)
in that interval would require manual action to fixup.

This is triggered by a new quirk-uefi-bootorder-reset how flag.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---

This seems to just be normal/expected behaviour for UEFI installs (not
just of Debian), so perhaps the quirk is unneeded.
---
 Osstest/Debian.pm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 9e1e69e..c6687db 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1018,6 +1018,21 @@ END
 
     preseed_microcode($ho,$sfx);
 
+    if (get_host_property($ho, "firmware") eq "uefi" &&
+        $ho->{Flags}{'quirk-uefi-bootorder-reset'}) {
+       # Disable any new Debian boot entry, so we reboot from PXE.
+        preseed_hook_command($ho, 'late_command', $sfx, <<'END');
+#!/bin/sh
+set -ex
+
+entry=`in-target --pass-stdout bash -c 'efibootmgr -v | sed -ne 
"s/BootCurrent: \([0-9]\+\)/\1/p"'` #/
+in-target efibootmgr -o $entry
+
+#in-target bash -c 'efibootmgr -o `efibootmgr -v | sed -ne "s/BootCurrent: 
\([0-9]\+\)/\1/p"`' #/
+
+END
+    }
+
     $preseed_file .= preseed_hook_cmds();
 
     if ($ho->{Flags}{'no-di-kernel'}) {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.