[Bug 1901633] Re: GRUB doesn't load/save values when a submenu entry is used
Kellen Renshaw
1901633 at bugs.launchpad.net
Tue Oct 27 00:16:15 UTC 2020
My customized (via 40_custom) grub.cfg that displays the values of
initrdfail (amongst others).
** Attachment added: "grub.cfg"
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1901633/+attachment/5427642/+files/grub.cfg
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1901633
Title:
GRUB doesn't load/save values when a submenu entry is used
Status in grub2 package in Ubuntu:
New
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://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-
amd64.img). I attempted to set GRUB_DEFAULT to "1>0" to boot the first
entry of the "Advanced options for Ubuntu" submenu as a test for
booting a specific kernel version.
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/grub.d/40-force-partuuid.cfg. This results in menu
entries that use a if/else structure to attempt initrd-less boot
before falling back to booting with an initrd. The if/else structure
uses a GRUB variable called initrdfail (and I believe recordfail) to
note whether the initrd-less boot worked.
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1901633/+subscriptions
More information about the foundations-bugs
mailing list