NVIDIA Jetson Orin - JetPack 5.0.2 - Obtaining Sources
Obtaining the kernel and BSP sources is the first step for compiling Jetson Linux in JetPack 5.0.2.
This section explains the prerequisites you must meet and the two supported ways to download the sources: synchronizing with Git through the source_sync.sh
script, or manually downloading and extracting the official archives from NVIDIA.
Prerequisites
Before obtaining the kernel and BSP sources, ensure your host environment meets the following requirements:
- The build will be performed on a Linux host computer using cross-compilation.
- JetPack 5.0.2 is already installed on your host system.
- The following dependencies are installed:
- git-core
- build-essential
- bc
On Debian-based systems you can install them with:
sudo apt install git-core build-essential bc
Obtaining the Sources
There are two supported ways to obtain the Jetson Linux kernel sources:
- Syncing the sources using Git with the
source_sync.sh
script. - Manually downloading and extracting the sources from the NVIDIA Jetson Linux Archive.
Both approaches generate the same outcome: a full kernel source tree, NVIDIA driver modules, and device tree definitions that align with the JetPack 5.0.2 release.
Syncing the Sources
NVIDIA provides the source_sync.sh
script in the Linux_for_Tegra/sources/
directory. This script downloads the kernel, NVIDIA drivers, and device tree sources for the exact JetPack release you are targeting.
- Export the location of your JetPack installation. By default, the SDK Manager installs JetPack 5.0.2 for Jetson AGX Orin under your home directory:
export DEVDIR=$HOME/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra
- Run the script with the appropriate options:
cd $DEVDIR ./source_sync.sh -k -t jetson_35.1
Where:
-k
fetches all kernel-related sources (kernel, nvgpu, NVIDIA drivers, device tree files, etc.).-t jetson_35.1
specifies the tag that corresponds to JetPack 5.0.2 (L4T r35.1).
After the script finishes, the folder $DEVDIR/sources/
will contain the complete source tree, ready for compilation.
![]() | Note: If you encounter errors when running make in the build step, review the Fixes section at the end of this page. |
Manually Downloading the Sources
If you cannot use source_sync.sh
(for example, in a restricted network environment), you can download and extract the sources manually.
- Export the location of your JetPack installation:
export DEVDIR=$HOME/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra
- Download the archives using
wget
:cd ~/Downloads wget https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v1.0/sources/public_sources.tbz2
- Extract the top-level archive:
tar xpf public_sources.tbz2 -C .
- Create the
sources/
directory and unpack the kernel sources:cd $DEVDIR mkdir -p sources tar xpf ~/Downloads/Linux_for_Tegra/source/public/kernel_src.tbz2 -C $DEVDIR/sources
After this step, your $DEVDIR/sources/
directory will contain the kernel source tree and NVIDIA driver code, ready for compilation.
Fixes
In some JetPack 5.0.2 setups, source_sync.sh
may fail because the nvethernetrm
repository is cloned before linux-nvidia.git
, which leads to directory conflicts.
To fix this issue:
- Edit
source_sync.sh
and move thenvethernetrm
entry to appear afterlinux-nvidia.git
:@@ -59,9 +59,9 @@ SCRIPT_NAME=`basename $0` # NOTE: *Add only kernel repos here. Add new repos separately below. Keep related repos together* SOURCE_INFO=" k:kernel/kernel-5.10:nv-tegra.nvidia.com/linux-5.10.git: -k:kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm:nv-tegra.nvidia.com/kernel/nvethernetrm.git: k:kernel/nvgpu:nv-tegra.nvidia.com/linux-nvgpu.git: k:kernel/nvidia:nv-tegra.nvidia.com/linux-nvidia.git: +k:kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm:nv-tegra.nvidia.com/kernel/nvethernetrm.git:
- Remove the problematic directory created by the first failed attempt:
rm -rf $DEVDIR/sources/kernel/nvidia
- Re-run the script:
cd $DEVDIR ./source_sync.sh -k -t jetson_35.1