Reference Manual#

Flashing Script Usage (l4t_initrd_flash.sh)#

This section provides detailed information about l4t_initrd_flash.sh command-line options and other aspects of l4t_initrd_flash.sh usage.

Option/Argument

Description

-u <PKC key file>

PKC key used for ODM fused board.

-v <SBK key file>

SBK key used for encryption.

-p <options>

Pass specified options to flash.sh when generating the image for internal storage.

-k <target_partition>

Flash only the specified partition.

-P <dir>

Specify the output directory when generating a flash package for Jetson devices.

-r

Reuse the existing system image.

<board-name>

Specify the board to use.

<rootdev>

Specify the root device to use.

--no-flash

Generate the flash images.

--flash-only

Flash using existing images.

--external-device <dev>

Generate or flash images for the specified external storage device. If this is used, the -c option must be specified.

--external-only

Skip generating internal storage images.

--usb-instance

Specify the USB port where the flashing cable is connected (such as 1-3).

--sparse

Use sparse image to flash instead of tar image.

-c <config file>

The partition layout for the external storage device.

-S <size>

Size of the external APP partition in bytes. KiB, MiB, and GiB shorthand notation is allowed; for example, 1GiB specifies 1024^3 (1,073,741,824) bytes.

--massflash [<max_devices>]

Flash multiple devices. Optionally specify <max_devices> to limit the number of devices supported. Default is 10.

--showlogs

Spawn gnome-terminal to show individual flash process logs. Applicable for --massflash only.

--reuse

Reuse existing working environment kept by --keep option.

--keep

Keep working environment instead of cleaning up after flashing.

--erase-all

Erase all storage devices before flashing.

--initrd

Stop after device boots into initrd.

--network <netargs>

Flash through Ethernet protocol using initrd flash. <netargs> can be usb0 or eth0:<target-ip>/<subnet>:<host-ip>[:<gateway>]. Examples:

  • --network usb0

  • --network eth0:192.168.0.17/24:192.168.0.21

  • --network eth0:192.168.0.17/24:192.168.1.2:192.168.0.1

--append

Used only with --no-flash and --external-only. Part of a three-step flashing process. Example steps:

  1. sudo ./l4t_initrd_flash.sh --no-flash --reuse jetson-agx-thor-devkit internal

  2. sudo ./l4t_initrd_flash.sh --no-flash --external-only --append jetson-agx-thor-devkit internal

  3. sudo ./l4t_initrd_flash.sh --flash-only jetson-agx-thor-devkit internal

--direct <dev>

Flash specified device directly connected to host. Example: sudo ./l4t_initrd_flash.sh --direct sdb --external-device sda -c flash_external.xml concord sda1

--with-systemimg

Generate system image even when flashing individual partition.

--pv-enc <key_file>

The key to encrypt cpu_bootloader.

--pv-crt <crt_file>

The certificate for the key used to sign cpu_bootloader.

-i <enc_rfs_key_file>

Key for disk encryption support.

--uefi-keys <keys_conf>

Specify UEFI keys configuration file.

--uefi-enc <uefi_enc_key>

Key file (0x19: 16-byte; 0x23: 32-byte) to encrypt UEFI payloads.

--odm-image-gen

Generate ODM payload.

--mass-storage-only

Generate OEM payload for NVMe or eMMC.

--qspi-only

Generate or flash only the QSPI package.

--profile

Specify a chip mapping profile.

--with-systemimg

Generate system image even when flashing individual partition.

--pv-enc <key_file>

The key to encrypt cpu_bootloader.

--pv-crt <crt_file>

The certificate for the key used to sign cpu_bootloader.

-i <enc_rfs_key_file>

Key for disk encryption support.

--ekb-pair

Flash EKB that corresponds to the serial number of the target.

--boot-rootfs

Use flashing kernel initrd to mount Linux_for_Tegra/rootfs as root file system.

--hsm

Enable HSM for image signing/encryption.

--read-ramcode

Generate read_ramcode script.

--no-root-check

Skip root check.

The -p option supports the following options:

Option

Description

-b <emc_bctfile>

Use the specified emc_bct file.

-c <cfgfile>

Flash partition table config file.

-e <bpmp_file>

Use the specified bpmp file.

-g <bpmp_dtb_file>

Use the specified bpmp DTB file.

-l <tbcdtbfile>

CPU bootloader DTB file.

-m <mts_preboot>

MTS preboot, such as mts_preboot_si.

-o <odmdata>

ODM data.

-w <wb0boot>

Warm boot binary, such as nvtbootwb0.bin.

-L <bootloader>

Bootloader, such as cboot.bin or u-boot-dtb.bin.

-M <mts_boot>

MTS boot file, such as mts_si.

-U <int_num_sectors>

The number of sectors of the internal storage device. Default is 119537664.

--boot-chain-flash <c>

Flash only the specified boot chain (such as A, B, or all). Default is all. Not suitable for production.

--boot-chain-select <c>

Specify boot chain (such as A or B) after the board is flashed. Default is A.

--reuse-uuid

Reuse previously generated UUID.

--passthrough

Additional options to pass to the tegraflash command.

--debug

Enable debug mode and --keep option for tegraflash.py. Enables saving unencrypted/unsigned files for UEFI debugging.

The flash script supports some environment variables to override the default behavior.

Environment Variable

Description

EXTOPTIONS

Flash options when generating flash image for external devices. Supports the same options as the -p option.

FLASHING_KERNEL

Defines the path of the initrd image used for running the flashing process.

ERASE_QSPI

Bricks the device when running with --boot-rootfs so that the device can be rcmboot only by l4t_initrd_flash.sh. If --boot-rootfs is not specified, this option does nothing.

ADDITIONAL_DTB_OVERLAY_OPT

Defines the path of the additional DTB overlay file.

EXTOPTIONS supports the following options:

Option

Description

-d <dtbfile>

Device tree file.

-n <nfs_args>

Static NFS network assignments: <client_ip>:<server_ip>:<gateway_ip>:<netmask>.

-r

Skip building and reuse existing system.img.

-C <cmdline>

Kernel command-line arguments. WARNING: Each option gets higher preference over flash.sh values. For NFS booting, script adds arguments related to NFS booting.

-N <nfsroot>

NFS root path (<my_ip_addr>:/my/exported/nfs/rootfs).

-R <rootfs_dir>

Sample rootfs directory.

-T <ext_num_sectors>

Number of sectors of external storage device.

-K <kernel>

Kernel image file, such as zImage or Image.

--uda-dir

Directory to store user data that will be encrypted in UDA partition.

--generic-passphrase

Use generic passphrase for disk encryption.

--disable-random-iv

Disable generation of random IV, SALT1, SALT2, and DERSTR.

--reuse-uuid

Reuse previously generated UUID.

--no-systemimg

Do not create or re-create system.img.

--passthrough

Additional options to pass to the tegraflash command.

--debug

Enable debug mode and --keep option for tegraflash.py. Enables saving unencrypted/unsigned files for UEFI debugging.

Finding the USB Instance#

The l4t_initrd_flash.sh script supports the --usb-instance option to flash a specific Jetson device on a host that has multiple devices in recovery mode. This section provides information about determining which USB instance to use.

  1. Place all devices in recovery mode.

  2. Run the following command:

    $ grep <idProduct> /sys/bus/usb/devices/*/idProduct
    

    idProduct is the USB ID for recovery mode of the device. For example, 7023 is for Jetson AGX Orin and 7026 is for Jetson Thor.

    The result is something like the following:

    /sys/bus/usb/devices/1-1.1/idProduct:7026
    

    1-1.1 is the USB instance number you want to use to specify which device you want to flash.