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

[Xen-devel] [PATCH OSSTEST v3 14/22] Debian: Do not add Debian to UEFI boot order on install



By default Debian inserts itself before any existing entries,
including the PXE one, meaning we otherwise cannot remotely regroove
the box.

Add a hook to /usr/lib/base-installer.d/ which installs a diversion of
/usr/sbin/grub-install and installs a wrapper which adds the
--no-nvram argument which prevents grub-install from adding the boot
entries.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v3: New patch replacing "Debian: Fixup UEFI boot order during install"
---
 Osstest/Debian.pm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 9e1e69e..437faab 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1018,6 +1018,31 @@ END
 
     preseed_microcode($ho,$sfx);
 
+    if (get_host_property($ho, "firmware") eq "uefi" &&
+       $ho->{Suite} =~ m/jessie/) {
+       # Prevent grub-install from making a new Debian boot entry, so
+       # we always reboot from PXE. Debian bug #789798 proposes a
+       # properly preseedable solution to this.
+       preseed_hook_installscript($ho, $sfx,
+               '/usr/lib/base-installer.d/',
+               'osstest-disable-grub-nvram', <<'END');
+#!/bin/sh
+set -ex
+
+logger -t osstest-disable-grub-nvram "Adding our grub-install wrapper"
+
+t=/usr/sbin/grub-install
+
+in-target dpkg-divert --divert $t.osstest --rename --add $t
+
+cat >/target/$t <<EOF
+#!/bin/sh
+exec $t.osstest --no-nvram \$@
+EOF
+chmod +x /target/$t
+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®.