How the boot0.img is generated during kernel flash?

We are looking at the kernel flash which seems to be much faster than the regular flash.
I have met some difficulty on bringing up kernel flash on our customized BSP, and I have narrowed down it to the boot0.img used in the process.

Our customized BSP although can flash successfully through flash.sh fails in kernel flash.
And seems replacing the boot0.img with the one generated from stock BSP will replace the kernel (and maybe more) used during the flash, and it can help me flashing the process successfully, and eventually the device will boot from my custom kernel and rootfs.

So my question is that what is the procedure to generate the boot0.img? Where it is exactly being used.
There are several scripts called in chain in the process and I did not quite find the exact location where the boot0.img is generated. Understanding how it is generated can help me debug my failure of fully utilizing the kernel flash procedure.

Hi user16748,

It seems you are developing the custom BSP package for your customized board.

What’s your Jetpack version in use?

Could you share the full flash log for further check?

Kernel image will be flashed into partition and also stored in rootfs to be loaded during boot up.

Hi Kevin,

Thanks for prompt reply.
We are using Jetpack 5.1.2, i.e. L4T 35.4.1

boot0.img is the first boot partition(i.e. mmcblk0boot0)
It seems the normal flash would not deal with boot0.img.

Please share the full flash log.

Got log from serial and initrd flash folder. Please help to take a look, thanks…
kernel_flash_fail.log (83.8 KB)
flash_3-7_0_20240112-163216.log (7.3 KB)

/tmp/yyh/log-get/mfi_cti/orin-agx/forge/jcb002-econ-nilecam82-8cam/tools/kernel_flash/l4t_initrd_flash_internal.sh: line 47: /tmp/yyh/log-get/mfi_cti/orin-agx/forge/jcb002-econ-nilecam82-8cam/cti/orin-agx/forge/jcb002-econ-nilecam82-8cam.conf: No such file or directory
/tmp/yyh/log-get/mfi_cti/orin-agx/forge/jcb002-econ-nilecam82-8cam/tools/kernel_flash/l4t_initrd_flash.func: line 215: /tmp/yyh/log-get/mfi_cti/orin-agx/forge/jcb002-econ-nilecam82-8cam/cti/orin-agx/forge/jcb002-econ-nilecam82-8cam.conf: No such file or directory

Do you have jcb002-econ-nilecam82-8cam.conf on your host?

What’s you flash command?

May I know what’s your use case?
Do you just want to update kernel image for any debug purpose?

Because we generated the initrd flash tarball on a separate machine than the one we do flashing. I see that the files were in the
ORIGINAL_FOLDER/cti/orin-agx/forge/ folder on the original machine,
and it seems the flash generation script extracted that file and put into the parent folder which turns out to be
TARGET_MACHINE_FOLDER/... . Also, another trial with stock image generation also had the error message but seems to be flashing successfully.

The command to generate the image
sudo BOARDID=3701 FAB=500 BOARDSKU=0004 BOARDREV=F.0 ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --massflash 5 --network usb0 cti/orin-agx/forge/jcb002-econ-nilecam82-8cam mmcblk0p1
the actual flashing command
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 5

We want to have a mechanism that we can flash produciton device at manufacture faster than the default ./flash.sh approach

Okay, so your flash issue is about that you missed the config file in new host machine.

Okay, you could just use massflash to perform faster flash process for production.
Please just make sure the BOARDID/FAB/BOARDSKU/BOARDREV are matched with your board.

Sorry for the previous confusion. The problem was not resolved, I was trying to say the error was also present in a success flash which is without our customization, but we need the customization. It was unclear to me what customization caused the failure.

Anyway, I did more testing today and narrowed down it to the ssh configuration in our rootfs definition which prevented the default root ssh access which is needed by the initrd.

I guess what’s left for me to understand is how the initrd rootfs are generated and why it’s using the L4T regular rootfs sshd configuration considering it’s a very small initrd which will be used for flashing only.

I found where the initrd image is generated, I guess I can just spend a little more time to dig into that to make a workaround. Thanks Kevin

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.