Summary: | sys-kernel/gentoo-kernel-bin-6.4.15 failed to boot on arm64 (error: invalid magic number) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Leonid Kopylov <leonchik1976> |
Component: | Current packages | Assignee: | Distribution Kernel Project <dist-kernel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | arm64, base-system, floppym, mgorny, nowa |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | ARM64 | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=915836 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Leonid Kopylov
2023-09-10 12:08:45 UTC
>error: invalid magic number
>error: you need to load the kernel first.
* Could you run `file /path/to/kernel` please on both the initramfs + kernel in /boot?
* What bootloader?
* What HW / VM software? (it matters because of diff. EFI impls)
thanks
(In reply to Sam James from comment #1) > >error: invalid magic number > >error: you need to load the kernel first. > > * Could you run `file /path/to/kernel` please on both the initramfs + kernel > in /boot? # file /boot/vmlinuz-6.4.15-gentoo-dist /boot/initramfs-6.4.15-gentoo-dist.img /boot/vmlinuz-6.4.15-gentoo-dist: PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows, 2 sections /boot/initramfs-6.4.15-gentoo-dist.img: gzip compressed data, max compression, from Unix, original size modulo 2^32 62921728 > * What bootloader? # emerge grub -pvq [ebuild R ] sys-boot/grub-2.06-r7 USE="device-mapper doc fonts mount nls sdl themes truetype -efiemu -libzfs (-test) -verify-sig" GRUB_PLATFORMS="efi-64 -coreboot -efi-32 -emu -ieee1275 (-loongson) -multiboot -pc (-qemu) (-qemu-mips) (-uboot) -xen (-xen-32) -xen-pvh" > * What HW / VM software? (it matters because of diff. EFI impls) It's VM on Parallels Desktop on Apple M1 Max (Mac Studio) > thanks Hi, please see answers above I'm pretty sure it's CONFIG_EFI_ZBOOT. The question is, whether this can be reasonably resolved or we need to revert to non-signed kernels. I think your problem might be resolved in grub 2.12_rc1, would you be willing to check? https://lore.kernel.org/all/20220811145157.3237840-1-ardb@kernel.org/T/ > I'm pretty sure it's CONFIG_EFI_ZBOOT. The question is, whether this can be > reasonably resolved or we need to revert to non-signed kernels. If the problem is indeed grub, then probably we should build the arm64 gentoo-kernel-bin with USE=-secureboot for now. Once we have the next release of grub in the tree and stable, we can revisit this and enable it again. Other arches should be uneffected so we can still enable USE=secureboot for the binary kernels there. (In reply to Andrew Ammerlaan from comment #4) > If the problem is indeed grub, then probably we should build the arm64 > gentoo-kernel-bin with USE=-secureboot for now. Once we have the next > release of grub in the tree and stable, we can revisit this and enable it > again. Or alternatively we can apply the above patch to grub 2.06. (In reply to Andrew Ammerlaan from comment #4) > I think your problem might be resolved in grub 2.12_rc1, would you be > willing to check? > > https://lore.kernel.org/all/20220811145157.3237840-1-ardb@kernel.org/T/ > > > I'm pretty sure it's CONFIG_EFI_ZBOOT. The question is, whether this can be > > reasonably resolved or we need to revert to non-signed kernels. > > If the problem is indeed grub, then probably we should build the arm64 > gentoo-kernel-bin with USE=-secureboot for now. Once we have the next > release of grub in the tree and stable, we can revisit this and enable it > again. > > Other arches should be uneffected so we can still enable USE=secureboot for > the binary kernels there. sys-boot/grub-2.12_rc1-r1 is not keyworded, i added it to '/etc/portage/package.accept_keywords/' - and installed. and yes - it boots now: # uname -r 6.4.15-gentoo-dist (In reply to Leonid Kopylov from comment #6) > sys-boot/grub-2.12_rc1-r1 is not keyworded, i added it to > '/etc/portage/package.accept_keywords/' - and installed. > and yes - it boots now: > > # uname -r > 6.4.15-gentoo-dist Great, Thanks for testing. Adding the maintainers of Grub to CC. How do we want to proceed? Patch grub 2.06, or disable USE=secureboot (and in effect disable EFI_ZBOOT) for the arm64 gentoo-kernel-bin gpkg (until we have a new grub release)? The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=070361537d8ace58dd617b3520c0e2751e1f5574 commit 070361537d8ace58dd617b3520c0e2751e1f5574 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-09-11 01:48:19 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-09-11 01:48:19 +0000 sys-boot/grub: backport fix for arm64 Closes: https://bugs.gentoo.org/913935 Signed-off-by: Mike Gilbert <floppym@gentoo.org> ...grub-2.06-arm64-linux-Remove-magic-number.patch | 45 ++++++++++++++++++++++ .../{grub-2.06-r7.ebuild => grub-2.06-r8.ebuild} | 1 + 2 files changed, 46 insertions(+) (In reply to Andrew Ammerlaan from comment #7) Always happy to back port simple fixes like this one. |