Building the Jetson Linux Kernel(36.3)

Black screen after kernel recompilation with new Jetson Linux 36.3 - Jetson & Embedded Systems / Jetson AGX Orin - NVIDIA Developer Forums我按照如下进行的,进行到make ARCH=arm64 LOCALVERSION=-davey-tegra -j8 Image这一步,

Under Linux_for_Tegra/source/kernel/kernel-jammy-src/:

make ARCH=arm64 LOCALVERSION=-davey-tegra defconfig
make ARCH=arm64 LOCALVERSION=-davey-tegra menuconfig
make ARCH=arm64 LOCALVERSION=-davey-tegra -j8 Image
make ARCH=arm64 LOCALVERSION=-davey-tegra -j8 modules
sudo make modules_install INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs
(Manually copy Image into Linux_for_Tegra/kernel/Image and Linux_for_Tegra/rootfs/boot/Image)

Under Linux_for_Tegra/source/:
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
make modules
export INSTALL_MOD_PATH=Linux_for_Tegra/rootfs
sudo -E make modules_install

Under Linux_for_Tegra/:
sudo ./tools/l4t_update_initrd.sh

Then flash the device.

出现错误提示,提示为

arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
  SYNC    include/config/auto.conf.cmd
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
warning: LSE atomics not supported by binutils
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[1]: *** [scripts/Makefile.build:295: scripts/mod/empty.o] Error 1
make[1]: *** Waiting for unfinished jobs....
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[1]: *** [scripts/Makefile.build:122: scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1265: prepare0] Error 2

你的編譯器版本不對所以有些選項會報錯

Hi,
Please refer to steps in developer guide:

Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation

You may be missing this setting:

$ export CROSS_COMPILE=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
1 Like

sudo ./tools/l4t_update_initrd.sh执行完, 还需要执行./apply_binaries.sh 这个吗?

不用
不然你剛更新完的initrd image又會被BSP裡預設的那一包覆蓋過去

生成的新内核, 直接替换到设备 就生效了吧?

kernel image, kernel modules, initrd image全部都要一起裝

Run the following commands to install the kernel and in-tree modules:

$ export INSTALL_MOD_PATH=<install-path>/Linux_for_Tegra/rootfs/
$ sudo -E make install -C kernel
$ cp kernel/kernel-jammy-src/arch/arm64/boot/Image \
  <install-path>/Linux_for_Tegra/kernel/Image

这一步也执行完成了, 接下来就是对设备重新刷机,就可以完成了?

kernel modules有分in-tree和OOT (out-of-tree)
兩個都要做
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Kernel/KernelCustomization.html#building-the-nvidia-out-of-tree-modules

执行到sudo -E make modules_install这一步,结尾如下,没出现successful,

make[1]: Leaving directory '/home/nvidia/36.3.0/Linux_for_Tegra/source/kernel/kernel-jammy-src'
if [ ! -d "/home/nvidia/36.3.0/Linux_for_Tegra/source/nvgpu" ] ; then \
        echo "Directory nvgpu is not found, exiting.."; \
        false; \
fi
================================================================================
make modules_install - nvgpu ...
================================================================================
make -j 4 ARCH=arm64 \
        -C /home/nvidia/36.3.0/Linux_for_Tegra/source/kernel/kernel-jammy-src \
        M=/home/nvidia/36.3.0/Linux_for_Tegra/source/nvgpu/drivers/gpu/nvgpu \
        CONFIG_TEGRA_OOT_MODULE=m \
        srctree.nvidia=/home/nvidia/36.3.0/Linux_for_Tegra/source/nvidia-oot \
        srctree.nvidia-oot=/home/nvidia/36.3.0/Linux_for_Tegra/source/nvidia-oot \
        srctree.nvconftest=/home/nvidia/36.3.0/Linux_for_Tegra/source/out/nvidia-conftest \
        KBUILD_EXTRA_SYMBOLS=/home/nvidia/36.3.0/Linux_for_Tegra/source/nvidia-oot/Module.symvers \
        modules_install
make[1]: Entering directory '/home/nvidia/36.3.0/Linux_for_Tegra/source/kernel/kernel-jammy-src'
  INSTALL /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvgpu.ko
  SIGN    /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvgpu.ko
  DEPMOD  /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra
make[1]: Leaving directory '/home/nvidia/36.3.0/Linux_for_Tegra/source/kernel/kernel-jammy-src'
================================================================================
make modules_install - nvidia-display ...
================================================================================
make -C /home/nvidia/36.3.0/Linux_for_Tegra/source/out/nvidia-linux-header \
        M=/home/nvidia/36.3.0/Linux_for_Tegra/source/nvdisplay/kernel-open modules_install
make[1]: Entering directory '/home/nvidia/36.3.0/Linux_for_Tegra/source/out/nvidia-linux-header'
  INSTALL /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia-drm.ko
  SIGN    /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia-drm.ko
  INSTALL /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia-modeset.ko
  SIGN    /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia-modeset.ko
  INSTALL /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia.ko
  SIGN    /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra/updates/nvidia.ko
  DEPMOD  /home/nvidia/36.3.0/Linux_for_Tegra/rootfs//lib/modules/5.15.136-tegra
make[1]: Leaving directory '/home/nvidia/36.3.0/Linux_for_Tegra/source/out/nvidia-linux-header'

OOT这一步也完成了, 接下来的Building the DTBs 这一步 需要做吗, 还是 可以进行刷机了?

你沒有改device tree就不用

我再问一下,什么情况下,替换Image就可以,不用重新刷机? 还是 都得需要重新刷机才能完成?

基本上都要重新燒板子 不然drivers和kernel image版本對不上 就算能開機也是什麼都不能用

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.