JPT461安装preempt-rt
# 安装环境
sudo apt-get update
sudo apt-get install libncurses5-dev
sudo apt-get install build-essential bc
sudo apt-get install lbzip2
sudo apt-get install qemu-user-static
sudo apt-get install libxml2-utils
#创建目录
mkdir $HOME/jetson_nano
cd $HOME/jetson_nano
#下载
# L4T Jetson Driver Package
wget https://developer.nvidia.com/embedded/l4t/r32_release_v7.1/t210/jetson-210_linux_r32.7.1_aarch64.tbz2
# L4T Sample Root File System
wget https://developer.nvidia.com/embedded/l4t/r32_release_v7.1/t210/tegra_linux_sample-root-filesystem_r32.7.1_aarch64.tbz2
# L4T Sources:
wget https://developer.nvidia.com/embedded/l4t/r32_release_v7.1/sources/t210/public_sources.tbz2
# GCC Tool Chain for 64-bit BSP
#使用浏览器下载得到gcc开头压缩包
https://developer.nvidia.com/embedded/dlc/l4t-gcc-7-3-1-toolchain-64-bit
#解压缩
sudo tar xpf jetson-210_linux_r32.7.1_aarch64.tbz2
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../tegra_linux_sample-root-filesystem_r32.7.1_aarch64.tbz2
cd ../../
tar -xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
sudo tar -xjf public_sources.tbz2
sudo tar -xjf Linux_for_Tegra/source/public/kernel_src.tbz2 -C Linux_for_Tegra/rootfs/usr/src/
##tar -xjf Linux_for_Tegra/source/public/kernel_src.tbz2
# Apply PREEMPT-RT patches
cd Linux_for_Tegra/rootfs/usr/src/kernel/kernel-4.9/
sudo ./scripts/rt-patch.sh apply-patches
#编译
sudo su
export CROSS_COMPILE=/home/lfmmd/jetson_nano/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
make ARCH=arm64 tegra_defconfig
make ARCH=arm64 menuconfig
编译menuconfig选择
General setup → Timer subsystem → Timer tick handling → Full dynticks system (tickless)
Kernel Features → Preemption Model: Fully Preemptible Kernel (RT)
Kernel Features → Timer frequency: 1000 HZ
# 开始编译内核
make ARCH=arm64 -j16
#复制资源
cp arch/arm64/boot/Image /home/lfmmd/jetson_nano/Linux_for_Tegra/kernel/Image
cp -r arch/arm64/boot/dts/* /home/lfmmd/jetson_nano/Linux_for_Tegra/kernel/dtb/
make ARCH=arm64 modules_install INSTALL_MOD_PATH=/home/lfmmd/jetson_nano/Linux_for_Tegra/rootfs/
cd /home/lfmmd/jetson_nano/Linux_for_Tegra/rootfs/
tar --owner root --group root -cjf kernel_supplements.tbz2 lib/modules
mv kernel_supplements.tbz2 ../kernel/
#打包
cd ..
./apply_binaries.sh
cd tools
./jetson-disk-image-creator.sh -o /media/lfmmd/LF/jetson_nanoRT.img -b jetson-nano -r 300
另外 可以直接安装官方的
sudo echo 'deb https://repo.download.nvidia.com/jetson/rt-kernel r32.7 main' \
>> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
sudo apt update
sudo apt install nvidia-l4t-rt-kernel nvidia-l4t-rt-kernel-headers
./jetson-disk-image-creator.sh -o /media/lfmmd/lf/jetson_nano.img -b jetson-nano -r 300