File System customization

I’m trying to make a custom version of the filesystem, following the guide available here:

At one point the guide says to extract the file system into the folder rootfs:

$ cd Linux_for_Tegra/rootfs/
$ sudo tar xpf ../../${SAMPLE_FS_PACKAGE}
$ cd ..
$ sudo ./

Before running the last command sudo ./, I added my files. Then I run the command to install all the other packages.

After this, I have flashed the board with the utility. The flashing was successful and I have seen my files being flashed as well, when I logged into the Xavier XN. However, I have noticed that, with my “custom” filesystem, the cuda examples (and other things) are not there. For example, the folder /usr/local/cuda-10.2/ does not exist. Am I missing a step?

If I configure the board using the SDK Manager, I see that, after flashing the board, the SDK downloads all the GPU/ Computer Vision / IA libraries (cuda, openCV, Tensorflow, etc.) into the target. I assume I should do the same, but from command line. Is this right? If yes, how can I do that?

Thank you.

I think it’s because they’re so large. The Cuda deb files themselves are over 1G and when expanded they’re over 3G.
You can get them from the sd card image though.
If you haven’t already, download the NX sd card image from then follow the instructions below…

$ # unzip the download
$ unzip
Archive:  ./
  inflating: sd-blob.img
$ # create a directory to mount the card image to...
$  sudo mkdir sdcard
$ # create a block loop device for the card image
$ sudo losetup -fPr --show ./sd-blob.img
$ # The actual loop device will vary so use the device reported but there should now be 
$ # /dev/loop4p1 .. ./dev/loop4p11
$ # mount loop4p1 on ./sdcard in read-only mode
$ sudo mount -o ro /dev/loop4p1 ./sdcard

You can now copy the following directories and files to the same places in your rootfs:

Once you’re finished with the sd card image…

$ sudo umount ./sdscard
$ # Substitute loop4 with the actual loop device used above.
$ sudo losetup -d /dev/loop4

Your rootfs should now be at least 1G larger than it was. :)
The packages will have to be installed with apt once the device is running.

There is another way to install them but it’ll make the rootfs even larger (by about 4G)
Copy all the deb files into your Linux_for_Tegra/nv_tegra/l4t_deb_packages directory.
When you run apply_binaries, the cuda and visionworks should also be installed into the rootfs.
WARNING: I haven’t tried this fully so I’d try it on an unmodified rootfs that you can easily discard.


Many of the files of “/usr/local” are added by SDK Manager after flash and do not populate the flash rootfs content. Did you add those files to “Linux_for_Tegra/rootfs/usr/local/” yourself? If not, then they won’t be there. Typical sample applications are cross compiled on the host PC and then copied over via ssh to a running system, and not added during flash. In more recent releases some content can be added by the apt-get mechanism, but those files would not exist on the PC’s “Linux_for_Tegra/rootfs/” unless you personally put them there. If ssh login fails this will fail. If the Jetson is not fully booted, then this will fail.


Thank you. I got it now.