Hi,
I am trying to build a custom kernel with PREEMPT_RT
on my Jetson Orin Nano with Jetpack 6.1 and R36.4.0 and I’m running into issues. I’m on my 4th go. First I compiled the kernel in WSL2, but wasn’t able to copy/install anything on the Jetson because the USB connection would timeout. Next I tried compiling the kernel on my linux laptop and then I executed the flash.sh
script but that failed because it couldn’t find the mount point/NVMe. And now I’ve tried to compile the kernel locally on the Jetson Orin Nano itself and then just copied the necessary files from my temporary build folder into /boot/Image
, / boot/dtb
, and /lib/modules
.
I used a modified version of the scripts found here GitHub - hmxf/RTJetson: Preempt-RT Kernel Build Guide for NVIDIA Development Board to work with R36.4 so I could grab the correct files.
Also I looked at the instructions here Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation but wasn’t able to get the new kernel to boot.
Here is the script I used to build the kernel locally on the Jetson Orin Nano followed by the serial console logs.
#!/bin/bash
# Red is 1
# Green is 2
# Reset is sgr0
BUILD_DIR=~/RTJetsonBuild/R36.4.0
cd $BUILD_DIR
tput setaf 2
echo "Extract files"
tput sgr0
sudo tar xpf Jetson_Linux_R36.4.0_aarch64.tbz2
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R36.4.0_aarch64.tbz2
cd ../../
#tar -xvf aarch64--glibc--stable-2022.08-1.tar.bz2
sudo tar -xjf public_sources.tbz2
tar -xjf Linux_for_Tegra/source/kernel_src.tbz2
tput setaf 2
echo "Apply PREEMPT-RT patches"
tput sgr0
sudo ./generic_rt_build.sh enable
tput setaf 2
echo "Compile kernel"
tput sgr0
TEGRA_KERNEL_OUT=kernel_out
mkdir $TEGRA_KERNEL_OUT
cd kernel/kernel-jammy-src
make O=$TEGRA_KERNEL_OUT tegra_defconfig
tput setaf 2
echo "Confirm if these config options are chosen."
echo "General setup -> Preemption Model (Fully Preemptible Kernel (Real-Time))"
echo "Kernel Features -> Timer frequency: 1000 HZ "
echo "If not, choose them in menuconfig interface."
echo "Else, quit menuconfig and compile will auLto start."
echo "Press Return Key to continue........"
tput sgr0
read
make O=$TEGRA_KERNEL_OUT menuconfig
make O=$TEGRA_KERNEL_OUT -j$(nproc)
tput setaf 2
echo "Copying results"
tput sgr0
sudo cp kernel_out/arch/arm64/boot/Image $BUILD_DIR/Linux_for_Tegra/kernel/Image
sudo cp kernel_out/arch/arm64/boot/Image.gz $BUILD_DIR/Linux_for_Tegra/kernel/Image.gz
sudo cp -r kernel_out/arch/arm64/boot/dts/nvidia/* $BUILD_DIR/Linux_for_Tegra/kernel/dtb/
sudo make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$BUILD_DIR/Linux_for_Tegra/rootfs/
cd $BUILD_DIR/Linux_for_Tegra/rootfs/
sudo tar --owner root --group root -cjf kernel_supplements.tbz2 lib/modules
sudo mv kernel_supplements.tbz2 ../kernel/
tput setaf 2
echo "Applying binaries"
tput sgr0
cd ..
sudo ./apply_binaries.sh
And here are the serial console logs. These are two attempts I made at booting after compiling the kernel and trying to use it.
serial-console-rt-kernel-log.txt (64.8 KB)
serial-console-rt-kernel-log-2.txt (75.6 KB)