bootupd
bootupd copied to clipboard
Silverblue 41 installation is missing `/boot/grub2/grubenv` and `/etc/default/grub` files
I was recently installing Fedora Silverblue 41 nightly build (Fedora-Silverblue-ostree-x86_64-41-20241012.n.0.iso) and I've noticed that the system was missing /boot/grub2/grubenv and /etc/default/grub files.
Although the system boots fine, I'm pretty sure this is a bug because grub menu is not automatically hidden, boots cannot be marked as successful and so on (grubenv is not created after the install was done under any circumstance automatically).
I was doing an installation via a kickstart file (for advanced encryption option), but I've customized a file that I got from a test install (although I think it was Beta 1.2 image).
I've contacted anaconda team (as it was creating those files before - see write_defaults() and write_config() in https://github.com/rhinstaller/anaconda/blob/4683a8965ce02443134115e3eeea58ec6df38da3/pyanaconda/modules/storage/bootloader/grub2.py#L253) and they said this is now responsibility of bootupd :)
Should I instead open a bugzilla issue instead/in addition to?
Not sure if we should make bootupd to create these 2 files, can we reuse anaconda? Any other scenarios that we need them?
Maybe @travier @cgwalters know about this.
We should probably create /boot/grub2/grubenv but likely not /etc/default/grub as we don't need it anymore.
We should probably create
/boot/grub2/grubenvbut likely not/etc/default/grubas we don't need it anymore.
Regarding defaults - not so sure. If a user creates the file because he wants to configure something - he is most likely to not put the BLSCFG variable as well as other variables. Right now, when there is no defaults file, ostree grub script will just exit. If the defaults file exists it wants BLSCFG variable to be set and /boot/grub/.blscfg file to be present (which is not the case) to not generate boot entries for grub (which avoid duplicate boot entries)...
Regarding defaults - not so sure. If a user creates the file because he wants to configure something - he is most likely to not put the BLSCFG variable as well as other variables. Right now, when there is no defaults file, ostree grub script will just exit.
ostree will also skip re-generating the GRUB config if the system has a static GRUB config which is the default starting with F41 installations. See:
- https://github.com/ostreedev/ostree/pull/3205
- https://github.com/ostreedev/ostree/pull/3300
/etc/default/grub is only used on older installations and will be ignored on the newer ones.
A potential workaround for this issue would be:
$ sudo grub2-editenv - set menu_auto_hide=1
But I can't get this to work so something else is likely missing.
A potential workaround for this issue would be:
$ sudo grub2-editenv - set menu_auto_hide=1But I can't get this to work so something else is likely missing.
I believe this is exactly what I've done (I don't remember if I had to do anything else, but I definitely ran grub2-editenv), why doesn't it work for you?
This is what anaconda does I believe https://github.com/rhinstaller/anaconda/blob/7c96bd8eb6de5c47cdea79c0d49d628a8b7d8713/pyanaconda/modules/storage/bootloader/grub2.py#L357
$ sudo grub2-editenv - set menu_auto_hide=1But I can't get this to work so something else is likely missing.
Can not work either on Silverblue 41.
$ sudo grub2-editenv list
boot_success=1
menu_auto_hide=1
Sorry for the late reply, IMU, with BIOS firmware, bootupd call grub2-install to install bootloader, and thus will create /boot/grub2/grubenv (see code), so the issue is only on EFI right? Does it make sense to just create an empty /boot/grub2/grubenv?
With https://github.com/coreos/bootupd/pull/931, we should now create the file. It still won't configure it to hide the menu by default but at least it should be easier to do now as a post install command.
Thank you @travier for pointing it out, maybe this is because we change to use bootupd to install grub static config (link) that does not include 12_menu_auto_hide, instead of using grub2-mkconfig to create grub.cfg (that includes 12_menu_auto_hide part), tried on Silverblue 40 using grub2-editenv - set menu_auto_hide=1 menu_hide_ok=1 works.
The workaround is include 12_menu_auto_hide in grub.cfg, like:
# /etc/grub.d/12_menu_auto_hide > /boot/grub2/12_menu_auto_hide.cfg
# echo "source \$prefix/12_menu_auto_hide.cfg" >> grub.cfg
# grub2-editenv - set menu_auto_hide=1 menu_hide_ok=1