4. Kernel

Get Kernel Sources

The recommended way to get the kernel source is calling sudo ./source_sync.sh in your L4T folder, e.g.,

export L4T=$HOME/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra
cd $L4T
# for JetPack 4.4
sudo ./source_sync.sh -k tegra-l4t-r32.4.3

Then you will download around 2G sources for further kernel and device tree compile.

circle-info

You may check the right tag corresponding to the JetPack you are using.tegra-l4t-r32.4.3 is the tag for the L4T version of JetPack 4.4.

Get Cross-Compile Tools

Jetson is an ARM based computer. In order to compile a kernel image on Jetson, i.e., ARM, we have to download a cross-compile toolchain for it. You can download the toolchain (around 900M) by the following commands.

mkdir -p $HOME/l4t-gcc
cd $HOME/l4t-gcc
wget 
http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

Compile Kernel

There are 3 types of compile situation.

1. First Time Compile

For the 1st time compilation, you have to generate a default config file. The reference commands are as the follows:

2. Compile after Minor Changes

If you just change a few kernel sources, you can use the below commands as reference. The compile time is supposed to be shorter compared with 1st time compilation.

3. If Compile Failed

You may try to clean up the build environment by the following commands.

circle-info

Please notice, although you will still have your modified kernel sources, but you will loose your previous config file.

Replace the Kernel Image on NRU Series

You can update your kernel sources by moving the compiled Image to the /boot folder on the NRU series.

circle-info

Please notice that a mismatched or error kernel image, might make your NRU won't be boot into OS again.

I usually update the kernel image via a local network. The reference commands are as the below.

Last updated