From 4d16ccdbef131759f6afb7f6897b87c86a515cac Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 11 May 2021 15:15:52 +1000 Subject: [PATCH] bootloader: disable BLS for Fedora As noted inline, the switch to "boot loader spec" grub entries breaks our setting of the root device. This happened some time ago, and it's not 100% clear to me why our existing Fedora builds haven't broken on this. However, the new containerfile based builds do seem to be hitting this. Disable it for now. Change-Id: Ia3472947799bb35ffccfa92937cdd0d68b12a25c --- .../bootloader/finalise.d/50-bootloader | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader index 171e8a7c..0621ee67 100755 --- a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader +++ b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader @@ -201,6 +201,31 @@ function install_grub2 { echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub echo 'GRUB_GFXPAYLOAD_LINUX=auto' >>/etc/default/grub + # NOTE(ianw) : 2021-05-11 + # On Fedora there has been a switch to BLS + # https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault + # which means that kernel-install will have created entries in + # /boot/loader/entries/... + # and, as the wiki page says + # + # The main issue appears to be that a number of places document + # a way to pass kernel options that is no longer working with + # BLS, i.e. edit /etc/default/grub before running + # grub2-mkconfig. + # + # i.e. exactly what we're doing above to override the root device + # in particular. Override grub2 to use it's old config format and + # remove any BLS entries the kernel install made. + # + # I imagine at some point we will reworking things in a more + # general sense to support BLS if that's what everything is + # switching to. + # + if [[ ${DISTRO_NAME} = fedora ]]; then + echo 'GRUB_ENABLE_BLSCFG=false' >> /etc/default/grub + rm -rf /boot/loader/ + fi + if [[ -n "${DIB_BOOTLOADER_SERIAL_CONSOLE}" ]]; then SERIAL_CONSOLE="${DIB_BOOTLOADER_SERIAL_CONSOLE}" elif [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]]; then