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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1954566

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

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to