Hello. I'm working on a CM4 that uses both secure boot and a dual boot partition setup. I'm having trouble getting `tryboot` to work.
Versions:
EEPROM bootloader: RPi: BOOTLOADER release VERSION:4fd8f1f3 DATE: 2023/05/11 TIME: 07:26:03
Firmware: 20230509~buster
Linux: rpi-5.15.y branch, 5.15.92-v8
I signed the EEPROM and flashed it using the usbboot tools. In my custom Yocto build, I generate VFAT partitions for boot.img and sign them with the same key. I have already burned the corresponding RSA public key to OTP, but I have not yet revoked the developer key.
Here is my partition layout using MBR. Note I'm using an extended partition (4) with type 0x5 "Extended":In this scheme, I have boot partitions 6 and 7 loading rootfs partitions 2 and 3, respectively.
Here are the contents of autoboot.txt in /dev/mmcblk0p1:I have boot.img and boot.sig in both /dev/mmcblk0p6 and /dev/mmcblk0p7 with only one difference: the cmdline.txt in partition 6 and 7 images respectively contain root=/dev/mmcblk0p2 and root=/dev/mmcblk0p3.
Normal boot works - Linux loads to a command prompt via boot partition 6 and rootfs partition 2. When I manually boot to partition 7 using sudo reboot '7 tryboot', that works as well, but the tryboot flag in /proc/device-tree/chosen/bootloader/tryboot is not set. Is the tryboot part of the argument ignored when explicitly naming a boot partition?
When I try to boot to partition 7 with sudo reboot '0 tryboot', the system unexpectedly reboots into partition 6 as if the [tryboot] filter in autoboot.txt is getting ignored. Thinking this may be a problem of arguments not properly getting passed via the reboot command, I compiled and used rebootp with the same exact results. Also, kernel logs showed that the command was getting passed:
Does anyone have any ideas for why the tryboot flag or filter might be getting ignored? I've enabled BOOT_UART=1 in EEPROM and both enable_uart=1 and uart_2ndstage=1 in the config.txt file in both boot partition images, so I can review logs. As you can see below, PM_RSTS=0x00001020 which according to some other places on the forum may be a watchdog event. Is that expected?
Versions:
EEPROM bootloader: RPi: BOOTLOADER release VERSION:4fd8f1f3 DATE: 2023/05/11 TIME: 07:26:03
Firmware: 20230509~buster
Linux: rpi-5.15.y branch, 5.15.92-v8
I signed the EEPROM and flashed it using the usbboot tools. In my custom Yocto build, I generate VFAT partitions for boot.img and sign them with the same key. I have already burned the corresponding RSA public key to OTP, but I have not yet revoked the developer key.
Here is my partition layout using MBR. Note I'm using an extended partition (4) with type 0x5 "Extended":
Code:
$ sudo fdisk -lDisk /dev/mmcblk0: 7456 MB, 7818182656 bytes, 15269888 sectors119296 cylinders, 4 heads, 32 sectors/trackUnits: sectors of 1 * 512 = 512 bytes Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type/dev/mmcblk0p1 * 64,0,1 1023,3,32 8192 139263 131072 64.0M c Win95 FAT32 (LBA)/dev/mmcblk0p2 1023,3,32 1023,3,32 139264 5464063 5324800 2600M 83 Linux/dev/mmcblk0p3 1023,3,32 1023,3,32 5464064 10788863 5324800 2600M 83 Linux/dev/mmcblk0p4 1023,3,32 1023,3,32 10797054 15269887 4472834 2184M 5 Extended/dev/mmcblk0p5 1023,3,32 1023,3,32 10797056 14991359 4194304 2048M 83 Linux /dev/mmcblk0p6 1023,3,32 1023,3,32 14999552 15130623 131072 64.0M c Win95 FAT32 (LBA)/dev/mmcblk0p7 1023,3,32 1023,3,32 15138816 15269887 131072 64.0M c Win95 FAT32 (LBA)
Here are the contents of autoboot.txt in /dev/mmcblk0p1:
Code:
[all]tryboot_a_b=1boot_partition=6[tryboot]boot_partition=7
Normal boot works - Linux loads to a command prompt via boot partition 6 and rootfs partition 2. When I manually boot to partition 7 using sudo reboot '7 tryboot', that works as well, but the tryboot flag in /proc/device-tree/chosen/bootloader/tryboot is not set. Is the tryboot part of the argument ignored when explicitly naming a boot partition?
Code:
$ hexdump -s3 -e '"%x\n"' /proc/device-tree/chosen/bootloader/tryboot 0
Code:
reboot: Restarting system with command '0 tryboot'
Code:
[ 80.400006] reboot: Restarting system with command '0 tryboot'␀RPi: BOOTLOADER release VERSION:4fd8f1f3 DATE: 2023/05/11 TIME: 07:26:03BOOTMODE: 0x06 partition 0 build-ts BUILD_TIMESTAMP=1683786363 serial e5e1daf1 boardrev c03140 stc 5466821PM_RSTS: 0x00001020part 00000000 reset_info 00000000uSD voltage 3.3VBoot mode: SD (01) order f2564SD HOST: 200000000 CTL0: 0x00800000 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276SD HOST: 200000000 CTL0: 0x00800f00 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276EMMCSD retry 1 oc 0SD HOST: 200000000 CTL0: 0x00800000 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276OCR c0ff8080 [0]CID: 00150100384754463452061a4693d338SD HOST: 200000000 CTL0: 0x00800f04 BUS: 25000000 Hz actual: 25000000 HZ div: 8 (4) status: 0x1fff0000 delay: 4SD HOST: 200000000 CTL0: 0x00800f04 BUS: 50000000 Hz actual: 50000000 HZ div: 4 (2) status: 0x1fff0000 delay: 2MBR: 0x00002000, 131072 type: 0x0cMBR: 0x00022000, 5324800 type: 0x83MBR: 0x00536000, 5324800 type: 0x83MBR: 0x00a4bffe, 4472834 type: 0x05Trying partition: 0type: 16 lba: 8192 oem: 'mkfs.fat' volume: ' V ^ 'rsc 4 fat-sectors 128 c-count 32695 c-size 4root dir cluster 1 sectors 32 entries 512FAT16 clusters 32695Read autoboot.txt bytes 64 hnd 0x2Trying partition: 6EBR: 0x00a4bffe 0x00000002, 4194304 0x00401f82, 131200 signature: aa55EBR: 0x00e4df80 0x00000080, 131072 0x00423f82, 131200 signature: aa55MBR: 0x00000080, 131072 type: 0x0ctype: 16 lba: 14999552 oem: 'mkfs.fat' volume: ' V ^ 'rsc 4 fat-sectors 128 c-count 32695 c-size 4root dir cluster 1 sectors 32 entries 512FAT16 clusters 32695secure-bootLoading boot.img ...SIG boot.sig 80baad1b1d891e8703a347bfcf7437e5ef7c830de173ba67fecda38d238edc64 1712772729VerifyingRSA verifyrsa-verify pass (0x0)MBR: 0x00000000, 0 type: 0x00MBR: 0x00000000, 0 type: 0x00MBR: 0x00000000, 0 type: 0x00MBR: 0x00000000, 0 type: 0x00Trying partition: 0type: 16 lba: 0 oem: 'mkfs.fat' volume: ' V ^ 'rsc 4 fat-sectors 56 c-count 14317 c-size 4root dir cluster 1 sectors 16 entries 256FAT16 clusters 14317Read config.txt bytes 2708 hnd 0x31c7Read start4.elf bytes 2251392 hnd 0x31c9Read fixup4.dat bytes 5399 hnd 0x5f40x00c03140 0x00000000 0x00001fffMEM GPU: 76 ARM: 948 TOTAL: 1024Firmware: 30aa0d70ab280427ba04ebc718c81d4350b9d394 May 9 2023 12:16:34Starting start4.elf @ 0xfec00200 partition 0
Statistics: Posted by nowls — Wed Apr 10, 2024 10:57 pm