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 <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-03-15 09:30:52 -07:00
parent b20aac5373
commit a0eb2827b8
1 changed files with 11 additions and 4 deletions

View File

@ -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