[Bug 1895912] [NEW] grub2 does not boot kernels built without CONFIG_EFI_STUB

Michael Zhivich 1895912 at bugs.launchpad.net
Thu Sep 17 02:37:01 UTC 2020


Public bug reported:

After grub2 update that introduced patch entitled ubuntu-Make-the-linux-
command-in-EFI-grub-always-try.patch, grub2 stopped loading kernels
built without CONFIG_EFI_STUB on EFI machines when secure boot is not
enabled.

Attempting to do so fails with the following set of errors:

error: kernel doesn't support EFI handover.
error: you need to load the kernel first

The issue is that grub_errno is never reset if the handoff to linuxefi
fails because kernel was not built with CONFIG_EFI_STUB.  This causes
the code at the end of the function to skip setting "loaded = 1",
causing the 2nd error from the initrd loader.

I'm attaching a small patch that appears to resolve the issue.

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

** Patch added: "proposed patch"
   https://bugs.launchpad.net/bugs/1895912/+attachment/5411523/+files/fix-linuxefi-handoff-logic.patch

-- 
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/1895912

Title:
  grub2 does not boot kernels built without CONFIG_EFI_STUB

Status in grub2 package in Ubuntu:
  New

Bug description:
  After grub2 update that introduced patch entitled ubuntu-Make-the-
  linux-command-in-EFI-grub-always-try.patch, grub2 stopped loading
  kernels built without CONFIG_EFI_STUB on EFI machines when secure boot
  is not enabled.

  Attempting to do so fails with the following set of errors:

  error: kernel doesn't support EFI handover.
  error: you need to load the kernel first

  The issue is that grub_errno is never reset if the handoff to linuxefi
  fails because kernel was not built with CONFIG_EFI_STUB.  This causes
  the code at the end of the function to skip setting "loaded = 1",
  causing the 2nd error from the initrd loader.

  I'm attaching a small patch that appears to resolve the issue.

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



More information about the foundations-bugs mailing list