Can apply_binaries.sh install only runtime libraries?

The objective is to make a production unit, that don’t need kernel headers, sample code, etc.
I looked at apply_binaries.sh options, but they failed when I tried them.
If someone can share me relevant information, it would be greatly appreciated.

Various tar archives exist which contain NVIDIA-specific drivers. apply_binaries.sh unpacks those recursively into the rootfs (requires sudo since files are owned by root). The Xavier will not boot or run correctly without those. During a flash JetPack or SDKM will first unpack the driver package (produces the “Linux_for_Tegra/” subdirectory), and then unpack a purely Ubuntu rootfs into the “Linux_for_Tegra/rootfs/” subdirectory. After this those archives are unpacked over the Ubuntu filesystem via “sudo ./apply_binaries.sh”.

Note that apply_binaries.sh is a human readable bash script, so you can look at which archive files are unpacked. These files are not end user applications, and generally speaking, these files are not optional. These files get added as part of flash, whereas extra packages like sample code only get added after flash completes and the Xavier reboots (the Xavier is no longer in recovery mode and is fully booted when those extra packages get added).

You can check the integrity of those mandatory files on a booted Xavier with “sha1sum -c /etc/nv_tegra_release”.

FYI, that “rootfs/” subdirectory is almost an exact copy of the root filesystem. Some minor edits are added to boot configuration, but everything else is an exact match to what is in “rootfs/”.

I tried to run only apply_binaries.sh, (no flash.sh) and I still get:
/user/src/*
/user/games/*

Which is no use on a production unit where there is no display…

I guess I will have to erase whatever I dont’t need by hand.

Thanks

If you run “sha1sum -c /etc/nv_tegra_release” on a running Jetson, then this will tell you if that part is installed correctly (and will name the files checked). If you wish to install extra packages, then this is unrelated to apply_binaries.sh…they’re not that kind of binary.

Examples, development packages, so on, are installed via SDK Manager (or in earlier releases, JetPack). This isn’t particularly convenient for production, but there are a couple of options once packages have been installed once.

First, you can clone the rootfs. Then in production, instead of generating a rootfs each flash, you tell it to “reuse” the existing image…which would be from your clone. This has the advantage that if your clone is from a system which has had all of the “sudo apt update” and “sudo apt-get upgrade” done, followed by validation that “sha1sum -c /etc/nv_tegra_release” is valid, that the end product will also be updated from first boot. You would perhaps need to edit some machine specific content after the flash, e.g., the accounts and passwords would also be cloned. If you have some sort of udev customization dependent upon a MAC address, then the MAC address would still be coded in the udev code.

When cloning you get both a “raw” image and a “sparse” image (if you clone to name “backup.img”, then you will get both that and “backup.img.raw”). The sparse image is smaller and faster to flash, but you can’t manipulate it. The raw image can be loopback mounted, examined, resized, edited, so on. You can also create a new sparse image from a raw image.

Second, SDK Manager can be set to not delete files after a flash. The downloaded “.deb” packages will exist in an NVIDIA subidirectory. If you know the order of install, then you can script this with a simple bash script. Note that the CUDA “repo” file is first, and this adds a local repository to the Jetsons. Once relevant repo files are in, and after running “sudo apt update”, then all of the rest could be added on a single command. There would definitely be some testing required, but once you get the order of install it should be smooth going.