Hi! I want to load kernel & initrd to RAM on Orin NX 16GB. The reason is
because I don’t have full rootfs ready yet (another person is working on it)
also I want to be able to quickly iterate on kernel changes, without full reflash.
I see that when calling l4t_initrd in RCM mode, boot.img (Android Boot Image) is loaded into RAM and this is what I want.
I’m running this script:
echo "Build kernel & initrd... "
# (use our buildsystem to create Image and initrd)
# Linux_for_Tegra location: use user's env variable L4T_PATH if there's no provided argument
echo "Copy kernel..."
cp ./build/kernel-l4t/sources/kernel/kernel-jammy-src/arch/arm64/boot/Image "$L4T_PATH/kernel/"
cp ./build/kernel-l4t/sources/kernel/kernel-jammy-src/arch/arm64/boot/dts/nvidia/*.dtb $L4T_PATH/Jetson_Linux_R36.4.0_aarch64/Linux_for_Tegra/kernel/dtb/
echo "Extract initrd and include it in recovery.img..."
gunzip --suffix=img -k ./build/initrd_normal_dev.gz -f
# Use abootimg to replace initrd.img inside recovery.img,
# as flashing scripts picks it up from there:
# see l4t_initrd_flash_internal.sh: generate_flash_initrd()
sudo abootimg -u "$L4T_PATH/bootloader/recovery.img" -r ./build/initrd_normal_dev
# Don't flash QSPI, only ask for flashing external (SD card) but purposefully fail it, to be able to use initrd loaded to RAM -> quickest iteration cycle
sudo "$L4T_PATH/tools/kernel_flash/l4t_initrd_flash.sh" --external-only --flash-only --network usb0 -k APP --external-device dummy-should-fail -c tools/kernel_flash//flash_l4t_t234_nvme.xml jetson-orin-nano-devkit dummy-should-fail
At this point initrd shell is running, and I’m happy.
However, where should I place my initrd & kernel to be loaded on device? Right now I’m getting some different initrd loaded, and I can’t figure out how to load my compiled initrd.
I also tried updating contents of bootloader/l4t_initrd.img, as it’s the file that is modified if you run ./tools/l4t_update_initrd.sh, but these changes were not visible on device when I ran ./tools/kernel_flash/l4t_initrd_flash.sh.
Which initrd should I update to see changes on device?
Also where to put dtb to see it updated on device?
Thank you for the link.
However, my question is: where is the initrd file located, precisely the initrd that will be first loaded to Orin during l4t_initrd_flash.sh?
Some questions to confirm:
Since your initd shell is running, which means your own compiled initrd.img is loaded in ram.
How do you verify that your compiled l4t_initrd.img is not loaded in device?
How do you verify that your compiled l4t_initrd.img is not loaded in device?
I made some modifications, like additional directories and files in the initrd. My goal is to put there some new kernel modules so I can test them with Orin before the rootfs is available (e.g. camera drivers for IMX296).
However, these changes are not reflected when I ls -l in the initrd loaded on device.
Maybe apart from updating bootloader/l4t_initrd.img, I need to include the new directories in some script for them to be included in the initrd?
Thank you! Is it possible to modify extlinux.conf in Linux_for_Tegra directory and use it for flashing? Or I need to do it on device, after having mounted rootfs?
Currently I can only boot to initrd, and from there, the /boot is unavailable:
bash-5.1# ls /
bin etc initrd_flash.cfg mnt qspi run sys usr
dev init lib proc root sbin tmp var
I think extlinux.conf doesn’t impact which initrd is booted. When using RCM boot (like I’m doing here) it should only depend on which (kernel + initrd) is packaged into a Android Boot Image boot.img. So we just need to figure out the correct initrd file / Android Boot Image file to update.