From 1739f3806148ca86136916495c03f058e62e3798 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 25 Mar 2024 17:17:37 -0700 Subject: [PATCH] Add a workaround for RHBZ #2268505 My anaconda patch for ensuring we get an EFI boot manager entry on installs using bootupd (currently only 'canned', i.e. Atomic, installs - IoT and Atomic Desktops - are affected) was rejected and dropped in the latest Rawhide build. It'll probably also be lost in the next F40 build. So install tests of affected images have started failing. This is a kinda awkward workaround: on UEFI canned installs, we check whether it looks like there is no "Fedora" efibootmgr entry, and if so, we delete the entry for the optical drive, so hopefully we'll boot via fallback path from the hard disk on reboot. Signed-off-by: Adam Williamson --- tests/_do_install_and_reboot.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index d852c889..398c7df6 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -130,6 +130,12 @@ sub run { # just like non-lives). And if we're already doing something # else at a console, we may as well reboot from there too push(@actions, 'reboot') if (!get_var("MEMCHECK") && ((get_var("LIVE") && !$webui) || @actions)); + # check whether install is affected by + # https://bugzilla.redhat.com/show_bug.cgi?id=2268505 , + # soft fail and work around it if so + if (get_var("CANNED") && get_var("UEFI")) { + push(@actions, 'checkefibootmgr') if (get_var("UEFI")); + } # our approach for taking all these actions doesn't work on VNC # installs, fortunately we don't need any of them in that case # yet, so for now let's just flush the list here if we're VNC @@ -191,6 +197,16 @@ sub run { if (grep { $_ eq 'noplymouth' } @actions) { assert_script_run "chroot $mount dnf -y remove plymouth"; } + if (grep { $_ eq 'checkefibootmgr' } @actions) { + if (script_run 'efibootmgr | grep fedora') { + record_soft_failure "No EFI boot manager entry created - likely RHBZ #2268505"; + # delete the optical drive entry, if there is one, so hopefully + # we'll boot via fallback path + unless (script_run 'efibootmgr | grep CD-ROM') { + assert_script_run('efibootmgr -b $(efibootmgr | grep CD-ROM | head -1 | cut -f1 | sed -e "s,[^0-9],,g") -B'); + } + } + } type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions); }