Jetson/TX1 Sample Root Filesystem

From eLinux.org
Jump to: navigation, search

Releases of NVIDIA L4T and JetPack include a sample root filesystem of the Ubuntu distribution. The version and architecture available depends on the particular version of JetPack-L4T:

JetPack L4T Ubuntu arch
2.0 R23.1 14.04 armhf
2.1 R23.2 14.04 armhf
2.2 R24.1 14.04 armhf, aarch64
2.3 R24.2 16.04 aarch64

Generating the Ubuntu Sample Root Filesystem

This wiki page is a guide to generating the sample root filesystem. The procedure may lend to creating root filesystems for different configurations. The instructions below are for generating the Ubuntu filesystem.

Prerequisites

  1. Ubuntu host machine (i.e. similarly as the PC flashing JetPack-L4T)
  2. Install Qemu VM on host machine
 $ sudo apt-get install qemu

Download the Ubuntu core build

Tarballs can be obtained from the following locations:

14.04 - http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release
16.04 - http://cdimage.ubuntu.com/ubuntu-core/releases/16.04/release

Extract the build in a temporary directory

 mkdir sample_fs
 cd sample_fs
 sudo tar xpf ubuntu-core-<UBUNTU_VERSION>-core-<ARCH>.tar.gz 
* where: * UBUNTU_VERSION - 14.04, 16.04 etc. * ARCH- armhf, arm64 etc.

Copy qemu to /usr/bin

 sudo cp /usr/bin/qemu-<ARCH>-static usr/bin/ 
* where: * ARCH - arm, aarch64.

Mount the chroot points

 sudo mount /sys ./sys -o bind
 sudo mount /proc ./proc -o bind
 sudo mount /dev ./dev -o bind

Configure Internet for chroot in host machine's resolve.conf

 sudo mv etc/resolv.conf etc/resolv.conf.saved
 sudo cp /etc/resolv.conf etc

Enable chroot

 sudo LC_ALL=C chroot . /bin/bash

Install deb packages

If you require any additional packages, install using apt-get or dpkg.

 sudo apt-get update 
 sudo apt-get install <PKG_NAME>

Exit chroot

 exit

Unmount the chroot mount points

  sudo umount ./sys
  sudo umount ./proc
  sudo umount ./dev

Restore resolve.conf

  mv etc/resolv.conf.saved etc/resolv.conf

Remove qemu from /usr/bin

  sudo rm usr/bin/qemu-<ARCH>-static 
* where: * ARCH - arm, aarch64.

Clear out temporary files

 sudo rm -rf var/lib/apt/lists/*
 sudo rm -rf dev/*
 sudo rm -rf var/log/*
 sudo rm -rf var/tmp/*
 sudo rm -rf var/cache/apt/archives/*.deb
 sudo rm -rf tmp/*

Create the tarball

 sudo tar -jcpf ../sample_fs_ubuntu_<UBUNTU_VERSION>_<ARCH>.tbz2  
* where: * UBUNTU_VERSION - 14.04, 16.04 etc. * ARCH- armhf, arm64 etc.

Creating a custom rootfs

For further procedure information for customizations, see the following post on DevTalk: https://devtalk.nvidia.com/default/topic/937671/creating-a-custom-rootfs/?offset=1#4886298