Description
Mandatory information
- Raspberry Pi model: pi4b
Describe the bug
if the boot.img file is over 64mb, it will silently be truncated to 64mb, and then fail the boot.sig validation
To Reproduce
create a properly signed boot.img that is 100mb in size
Expected behaviour
at a bare minimum, report that it is too big on the uart logs, so other users dont have to decompile just to find the size limit
the size limit should also be documented and checked in the scripts for building the image, they currently warn for >20mb, but dont tell you that >64mb wont work
ideally, have a more dynamic buffer size, but i can see that being difficult
Bootloader version and configuration
RPi: BOOTLOADER release VERSION:a6afaeaa DATE: Oct 5 2021 TIME: 08:53:57 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1633420437 0xd328cdce 0x00c03112 0x0006f72c
[all]
BOOT_UART=1
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
TFTP_IP=192.168.2.15
TFTP_PREFIX=0
SD_BOOT_MAX_RETRIES=3
NET_BOOT_MAX_RETRIES=5
ENABLE_SELF_UPDATE=1
SIGNED_BOOT=1
gpio=21=ip,pu
[gpio21=0]
BOOT_ORDER=0x3
[gpio21=1]
BOOT_ORDER=0x5421
[none]
FREEZE_VERSION=0
Additional context
Add any other context about the problem here.
RPi: BOOTLOADER release VERSION:a6afaeaa DATE: Oct 5 2021 TIME: 08:53:57 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1633420437 0xd328cdce 0x00c03112 0x0006f72c
PM_RSTS: 0x00001000
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Micron' 16Gb x2 total-size: 32 Gbit 3200
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
USBSTS 811
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Reset USB port-power 1000 ms
xhci_set_port_power 1 0
xhci_set_port_power 2 0
xhci_set_port_power 3 0
xhci_set_port_power 4 0
xhci_set_port_power 5 0
xhci_set_port_power 1 1
xhci_set_port_power 2 1
xhci_set_port_power 3 1
xhci_set_port_power 4 1
xhci_set_port_power 5 1
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
USBSTS 18
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
USBSTS 19
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Boot mode: SD (01) order 542
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
OCR 80ff8000 [2]
CID: 0002544d5341303247092b62d0be00c6
CSD: 002e00325b5aa3b4ffffff800a800000
SD: bus-width: 4 spec: 2 SCR: 0x02258000 0x01000000
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 12500000 Hz actual: 12500000 HZ div: 20 (10) status: 0x1fff0000 delay: 8
MBR: 0x00000800, 1046528 type: 0x0b
MBR: 0x00000000, 0 type: 0x00
MBR: 0x00000000, 0 type: 0x00
MBR: 0x00000000, 0 type: 0x00
Trying partition: 0
type: 16 lba: 2048 oem: 'mkfs.fat' volume: ' V ^ '
rsc 16 fat-sectors 256 c-count 65373 c-size 16
root dir cluster 1 sectors 32 entries 512
FAT16 clusters 65373
secure-boot
Loading boot.img ...
SIG boot.sig db8002deb34d482a4cb46dd6cb25a7904b90aa6c4bbaf054f288268021292600 1634538695
Verifying
Bad signature boot.img
Error 12 loading boot.img
Boot mode: NETWORK (02) order 54
yes, the signature is valid, it fails with a 100mb image, but works with a 64mb image, signed using the same directions and key