/usr/src contents

New TX1 dev kit, tried installing JetPack target components, ran out of space after installing CUDA toolkit. LibreOffice along with some other irrelevant packages has since been removed.

Space usage analysis revealed the following:

ubuntu@tegra-ubuntu:~$ ls -lhS /usr/src
total 6.4G
-rw-rw-r--  1 nvidia nvidia 4.2G Aug 16  2016 Chromium-52.0.2740.0-Sources.tbz2
-rw-rw-r--  1 nvidia nvidia 2.1G Jan 14  2017 rootfs_src.tbz2
-rw-rw-r--  1 nvidia nvidia  93M Jan 14  2017 kernel_src.tbz2
-rw-rw-r--  1 nvidia nvidia 9.8M Jan 14  2017 u-boot_src.tbz2
-rw-rw-r--  1 nvidia nvidia 2.8M Jan 14  2017 gstjpeg_src.tbz2
-rw-rw-r--  1 nvidia nvidia 2.2M Jan 14  2017 gstegl_src.tbz2
-rw-rw-r--  1 nvidia nvidia 914K Jan 14  2017 v4l2-utils_src.tbz2
-rw-rw-r--  1 nvidia nvidia 310K Jan 14  2017 gstomx1_src.tbz2
-rw-rw-r--  1 nvidia nvidia 291K Jan 14  2017 gstomx_src.tbz2
-rw-rw-r--  1 nvidia nvidia  56K Jan 14  2017 nvgstapps_src.tbz2
-rw-rw-r--  1 nvidia nvidia 7.1K Jan 14  2017 nvsample_cudaprocess_src.tbz2
drwxr-xr-x 23 root   root   4.0K Aug 24 21:16 linux-headers-3.10.96-tegra
-rwxrwxr-x  1 nvidia nvidia 2.1K Jan 14  2017 grab_aarch64_chromium_sources.sh
-rw-rw-r--  1 nvidia nvidia 1.2K Jan 14  2017 README-Chromium.txt
-rw-rw-r--  1 nvidia nvidia  745 Jan 14  2017 sha1sums.txt
-rw-rw-r--  1 nvidia nvidia  142 Jan 14  2017 chromium_src.sha1sum

Seems like a huge waste of (rather limited) storage space on TX1.

dpkg -S /usr/src returns nothing.

Thus, two questions:

  1. Why? :)
  2. Can I safely remove these (pretty sure about the Chromium sources)?

I won’t guarantee it, but I think all of the tbz2 files are not required in “/usr/src/”. If you used JetPack, then some of this might actually be removable via JetPack (not sure, I have no way to verify…but package management of samples and APIs is a major purpose of JetPack). Note that many of the “.deb” packages which are options are in fact stored in a local repository in “/var”…installing the package would copy the files to some active place in the file system, but the local repository would still be there regardless of whether packages are “active”.

When you flashed did you pick to use all space? If not, then the default won’t leave much room. On command line the “-S 14580MiB” maximizes the amount of eMMC available to the root partition.

I’m using the dev kit as is, have not flashed it yet. It came pre-flashed with ubuntu 16.04.
I have not checked the /usr/src before attempting to install JetPack, so I’m not sure whether these files were there before the failed attempt to install CUDA toolkit and the rest.

The JetPack installer does not allow to remove anything from the target, I’m not sure if this is even supported…

Now examining JetPack installer logs.

Installing CUDA implies installing the local repository in “/var”. This in turn likely puts some source code there in “/usr/src”. I have a recently flashed R28.1 TX1 via command line flash, and only the kernel headers are in “/usr/src”. I’d say it is very likely everything there which is an “_src.tbz2” is a result of a JetPack install operation. However, I would normally associate those files with the machine JetPack was actually run on…which should be the desktop PC. Did you run JetPack on the Jetson itself, or on the PC when trying to install components?

Hmm, I think I figured out where those sources came from.

My TX1 came with R24.2.1. If we look here: https://developer.nvidia.com/embedded/linux-tegra-r2421
under the “Source Packages”, there’s “Chromium Sources”. Also, “Release SHA Hashes” contains most of those “_src.tbz2” files. So, apparently, these sources are a part of this particular L4T release, and not JetPack.

It looks like Chromium sources have been added in R24.2. Its release notes mention a switch from Firefox to Chromium. Still not clear why sources are included in the release (4.2GB!)

Regarding your question, I ran JetPack on the desktop PC (host), not on TX1.

I have a 24.2.1 release as well…this release also has only the kernel headers in “/usr/src”. Those files can be obtained from the download page, or probably also via JetPack…but they do not appear in “/usr/src” by default. Unpack the sample rootfs and you’ll see what is there by default…look at the “rootfs/usr/src/” subdirectory on your PC host and you’ll see if this was part of the flash or not.