arenekosreal / raspberrypi4-uefi

UEFI, firmware and other packages for Raspberry Pi 4B in UEFI mode
Do What The F*ck You Want To Public License
8 stars 1 forks source link

vmlinuz "Unsupported" #3

Closed timknab closed 2 years ago

timknab commented 2 years ago

The UEFI boot loader works fine, and I can access all the various menus, however whenever I try to boot arch using the kernel and images created by the various packages in here I get:

Error loading /vmlinuz-linux-rpi4-uefi-raspberrypi: Unsupported

and

Failed to execute Arch Linux (\vmlinuz-linux-rpi4-uefi-raspberrpi): Unsupported

Is there something simple I'm missing?

arenekosreal commented 2 years ago

It seems that the file format of vmlinuz-linux-rpi4-uefi-raspberrypi is not for aarch64. The file vmlinuz-linux-rpi4-uefi-raspberrypi can be unpacked by a compress program like Ark. What is the file type of that unpacked file? If you use file command to detect that unpacked file, it should be Linux kernel ARM64 boot executable Image, little-endian, 4K pages.

timknab commented 2 years ago

Hmm. I get

>>file vmlinuz-linux-rpi4-uefi-raspberrypi.uncompressed vmlinuz-linux-rpi4-uefi-raspberrypi.uncompressed: MS-DOS executable PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows

Obviously that's wrong, but I have no idea why... I tried on a file downloaded from the "Releases" page, as well as one I compiled myself using the PKGBUILDs. They both give the same result.

arenekosreal commented 2 years ago

It does not need strictly match, I ran that file command on my x86_64 PC which is running Arch Linux to get that output. Running file vmlinuz-linux-rpi4-uefi-raspberrypi.uncompressed on file from Release also get same output on my PC. If you are using linux-rpi4-uefi-raspberrypi-git-5.19.0.1ef4d0cd4-1-aarch64.pkg.tar.zst from Release, the sha256sum of vmlinuz-linux-rpi4-uefi-raspberrypi.uncompressed should be 7c23cf2fdfbc8ce49ff60d7c6c28df9c61881a76cd05c44ba7d99ef05da9b797. Let's check if they are match. Besides, if you are using bootloaders other than GRUB, please try to use GRUB as bootloader to check if it is your bootloader's problem, GRUB works fine on my Raspberry Pi 4B.

timknab commented 2 years ago

Ok, I confirmed the sha256sums matched, and I was actually able to get past the error I was having by uncompressing the vmlinuz file in the boot partition. Now I'm having some other errors, and it still won't boot, but I think those are related to using a BTRFS filesystem...

Thanks for the help

arenekosreal commented 2 years ago

Normally, /boot/vmlinuz-linux-rpi4-uefi-raspberrypi should be copied from /usr/lib/modules/$kernel_version/vmlinuz by initramfs generator such as mkinitcpio. Uncompressing manually is also not needed because the compressed kernel has the ability to unpack itself and execute uncompressed kernel binary. What's more, there is a topic related to this problem on Arch Linux BBS, it says that using GRUB instead other bootloader such as systemd-boot can fix this. Totally speaking, I think what you have done is just a workaround rather than a solution. Maybe we should spend more time on finding the actual reason. I will close this issue now, but once you need more help, feel free to reopen it.

arenekosreal commented 2 years ago

@timknab According my search recently, there is no auto decompressing support for aarch64 now. So your bootloader has to decompress the vmlinuz image or run vmlinux directly. FWIW, systemd-boot and rEFInd can only run the kernel directly. Maybe you can use a pacman hook to decompress kernel from vmlinuz to vmlinux when the package is installed/upgraded.

timknab commented 2 years ago

Thanks for following up, using a hook to decompress is a good idea, I'll try that.