From ProventusNova DeveloperWiki

Jetson Linux BSP and Kernel Source setup

Keywords: NVIDIA Jetson, JetPack

Description

This wiki pages shows how to get sources for any JetPack version for NVIDIA platform. Download board support package (BSP), sample root file system and kernel sources for kernel customization.

Getting the sources

You can find the desired JetPack version from Jetson Linux Archives.

1. Go to JetPack's version release page and download “L4T Driver Package (BSP)” and “Sample Root filesystem”.

2. You should see this two files with the following names, where XXX specifies the version for L4T:

  • Jetson_Linux_RX.X.X_aarch64.tbz2
  • Tegra_Linux_Sample-Root-Filesystem_RX.X.X_aarch64.tbz2

3. Create a directory for installing JetPack. Referred to as <INSTALL_DIR>. For example:

 
INSTALL_DIR = build
mkdir $INSTALL_DIR
cd $INSTALL_DIR

4. Copy both files to <INSTALL_DIR>

 
cp $HOME/Downloads/Jetson_Linux_RX.X.X_aarch64.tbz2 .
cp $HOME/Downloads/Tegra_Linux_Sample-Root-Filesystem_RX.X.X_aarch64.tbz2 .

5. Extract "L4T Driver Package" tarball:

 
tar -vjxf Jetson_Linux_RX.X.X_aarch64.tbz2

You should see a new directory called Linux_for_tegra in <INSTALL_DIR> directory.

6. Extract "Sample Root Filesystem" into Linux_for_tegra/rootfs

 
sudo tar -C Linux_for_Tegra/rootfs/ -vxjf Tegra_Linux_Sample-Root-Filesystem_RX.X.X_aarch64.tbz2

7. Go into "Linux_for_Tegra/source" directory and extract the kernel sources.

 
cd Linux_for_Tegra/source
./source_sync.sh -k -t <release_tag>

The release tag can be extracted from the release notes of the JetPack version.

8.Return to "Linux_for_Tegra" directory and apply binaries.

 
cd ../
sudo ./apply_binaries.sh

Now you are all set up to customize and build your own kernel.

Customizing the kernel

JetPack 6.X

1. Go to source directory.

 
cd <INSTALL_DIR>/Linux_for_Tegra/source

2. Install pre-requisites

 
sudo apt install build-essential bc

3.Install the toolchain from Jetson Linux release page. From the Tools tab, download Bootlin Toolchain gcc.

 
mkdir $HOME/l4t-gcc
cd $HOME/l4t-gcc
tar xf <toolchain_archive>


Building the Jetson Linux Kernel

1. Go into <INSTALL_DIR>/Linux_for_Tegra/source directory.

2. Set environment variable for cross-compilation, kernel-headers and kernel-output.

 
export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
export KERNEL_OUTPUT=$PWD/kernel_out

3. Build the kernel.

 
make -C kernel

4. Set install path.

 
export INSTALL_MOD_PATH=<INSTALL_DIR>/Linux_for_Tegra/rootfs/

5. Install.

 
sudo -E make install -C kernel
cp $KERNEL_OUTPUT/arch/arm64/boot/Image <INSTALL_DIR>/Linux_for_Tegra/kernel/Image

Building the NVIDIA out-of-Tree Modules

1. Build nvidia-oot.

 
make modules


2. Set install path.

 
export INSTALL_MOD_PATH=<INSTALL_DIR>/Linux_for_Tegra/rootfs/

3. Install.

 
sudo -E make modules_install

Building the DTBs

1. Build DTBs:

 
make dtbs

2. Install:

 
cp kernel-devicetree/platform/generic-dts/dtbs/* <INSTALL_DIR>/Linux_for_Tegra/kernel/dtb/

JetPack 5.X

Need Further Support?

📞 Book Consultation Call: Show Calendar!

📩 Contact Via Email: support@proventusnova.com

🌐 Visit Our Website: ProventusNova.com