Public bug reported:

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.

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1901633

Title:
  GRUB doesn't load/save values when a submenu entry is used

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1901633/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to