# File System customization

**URL:** <https://forums.developer.nvidia.com/t/file-system-customization/126598>\
**Category:** Jetson Xavier NX\
**Tags:** kernel\
**Created:** [June 7, 2020, 2:49am UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598 "2020-06-07T02:49:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro.B](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Alessandro.B](https://forums.developer.nvidia.com/u/Alessandro.B)\
**Post date:** [June 7, 2020, 2:49am UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598/1 "2020-06-07T02:49:59Z")

</div>

I’m trying to make a custom version of the filesystem, following the guide available [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fquick_start.html%23wwpID0E0XD0HA):

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

```
$ tar xf ${L4T_RELEASE_PACKAGE}
$ cd Linux_for_Tegra/rootfs/
$ sudo tar xpf ../../${SAMPLE_FS_PACKAGE}
$ cd ..
$ sudo ./apply_binaries.sh

```

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

After this, I have flashed the board with the **flash.sh** 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.

---

<div class="post-metadata">

**Author:** ![gtj](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gtj/32/11962_2.png) [@gtj](https://forums.developer.nvidia.com/u/gtj)\
**Post date:** [June 7, 2020, 4:18pm UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598/2 "2020-06-07T16:18:53Z")

</div>

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 [https://developer.nvidia.com/jetson-nx-developer-kit-sd-card-image](https://developer.nvidia.com/jetson-nx-developer-kit-sd-card-image) then follow the instructions below…

```auto
$ # unzip the download
$ unzip nv-jetson-nx-sd-card-image-r32.4.2.zip
Archive: ./nv-jetson-nx-sd-card-image-r32.4.2.zip
  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
/dev/loop4
$ # 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:  
./sdcard/var/cuda-repo-10-2-local-10.2.89  
./sdcard/var/visionworks-repo  
./sdcard/var/visionworks-sfm-repo  
./sdcard/var/visionworks-tracking-repo  
./sdcard/etc/apt/sources.list.d/cuda-10-2-local-10.2.89.list  
./sdcard/etc/apt/sources.list.d/visionworks-repo.list  
./sdcard/etc/apt/sources.list.d/visionworks-sfm-repo.list  
./sdcard/etc/apt/sources.list.d/visionworks-tracking-repo.list

Once you’re finished with the sd card image…

```auto
$ 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.

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [June 7, 2020, 7:18pm UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598/3 "2020-06-07T19:18:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Alessandro.B](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Alessandro.B](https://forums.developer.nvidia.com/u/Alessandro.B)\
**Post date:** [June 11, 2020, 6:24pm UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598/4 "2020-06-11T18:24:40Z")

</div>

Thank you. I got it now.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:43pm UTC](https://forums.developer.nvidia.com/t/file-system-customization/126598/5 "2021-10-18T18:43:56Z")

</div>

Closed on October 18, 2021, 6:43pm UTC


