GRUB doesn't load/save values when a submenu entry is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
It appears that GRUB in focal (2.04-1ubuntu26.6) doesn't load or save values to grubenv when using entries that are under a submenu. This is similar to LP #1816633
For context, this issue arose using the latest focal cloud image (https:/
This resulted in a boot loop where the first entry in the submenu was booted, the kernel panics, and restarts.
Using GRUB_DEFAULT=0 results in a boot > panic > boot > success. This is similar to LP #1870189.
From LP #1870189, cloud images set the GRUB_FORCE_PARTUUID variable in /etc/default/
Note that unsetting GRUB_FORCE_PARTUUID works around my issue, since the if/else logic that uses the initrdfail variable is only placed in the grub.cfg when GRUB_FORCE_PARTUUID is set.
However, I tried using custom menuentries in grub.cfg to show the variables' state in an attempt to determine why this didn't work with GRUB_FORCE_PARTUUID set. I will attach it to this bug.
This showed that the submenu menuentries didn't set or use the variables, specifically initrdfail and recordfail. The first entry, before the "Advanced options..." submenu, did set the variables, and would use them. However, using that first entry (by booting it once, getting the kernel panic and restarting) to set initrdfail to "1" didn't work. The submenu menuentries booted as though the value was unset.
I tested this by manually selecting boot entries and observing the values printed by my custom menuentries.
I expected that the submenu menuentries would use the values and would set them appropriately.
My customized (via 40_custom) grub.cfg that displays the values of initrdfail (amongst others).