From a0eb2827b8d5b88d4f14484da42d488d267f5c7a Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 15 Mar 2024 09:30:52 -0700 Subject: [PATCH] aarch64 kernel arg fixup: fix for bootupd We now have some images using bootupd, at least Fedora IoT images from F40 onwards do. These don't have a /etc/default/grub and don't really intend you to run grub2-mkconfig. As advised at https://github.com/ostreedev/ostree/pull/3150#issuecomment-1998768240 let's just add our required arguments directly in the BLS snippet files. Signed-off-by: Adam Williamson --- tests/_do_install_and_reboot.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index f5acd225..d852c889 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -160,10 +160,17 @@ sub run { # https://bugzilla.redhat.com/show_bug.cgi?id=1661288 results # in boot messages going to serial console on aarch64, we need # them on tty0. We also need 'quiet' so we don't get kernel - # messages, which screw up some needles - assert_script_run 'sed -i -e "s,\(GRUB_CMDLINE_LINUX.*\)\",\1 console=tty0 quiet\",g" ' . $mount . '/etc/default/grub'; - # regenerate the bootloader config - assert_script_run "chroot $mount grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg"; + # messages, which screw up some needles. if /etc/default/grub + # is not there, we're probably using bootupd; let's just edit + # the BLS entries directly in that case + if (script_run 'sed -i -e "s,\(GRUB_CMDLINE_LINUX.*\)\",\1 console=tty0 quiet\",g" ' . $mount . '/etc/default/grub') { + assert_script_run 'sed -i -e "s,\(options .*\),\1 console=tty0 quiet,g" ' . $mount . '/boot/loader/entries/*.conf'; + } + else { + # regenerate the bootloader config, only necessary if we + # edited /etc/default/grub + assert_script_run "chroot $mount grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg"; + } } if (grep { $_ eq 'abrt' } @actions) { # Chroot in the newly installed system and switch on ABRT systemwide