Description of problem: Regardless of what I try for [bootversion] I get a crash, ostree admin instutil -v grub2-generate ** ERROR:src/libostree/ostree-bootloader-grub2.c:154:_ostree_bootloader_grub2_generate_config: assertion failed: (grub2_boot_device_id != NULL) Aborted (core dumped) Version-Release number of selected component (if applicable): ostree-2015.11-2.fc23.x86_64 How reproducible: Almost always regardless of what I specify for [bootversion], exceptions are integer values above 2 for which it just says it's an invalid bootversion. Steps to Reproduce: 1. Help says it wants [BOOTVERSION] as a parameter but it won't accept any variation of VERSION or ID provided by rpm-ostree status. The failure suggests it's looking for grub2_boot_device_id but all variations to specify that also fail. Actual results: Crash Expected results: Either fail without crashing, or help could better define what parameter this command is expecting. Additional info:
(In reply to Chris Murphy from comment #0) > Description of problem: > > Regardless of what I try for [bootversion] I get a crash, > ostree admin instutil -v grub2-generate > ** > ERROR:src/libostree/ostree-bootloader-grub2.c:154: > _ostree_bootloader_grub2_generate_config: assertion failed: > (grub2_boot_device_id != NULL) > Aborted (core dumped) Right, as mentioned on the mailing list, this shouldn't be manually called by the user, AFAICT. --- Related to what you're trying to do, I believe the following PR should fix your grub2-mkconfig woes: https://github.com/GNOME/ostree/pull/165 In the meantine, as a workaround, you can directly set the _OSTREE_GRUB2_BOOTVERSION env var to the current bootversion (e.g. if /boot/loader is pointing to loader.1, then it's 1).
Hey Chris- Can you let us know if Jonathan's above comment worked for you?
-bash-4.3# ls -l /boot total 22 drwxr-xr-x. 3 root root 1024 Dec 31 1969 efi drwxr-xr-x. 6 root root 1024 Mar 9 20:23 grub2 lrwxrwxrwx. 1 root root 8 Mar 9 15:53 loader -> loader.0 drwxr-xr-x. 3 root root 1024 Mar 9 20:23 loader.0 drwx------. 2 root root 12288 Mar 9 15:51 lost+found drwxr-xr-x. 3 root root 1024 Mar 9 15:52 ostree -bash-4.3# export _OSTREE_GRUB2_BOOTVERSION=0 -bash-4.3# ostree admin instutil -v grub2-generate ** ERROR:src/libostree/ostree-bootloader-grub2.c:154:_ostree_bootloader_grub2_generate_config: assertion failed: (grub2_boot_device_id != NULL) Aborted (core dumped) -bash-4.3# rpm -q ostree ostree-2015.11-2.fc23.x86_64 -bash-4.3# ostree admin status * fedora-atomic 1a68c7b9c0ad54d438752c12666752639b502fe8c6f24004de60d68c01919062.0 Version: 23.79 origin refspec: fedora-atomic:fedora-atomic/f23/x86_64/docker-host
Hi Chris, As mentioned earlier, the `grub2-generate` subcommand is not designed for running by the user. You should however be able to do e.g. # bootver=$(readlink /boot/loader) # _OSTREE_GRUB2_BOOTVERSION=${bootver#*.} grub2-mkconfig And always have it output a functioning grub configuration file, regardless of the bootversion. Can you confirm that this works?
Yes this works.
This should definitely be fixed in ostree-2016.5-3.fc23, now in stable.