I havenât heard back from you but I have reproduced your issue and have a potential solution for you. First, the reason why you see this behavior⊠When a board is first booted, UEFI records the hardware configuration inside the uefi_variables partition. This includes things like MAC addresses, etc. This is so UEFI knows from one boot to another whether any new devices have been added. And in the case of new devices being added, by default those new devices are added to the top of the boot order (e.g. when you plug in a USB drive to reflash, etc.). In your case the MAC address of the original board is recorded, and when that images is cloned to a new board, it looks like a different ethernet adapter was added to the system. And so that goes to the top of the list and causes the boot delay youâre seeing.
So my thought here is to take your QSPI0.img and post-process it to âeraseâ the uefi_variables partition. When I tried this out myself, I found there are actually 3 partitions you need to erase:
- uefi_variables
- uefi_ftw
- reserved_partition
In order to know the right places to erase, you should capture your original flash log and look for a table like this:
[ 5.7482 ] partition_id partition_name StartingLba EndingLba
[ 5.7484 ] 1 BCT 0 2047
[ 5.7486 ] 2 A_mb1 2048 3071
[ 5.7487 ] 3 A_psc_bl1 3072 3583
[ 5.7489 ] 4 A_MB1_BCT 3584 3839
[ 5.7491 ] 5 A_MEM_BCT 3840 4351
[ 5.7493 ] 6 A_tsec-fw 4352 6399
[ 5.7495 ] 7 A_nvdec 6400 8447
Then find those 3 partitions I mentioned:
[ 5.7811 ] 50 uefi_variables 128000 128511
[ 5.7811 ] 51 uefi_ftw 128512 129535
[ 5.7811 ] 54 reserved_partition 130432 130559
First, you can create an image that contains all Fâs to use as a source file for overwriting portions of your QSPI0.img:
Create a 16MB binary image file of all Fâs (larger than any partition we possibly want to fill)
dd if=/dev/zero bs=1M count=16 | tr â\000â â\377â > all_ff_binary.img
Then you can modify those 3 portions of QSPI0.img:
dd if=all_ff_binary.img of=QSPI0.img bs=512 seek=128000 count=512 conv=notrunc
dd if=all_ff_binary.img of=QSPI0.img bs=512 seek=128512 count=1024 conv=notrunc
dd if=all_ff_binary.img of=QSPI0.img bs=512 seek=130432 count=128 conv=notrunc
Above I used block size (bs) of 512 to coincide with how the LBAs are defined in the table. That reduces the amount of math you need to do! That way you can just set seek to match that exact offset, and then you just need to calculate the count, which is an easy one.
Finally, update nvpartitionmap.txt with the updated sha256sum. Now when you use the modified image, it will be like the very first boot from a UEFI perspective.