Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grub2-mkconfig when invoked directly generates bad config on EFI #1009

Closed
cmurf opened this issue Jul 17, 2017 · 8 comments · Fixed by #2298
Closed

grub2-mkconfig when invoked directly generates bad config on EFI #1009

cmurf opened this issue Jul 17, 2017 · 8 comments · Fixed by #2298
Assignees
Labels

Comments

@cmurf
Copy link

cmurf commented Jul 17, 2017

I'm still running into this with Fedora-Workstation-ostree-x86_64-Rawhide-20170714.n.0.iso
atomic-1.18.1-4.fc27.x86_64
ostree-2017.8-2.fc27.x86_64
rpm-ostree-2017.7-1.fc27.x86_64

[chris@frawhide ~]$ sudo ostree admin instutil grub2-generate -v 0
OT: Deployment 6dc795302af832537ad225050a00441726350937f4f9b218b01f5e885c0e1619.0 unlocked=0
**
OSTree:ERROR:src/libostree/ostree-bootloader-grub2.c:167:_ostree_bootloader_grub2_generate_config: assertion failed: (grub2_boot_device_id != NULL)
Aborted
[chris@frawhide ~]$ sudo ostree admin instutil grub2-generate -v 1
OT: Deployment 6dc795302af832537ad225050a00441726350937f4f9b218b01f5e885c0e1619.0 unlocked=0
**
OSTree:ERROR:src/libostree/ostree-bootloader-grub2.c:167:_ostree_bootloader_grub2_generate_config: assertion failed: (grub2_boot_device_id != NULL)
Aborted
[chris@frawhide ~]$

Recalling
https://bugzilla.redhat.com/show_bug.cgi?id=1293986
#165

This command isn't really supposed to be user servicable, but on Workstation there needs to be a way to regenerate the grub.cfg. When I run grub2-mkconfig it does not pick up items in /etc/default/grub and it also uses linux16 and initrd16 commands, instead of linuxefi/initrdefi as appropriate for this UEFI installation.

@cgwalters
Copy link
Member

See also coreos/rpm-ostree#594

@cmurf
Copy link
Author

cmurf commented Jul 17, 2017

coreos/rpm-ostree#594 says on EFI do:
grub2-mkconfig > /boot/efi/EFI/fedora/grub.cfg.new && mv /boot/efi/EFI/fedora/grub.cfg{.new,}

But this creates a grub.cfg with linux16/initrd16 commands which is incorrect. I don't know why the original grub.cfg came out correct during install, but post-install it results in invalid grub commands.

@cgwalters
Copy link
Member

Yep, confirmed that bug. Hmm. Man this code sucks 😢

@cgwalters cgwalters changed the title workstation-ostree needs a working grub2-mkconfig or equivalent grub2-mkconfig when invoked directly generates bad config on EFI Jul 18, 2017
@cgwalters
Copy link
Member

See also #717

@vtolstov
Copy link

vtolstov commented Jan 8, 2018

any news about efi bugs ?

@mildred
Copy link

mildred commented Jun 27, 2019

Second time I install silverblue, and second time anaconda cannot install the bootloader (I suspect due to btrfs).

In order to regenerate the GRUB config with EFI enabled, you can just set _OSTREE_GRUB2_IS_EFI=1. Implementation is here:

gboolean is_efi = g_getenv ("_OSTREE_GRUB2_IS_EFI") != NULL;

For example:

_OSTREE_GRUB2_IS_EFI=1 grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Assuming you manually booted the system once.

@vtolstov
Copy link

@cgwalters any chance to get this fixed?

@bam80
Copy link

bam80 commented Mar 24, 2020

ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants