[Bug 1954566] Re: jammy-proposed grub-efi-amd64-signed 1.175+2.06 2ubuntu2fails to find or load kernel

Julian Andres Klode 1954566 at bugs.launchpad.net
Mon Dec 13 13:01:17 UTC 2021


I found the cause for "Out of Memory" that Matthew reported, but not
sure this is the same issue you are seeing, it seems you did not include
the error, but both disappear with debugging enabled in a lot of
scenarios.

We had code to allocate the kernel at a preferred address and if it
failed, fallback to a random one:

  kernel_mem = grub_efi_allocate_fixed(lh->pref_address,
▸   ▸   ▸   ▸          BYTES_TO_PAGES(lh->init_size));

  if (!kernel_mem)
    kernel_mem = grub_efi_allocate_pages_max(0x3fffffff,
▸   ▸   ▸   ▸   ▸        BYTES_TO_PAGES(lh->init_size));


It turns out than in the VM, the first call failed, but the 2nd one succeeded. Now the first call set `grub_errno` to `GRUB_ERR_OUT_OF_MEMORY`, whereas the 2nd does not touch the variable, so while we had success in practice, we still had an error set.

Changing the code to

  kernel_mem = grub_efi_allocate_fixed(lh->pref_address,
▸   ▸   ▸   ▸          BYTES_TO_PAGES(lh->init_size));

  if (!kernel_mem)
    {
      grub_errno = GRUB_ERR_NONE;
      kernel_mem = grub_efi_allocate_pages_max (
          0x3fffffff, BYTES_TO_PAGES (lh->init_size));
    }


fixes that issue.

I hope it's the same on your machine.

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

Title:
  jammy-proposed grub-efi-amd64-signed 1.175+2.06 2ubuntu2fails to find
  or load kernel

Status in grub2-signed package in Ubuntu:
  Incomplete

Bug description:
  grub-efi-amd64-signed/jammy-proposed,now 1.175+2.06-2ubuntu2 amd64 [installed]
    GRand Unified Bootloader, version 2 (EFI-AMD64 version, signed)

  on boot: select a bootable partition, error appears ...kernel file not
  loaded please load kernel first.. enter to continue .. hp boot screen
  appears  .. no further progress.. power off to recover

  (as a fix boot to a repair medium and reinstalled an earlier version
  of grub)

  Also commented in bug 1953490

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: grub-efi-amd64-signed 1.175+2.06-2ubuntu2
  ProcVersionSignature: Ubuntu 5.15.0-13.13-generic 5.15.5
  Uname: Linux 5.15.0-13-generic x86_64
  ApportVersion: 2.20.11-0ubuntu74
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: XFCE
  Date: Sat Dec 11 09:05:43 2021
  InstallationDate: Installed on 2021-05-01 (224 days ago)
  InstallationMedia: Xubuntu 21.10 "Impish Indri" - Alpha amd64 (20210501)
  SourcePackage: grub2-signed
  UpgradeStatus: No upgrade log present (probably fresh install)

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




More information about the foundations-bugs mailing list