How to rebuild kernel for Jetson Linux 35.2.1

Hi,

You could try with the detailed steps here: NVIDIA Jetson Orin - Compiling Code - RidgeRun Developer Connection

Additionally a more “manual” approach could be as follows (just make sure to change the paths according to your system):

SOURCES=`pwd`/kernel_src
TOOLCHAIN_PREFIX=/opt/l4t-gcc/aarch64--glibc--stable-2020.08-1/bin/aarch64-buildroot-linux-gnu-
TEGRA_KERNEL_OUT=`pwd`/kernel_build/jetson_linux_35.2.1_image
KERNEL_MODULES_OUT=`pwd`/kernel_build/jetson_linux_35.2.1_modules

mkdir -p $TEGRA_KERNEL_OUT
mkdir -p $KERNEL_MODULES_OUT

make -C $SOURCES/kernel/kernel-5.10/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} tegra_defconfig
make -C $SOURCES/kernel/kernel-5.10/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} -j$(nproc) Image
make -C $SOURCES/kernel/kernel-5.10/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} -j$(nproc) dtbs
make -C $SOURCES/kernel/kernel-5.10/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} -j$(nproc) modules
make -C $SOURCES/kernel/kernel-5.10/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra INSTALL_MOD_PATH=$KERNEL_MODULES_OUT modules_install

cp -rfv ${TEGRA_KERNEL_OUT}/arch/arm64/boot/Image kernel/
cp -rfv ${TEGRA_KERNEL_OUT}/arch/arm64/boot/dts/nvidia/* kernel/dtb/
sudo rsync -azPu ${KERNEL_MODULES_OUT}/lib/modules/5.10.104-tegra rootfs/lib/modules/
sudo ./apply_binaries.sh

Jafet Chaves,
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

2 Likes