-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RaspberryPi 5] Unable to load signed boot.img w/initramfs > 30MB #619
Comments
Hi. To avoid any doubt, for both signed and signed boot scenarios, please state if your initramfs archive is embedded into the kernel image (image is a single monolithic blob), or if it's stored as a separate file (kernel and initramfs are separate)? To verify if authentication is working correctly on a monolithic blob, you could create a file containing random data of a certain size, sign it, then check if the bootloader authenticates it upon load. |
Hi!
The Initramfs archive is stored as a separate file within boot.img. I forgot to show my config.txt in boot.img:
Outer config in boot partition:
So, I created a 30MB file and signed:
After copying to the boot partition in our nvme stick, it verifies successfully:
I then create a 31MB file and sign:
Fails to load with bad signature.
|
Your original description seems different to the 31 MB test, though.
vs
The actual authentication check of the image doesn't look like it actually happened. |
I just tried the 31MB image on a 2024/09/23 bootloader using the same command as you and it worked fine on SD, USB, NVMe
Possibly a mismatch in the key or an issue with the NVMe. It might be worth updating the bootloader and replacing the mass-storage-gadget64/boot.img file to see if you can still reproduce the issue. |
Hi all, thanks so far! Yes, it looks like I was mistaken (I might not have synced or copied the signature file correctly the second time). So, at 31M, the boot.img passed. I'm trying higher sizes now by increasing every 10M. Just on the NVMe, this is the results I'm seeing, but I'll try the SDCard as well to see if there's any issue with the nvme on my end.
Will update the bootloader as well. Last I tried |
It turns out, the boot partition flashed to the nvme from our Yocto WIC image was not set up to format with FAT32, defaulting to FAT16 instead. This was the major difference after comparing with the Raspberry Pi Imager, which flashed its boot partition on the nvme with FAT32, and allowed loading of a larger boot.img without issue. Oddly, this only mattered for the nvme as we were able to flash our WIC image onto an SDCard with FAT16 formatted boot and load the boot.img. We were also able to load a larger boot.img from USB on our default and the latest eeprom. In any case, I appreciate the guidance! Feel free to close this ticket if needed. |
Describe the bug
This seems similar to #375
The understanding from docs is "The maximum size for a ramdisk file is 96MB", but this appears to be limited to Raspberry Pi4 with observed behavior. On Pi5, a signed boot.img fails to load past 30MB. Below 30MB, the kernel and a small initramfs shell (1.3MB) is successfully loaded from ramdisk.
If the signed boot is disabled but ramdisk is set in config, the boot.img (Tested around 60MB) is able to be read and kernel loads, however, the initramfs fails to load and continues to main root partition. Below 30MB, the kernel and initramfs shell successfully loads.
Some clarifications on the size limits over ramdisk vs signed boot would be helpful. If possible, raising this limit like what was done with 2711 would help allow for bigger initramfs with tools to support LUKS encryption and decryption before main rootfs mounting.
Steps to reproduce the behaviour
Build a signed boot.img greater than 30MB.
Device (s)
Raspberry Pi 5
Bootloader configuration.
System
OS/Version: Yocto-based Kirkstone Distribution
Bootloader Version:
Firmware Version:
Kernel Version:
Linux CAM-2CCF67509B94 6.1.77-v8-16k #1 SMP PREEMPT Thu Feb 8 15:07:10 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
Bootloader logs
USB boot
No response
NVMe boot
Network (TFTP boot)
No response
The text was updated successfully, but these errors were encountered: