Bug 1663881 - generated boom boot entry fails to boot: variable `boot` isn't set
Summary: generated boom boot entry fails to boot: variable `boot` isn't set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: boom-boot
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bryn M. Reeves
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-07 09:28 UTC by Martin Pitt
Modified: 2019-09-19 12:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-19 12:23:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Pitt 2019-01-07 09:28:36 UTC
Description of problem: boom entries do not work on a standard Fedora 29 LVM installation. (Unlike on RHEL 8 beta, where it does work).


Version-Release number of selected component (if applicable):

boom-boot-0.9-4.fc29.noarch
grub2-common-2.02-62.fc29.noarch

How reproducible: Always

Steps to Reproduce:

1. Create a snapshot:
   lvcreate --snapshot -n rollback1 --size 1G fedora/root
2. Create a boom profile:
   boom profile create --from-host --uname-pattern fc29
3. Create a boom entry for the rollback:
   boom create --title "update rollback test" --rootlv fedora/rollback1
4. Update grub config:
   grub2-mkconfig  > /boot/grub2/grub.cfg
5. Reboot, select "Snapshots" in grub menu and there the "rollback" entry.

Actual results:

fails to boot with

    error: ../../grub-core/commands/blscfg.c:764:variable `boot' isn't set.

Expected results: Boot works.


Additional info:

Comment 1 Bryn M. Reeves 2019-01-07 14:40:02 UTC
> 4. Update grub config:
>   grub2-mkconfig  > /boot/grub2/grub.cfg
> 5. Reboot, select "Snapshots" in grub menu and there the "rollback" entry.

If F29 is now using BLS by default (which I believe it is) then you should not use the separate Snapshots submenu - this is because it uses the same "bls_import" command as the main entries, so at best it's confusing since all the entries are duplicated between the two. In future we hope that a filtering method can be agreed with Grub's BLS support that would allow us to re-introduce this option.

For now you can disable boom's bits via /etc/default/grub, or by removing /etc/grub.d/42_boom from the system.

This has already been disabled for RHEL8 but we still need to update the Fedora packages.

Please paste the output of "boom show" for the problem entry (or the content of the file in /boot/loader/entries - they are the same) so we can check everything is OK there, but this appears to be a bug in the Grub2 BLS module: the entries generated by boom use only the standard BLS keys so there's no reason why this should fail to load.

Comment 2 Martin Pitt 2019-01-07 16:57:35 UTC
> If F29 is now using BLS by default

I'm not sure what "uses BLS by default" means, but I figure it doesn't yet -- please look at bug 1663891. The workaround for this is step 4 in the description's reproducer.

> you should not use the separate Snapshots submenu

Maybe, but I didn't change any configuration in that regard -- it's just what a clean and fresh installation does by default, as per the reproducer.

Indeed there is no "boot" option in the generated file. "boom create" already shows the complete file:

# boom create --title "update rollback test" --rootlv fedora/rollback1
WARNING - Boom configuration not found in grub.cfg
WARNING - Run 'grub2-mkconfig > /boot/grub2/grub.cfg' to enable
Created entry with boot_id 85e51ca:
  title update rollback test
  machine-id b7167f0ae8fd454fafb6bbd51d1123d6
  version 4.19.10-300.fc29.x86_64
  linux /vmlinuz-4.19.10-300.fc29.x86_64
  initrd /initramfs-4.19.10-300.fc29.x86_64.img
  options root=/dev/fedora/rollback1 ro rd.lvm.lv=fedora/rollback1

Confirming with

# boom show 85e51ca
Boot Entry (boot_id=85e51ca)
  title update rollback test
  machine-id b7167f0ae8fd454fafb6bbd51d1123d6
  version 4.19.10-300.fc29.x86_64
  linux /vmlinuz-4.19.10-300.fc29.x86_64
  initrd /initramfs-4.19.10-300.fc29.x86_64.img
  options root=/dev/fedora/rollback1 ro rd.lvm.lv=fedora/rollback1


> For now you can disable boom's bits via /etc/default/grub, or by removing /etc/grub.d/42_boom 

Not sure what to change in/etc/default/grub wrt. boom though -- did you perhaps mean BOOM_ENABLE_GRUB= in /etc/default/boom?

I ran "boom delete 85e51ca" and recreated the entry after disabling BOOM_ENABLE_GRUB. But the only visible change with that is that now the "snapshot" menu itself already triggers this error, not the rollback entry in it.

# boom list
BootID  Version                  Name                     RootDevice           
85e51ca 4.19.10-300.fc29.x86_64  Fedora                   /dev/fedora/rollback1

(Hey, the warnings are gone!)

So I now also disabled BOOM_USE_SUBMENU=, re-ran grub2-mkconfig, re-created the boom entry (doing this or not makes no difference) and now end up with no snapshot entry in the boot menu at all. I believe this means that "F29 is now using BLS by default" is false?

So I put back BOOM_ENABLE_GRUB="yes", but left BOOM_USE_SUBMENU="no". Also no luck, now the "rollback" menu entry doesn't appear at all.

Comment 3 Bryn M. Reeves 2019-01-07 17:10:35 UTC
> I'm not sure what "uses BLS by default" means, but I figure it doesn't yet

This: https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

Milestone has been moved out to f30 now.

> Maybe, but I didn't change any configuration in that regard -- it's just what a clean and fresh installation does by default, as per the reproducer.

That's the point - our default configuration for RHEL7 (and other non-BLS-by-default builds) is to enable this. It causes problems on later Red Hat distributions that do have the feature so it's the first thing to try disabling if there are issues with the Boom entries in the grub menu.

Since f29 still hasn't switched to BLS by default it shouldn't make any difference.

> Not sure what to change in/etc/default/grub 

Just a typo: s/grub/boom. You should turn the integration off completely (BOOM_ENABLE_GRUB="no"), or remove the grub.d script.

> (Hey, the warnings are gone!)

The warnings just indicate that grub2-mkconfig hasn't been run since the package was installed - this should be automatic on RHEL now, but looks like the Fedora package still does not do this.

> I ran "boom delete 85e51ca" and recreated the entry after disabling BOOM_ENABLE_GRUB. But the only visible change with that is that now the "snapshot" menu itself already triggers this error, not the rollback entry in it.

That sounds a bit inconsistent: if you modify /etc/default/boom and disable BOOM_ENABLE_GRUB then you need to re-run grub2-mkconfig to remove the boom modifications to the bootloader set up - if this step is carried out correctly then there should be no "Snapshots" menu at all.

There's no need to delete/re-create things when testing this - "boom create" just adds a file to /boot/loader/entries, and "boom delete" removes it. The problems you are having all come down to what Grub2 is doing at boot time in reading those files.

Either way, the fact that you are getting Grub2 errors from blscfg.c suggests that this is a bug in the grub2 BLS patches rather than boom - the boot entries you have posted are all correct.

Comment 4 Martin Pitt 2019-01-08 09:06:20 UTC
OK, trying this again from scratch with disabling BOOM_ENABLE_GRUB:

ls -l /boot/loader/entries/   # empty

dnf install -y boom-boot
sed -i '/BOOM_ENABLE_GRUB/ s/yes/no/' /etc/default/boom
boom profile create --from-host --uname-pattern fc29

lvcreate --snapshot -n rollback1 --size 1G fedora/root
boom create --title "update rollback test" --rootlv fedora/rollback1
grub2-mkconfig  > /boot/grub2/grub.cfg
reboot

→ no rollback entry at all.

The generated grub config does not have anything from boom at all now, presumably due to BOOM_ENABLE_GRUB=no:

# tail -n5 /boot/grub2/grub.cfg 
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/42_boom ###
### END /etc/grub.d/42_boom ###

So it seems grub does not actually parse /boot/loader/entrires/ without the "insmod blscfg" and "bls_import"? Note that on RHEL 8 beta (where this works), the default grub.cfg does have this:

# grep bls /boot/grub2/grub.cfg
# The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and
insmod blscfg
blscfg

even though /etc/default/boom has BOOM_ENABLE_GRUB="no" -- but it's not in /etc/grub.d/42_boom, but in /etc/grub.d/10_linux, so it's always enabled.

So I tried to apply this to the generated config. I replaced

### BEGIN /etc/grub.d/42_boom ###
submenu "Snapshots" {
    insmod blscfg
    bls_import
}

with

### BEGIN /etc/grub.d/42_boom ###
insmod blscfg
blscfg

but still no avail -- there is no menu entry other than the normal system (and rescue), the boom boot entry is missing.

Comment 5 Bryn M. Reeves 2019-09-19 12:23:28 UTC
This is a problem with the blscfg module provided by grub2 - see bug 1652806 for more information. It should be resolved with the current grub2 packages for Fedora.


Note You need to log in before you can comment on or make changes to this bug.