From cfa59ac9d99bf8610ce515beeba37e30ca3ccb00 Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Mar 21 2025 11:50:40 +0000 Subject: bootupd: Force enable BLS support in GRUB Until Fedora 41, the bootloader entries were duplicated in the GRUB boot menu as both the BLS configs and the ostree-grub2 static entries where included and loaded in the GRUB config. With the bootloader being updated and system being migrated to a static GRUB config as part of the composefs support, we now want to rely on BLS configs only. The Fedora 31 release notes [1] suggested disabling BLS support in GRUB to remove the duplicate entries. We thus need to make sure that this support is turned back in the GRUB config before systems are updated to F42. [1]: https://fedoraproject.org/wiki/Common_F31_bugs#On_Fedora_Silverblue.2FIoT.2C_the_GRUB_menu_shows_duplicate_entries See: https://gitlab.com/fedora/ostree/sig/-/issues/35 See: https://github.com/coreos/bootupd/issues/857 --- diff --git a/bootupd.yaml b/bootupd.yaml index 5fbb0fc..6a3dc49 100644 --- a/bootupd.yaml +++ b/bootupd.yaml @@ -32,3 +32,20 @@ postprocess: # Turn permissive mode on for bootupd until all SELinux issues are fixed semanage permissive --noreload --add bootupd_t + + # Ensure that BLS support is enabled when regenerating GRUB configs + cat > /usr/lib/systemd/system/atomic-enable-grub-bls-support.service << 'EOF' + [Unit] + Description=Force enable BLS support in GRUB config + Documentation=https://fedoraproject.org/wiki/Changes/ComposefsAtomicDesktops + + [Service] + Type=oneshot + ExecStart=bash -c "if [[ -f '/etc/default/grub' ]] && [[ $(grep -c 'GRUB_ENABLE_BLSCFG=true' '/etc/default/grub') != 1 ]]; then sed -i '/GRUB_ENABLE_BLSCFG=/d' '/etc/default/grub'; echo 'GRUB_ENABLE_BLSCFG=true' >> '/etc/default/grub'; fi" + RemainAfterExit=yes + + [Install] + WantedBy=multi-user.target + EOF + + echo "enable atomic-enable-grub-bls-support.service" > /usr/lib/systemd/system-preset/81-atomic-desktop.preset