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

[Xen-devel] [PATCH OSSTEST 13/15] 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 e89ca6c..a46ffd8 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -942,6 +942,21 @@ d-i partman-auto/expert_recipe string                      
                \\
 
 END
 
+    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®.