Initrd Modification

Hi all,

i modified initrd init script for my requirement,

with help of Flashing Support — NVIDIA Jetson Linux Developer Guide 1 documentation

I need some support here to fix my issue

i used host pc to modify and replaced the in the boot loader directory on jetson package.
On boot loader there are two files are there

  1. l4t_initrd.img

  2. initrd
    which one need to use to modify and replace?

    I tried multiple time but my debug message was not printing.

I tried on device to modify but device not booting

So pitch me here which option to follow and how to confirm latest image was updated.

If any option is there to flash initrd alone.

Regards,

Muralikrishnan T

*** Please note that this reply is generated by LLM automatically ***

To address your issue, we need to understand the difference between l4tinitrd.img and initrd files in the bootloader directory on the Jetson Orin NX.

l4tinitrd.img is the initial RAM disk image that is used by the bootloader to load the kernel and the initial file system. This image is created by the mkinitrd command during the flashing process.

initrd is the actual initial RAM disk that is used by the kernel to load the file system. This file is extracted from the l4tinitrd.img image during the boot process.

To modify the initrd file, you should modify the l4tinitrd.img file. Here’s why:

  1. The l4tinitrd.img file is the source of the initrd file. When you modify the l4tinitrd.img file, the changes will be reflected in the initrd file during the boot process.
  2. The initrd file is a temporary file that is created during the boot process. Modifying this file directly will not persist the changes across reboots.

To modify the l4tinitrd.img file, you can follow these steps:

  1. Extract the l4tinitrd.img file from the bootloader directory on the Jetson Orin NX.
  2. Modify the init script inside the l4tinitrd.img file using a tool like mkinitrd or by manually editing the file.
  3. Rebuild the l4tinitrd.img file using the modified init script.
  4. Replace the original l4tinitrd.img file in the bootloader directory with the modified one.

To confirm that the latest image was updated, you can check the boot logs for any errors or warnings related to the initrd file. You can also verify that your debug messages are printed during the boot process.

As for flashing the initrd file alone, it’s not possible to flash the initrd file separately from the kernel. However, you can use the mkinitrd command to rebuild the l4tinitrd.img file and then flash the updated image to the Jetson Orin NX.

Here’s an example of how to rebuild the l4tinitrd.img file using mkinitrd:

sudo mkinitrd -o /boot/l4tinitrd.img

This command will rebuild the l4tinitrd.img file using the current kernel and file system configuration.

To flash the updated l4tinitrd.img file to the Jetson Orin NX, you can use the flash.sh script provided by NVIDIA:

sudo ./flash.sh -r -k LNX jetson-orin-nx-devkit mmcblk0p1

This command will flash the updated l4tinitrd.img file to the Jetson Orin NX, along with the kernel and file system.

Note that flashing the initrd file alone is not recommended, as it may cause issues with the kernel and file system. It’s always best to flash the entire image, including the kernel and file system, to ensure a consistent and stable system.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi muralikrishnan.t,

They are the same, differing only in name.
Please follow the guide’s instructions to update the /boot/initrd on your board.

# cp /boot/initrd /tmp/l4t_initrd.img
# mkdir /tmp/temp
# cd /tmp/temp
# gunzip -c /tmp/l4t_initrd.img | cpio -i
(modify the content, e.g. init)
# vim init
# find . | cpio -H newc -o | gzip -9 -n > ../l4t_initrd.img
# cp /tmp/l4t_initrd.img /boot/initrd

Hi Kevin,

I tried but device on booting.

Hi,

How to modify with help of host PC

Hi,

I modified initrd with help host pc but my changes are not reflected, so guide me understand better.

Please check the boot issue through serial console log.

Do you mean that you want to update the initrd on the host PC before flashing the device?
If so, please refer to the steps in JetPack6 l4t_initrd.img - #28 by KevinFFF