Building minimal Jetson L4T rootfs for Nvidia Orin AGX CTI board
I was trying to minimize Ubuntu installation footprint on Nvidia Orin board. I ran across this post from Nvidia on how to do that. Unfortunately, I had a specific Connect Tech board, which required some specific drivers from the vendor itself.
Note, that some instructions are taken from Nvidia’s documentation linked above. To combine Nvidia’s storage optimization instructions with Connect Tech’s specific flashing instructions, I ended up doing this:
First, get Jetson Linux from Nvidia and vendor bits from Connect Tech and decompress them:
dude@build:~/custom_fs$ curl -fsSLO https://developer.nvidia.com/embedded/l4t/r35_release_v1.0/release/jetson_linux_r35.1.0_aarch64.tbz2
dude@build:~/custom_fs$ curl -fsSLO https://connecttech.com/ftp/Drivers/CTI-L4T-ORIN-AGX-35.1.0-V005.tgz
dude@build:~/custom_fs$ tar xf jetson_linux_r35.1.0_aarch64.tbz2
dude@build:~/custom_fs$ sudo tar -xzf CTI-L4T-ORIN-AGX-35.1.0-V005.tgz -C ./Linux_for_Tegra
At this point, if you want to bake additional .deb packages into the filesystem, add them to ~/custom_fs/Linux_for_Tegra/nv_tegra/l4t_deb_packages. These packages are not the ones found in Ubuntu repos. Note: it seems, you have to handle dependencies manually.
If you want to include additional packages from Ubuntu Focal repos in the root filesystem, you have to add those to ~/custom_fs/Linux_for_Tegra/tools/samplefs/nvubuntu-focal-minimal-aarch64-packages. Additionally, make sure network-manager is listed as one of the packages to be installed. Now, you can build the root filesystem:
dude@build:~/custom_fs$ cd Linux_for_Tegra/tools/samplefs
dude@build:~/custom_fs/Linux_for_Tegra/tools/samplefs$ sudo ./nv_build_samplefs.sh --abi aarch64 --distro ubuntu --flavor minimal --version focal
New root filesystem will be created in ~/custom_fs/Linux_for_Tegra/tools/samplefs/sample_fs.tbz2. Put the new root filesystem into proper location for flashing and apply vendor bits:
dude@build:~/custom_fs/Linux_for_Tegra/tools/samplefs$ tar -jxf sample_fs.tbz2 -C ../../rootfs
dude@build:~/custom_fs/Linux_for_Tegra/tools/samplefs$ cd ~/custom_fs/Linux_for_Tegra/CTI-L4T
dude@build:~/custom_fs/Linux_for_Tegra/CTI-L4T$ sudo ./install.sh
If necessary, create OEM user and assign new device hostname. l4t_create_default_user.sh script touches necessary files in rootfs directory.
dude@build:~/custom_fs/Linux_for_Tegra/tools$ sudo ./l4t_create_default_user.sh -u admin -p Password123 -n devbox --accept-license
At this point, additional files can be placed in root_fs directory, and will end up on the device after flashing. Finally, flash the new root filesystem onto the device:
dude@build:~/custom_fs/Linux_for_Tegra$ ./flash.sh cti/orin-agx/forge/base mmcblk0p1
Somewhat spaghetti process, I suppose.