Dear community,
I am working on building custom Jetson Linux kernel natively.
The device: Jetson AGX orin (able to boot from NVMe normally).
JetPack on device: 6.0DP (flashed by SDK manager).
L4T sources used to build the kernel: 36.2.
I have tried 2 different builds:
#1: The sources used to build the kernel is of version 36.2 (same as the Linux running on the machine). I have followed the guide from Problem SMB Jetson Nano - #11 by linuxdev. /proc/config.gz is extracted as the configuration file to keep an exactly same configuration with the currently running system (have CONFIG_LOCALVERSION=-tegra set and $(uname -r) should be 5.15.122-tegra). I build only the kernel image, copy the file to /boot/Image-test, and add an entry in /boot/extlinux/extlinux.conf:
TIMEOUT 30
DEFAULT primary
MENU TITLE L4T boot options
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0005-nv.dtb
INITRD /boot/initrd
APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0
LABEL test
MENU LABEL test kernel
LINUX /boot/Image-test
FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0005-nv.dtb
INITRD /boot/initrd
APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0
Everything works just fine and the system is able to boot from NVMe from the new Image.
#2: However, when I change the CONFIG_LOCALVERSION so that it dose not match the current system, for example CONFIG_LOCALVERSION=-tegra-test ($(uname -r) should now be 5.15.122-tegra-test), and also build the modules, make modules_install them to the corresponding location at /lib/modules/5.15.122-tegra-test/, copy the kernel Image and modify the /boot/extlinux/extlinux.conf same as #1, the system now cannot boot from NVMe. The starup screen stops at:
ERROR: nvme0n1p1 not found
Here is the log:
boot-5.15.122-tegra-test-fail.log (58.8 KB)
Please note that for #2 build, I only built the kernel image and the modules (and install them by copying the files and make modules_install, avoiding any kind of flashing), and left anything else like dtbs, rootfs, initrd… untouched. In the meantime, NVMe driver was built into the kernel (not as separate modules): CONFIG_BLK_DEV_NVME=y.
Any idea what is going wrong? What are the correct steps to build the kernel if I wish to modify the CONFIG_LOCALVERSION (different from current running kernel)? Thanks for your help.