From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 11/19] Debian: Fixup UEFI boot order during install Date: Thu, 18 Jun 2015 17:25:02 +0100 Message-ID: <1434644710-28881-11-git-send-email-ian.campbell@citrix.com> References: <1434644687.28264.53.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1434644687.28264.53.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 --- 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