My Problem:
I applied the rt-patch.sh on the kernel sources and tried to flash to our Jetson AGX Xavier. Compiling the kernel works fine besides a few warnings but after the initial system configuration on the Xavier it hangs up while booting. I used the latest L4T Release package 32.2 and file system and latest public_sources. The last few lines before getting stuck when booting are:
Started nvpmodel service
Started ZRAM configuration
CPU4: shutdown
Started Argus daemon
CPU5: shutdown
Starting GNOME Display Manager…
After a few minutes when getting stuck it tries to reboot with the same result. Sometimes if it boots for the second or third or fourth time it boots into the OS successfully. This can take up to 20 minutes. Then when setting “nvpmodel -m 0” it takes a few minutes but seems to set the power-mode to MAXN. Rebooting with MAXN set doesn’t get stuck anymore but this is a very unclean solution. It seems like some race-condition with the nvpmodel service during boot to me.
My whole procedure looks like the following:
Download the L4T release package and sample file system for the Jetson Xavier from developer.nvidia.com/linux-tegra
Untar the L4T release package and sample file system:
mkdir $HOME/nvidia
cd $HOME/nvdia
sudo tar xpf ${L4T_RELEASE_PACKAGE}
cd Linux_for_Tegra/rootfs/
sudo tar xpf ${SAMPLE_FS_PACKAGE}
Download the public sources for Jetson Xavier and extract the kernel sources:
cd /where/you/downloaded/sources/
tar -xjf public_sources.tbz2
cd public_sources/
tar -xjf kernel_src.tbz2
Apply rt-patch:
cd kernel/kernel-4.9/scripts
sudo ./rt-patch.sh apply-patches
Create cross-compilation environment:
mkdir $HOME/l4t-gcc
$ cd $HOME/l4t-gcc
Download toolchain from https://developer.nvidia.com/embedded/dlc/l4t-gcc-7-3-1-toolchain-64-bit
$ tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
export CROSS_COMPILE=$HOME/l4t-gcc/bin/aarch64-linux-gnu-
Build kernel
export TEGRA_KERNEL_OUT= /path/where/compiled/kernel/will/be/
mkdir -p $TEGRA_KERNEL_OUT
cd /where/you/downloaded/sources/public_sources/kernel/kernel-4.9
make ARCH=arm64 O=$TEGRA_KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE tegra_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE menuconfig
A GUI menu will pop-up, select Timer Frequency 1000HZ, save, exit.
make ARCH=arm64 O=$TEGRA_KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE -j8
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $HOME/nvidia/Linux_for_Tegra/kernel/Image
sudo cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* $HOME/nvidia/Linux_for_Tegra/kernel/dtb/
cd $HOME/nvidia/Linux_for_Tegra/
sudo ./apply_binaries.sh
cd /where/you/downloaded/sources/public_sources/kernel/kernel-4.9
sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE modules_install \
INSTALL_MOD_PATH=$HOME/nvidia/Linux_for_Tegra/rootfs/
Flash the Xavier
cd $HOME/nvidia/Linux_for_Tegra
sudo ./flash.sh jetson-xavier mmcblk0p1
I also tried all kinds of slightly different procedures suggested in several threads with the same result. What do you suggest to do differently?