Hi everyone,
I’m trying to compile the kernel on my Orin Nano. I downloaded the kernel 5.1 source files from the Nvidia downloads site and built the kernel image using the following commands:
$ make prepare
$ make modules_prepare
# Compile kernel image and kernel modules
$ time make -j5 Image
$ time make -j5 modules
# Install modules and kernel image
$ sudo make modules_install
$ sudo cp arch/arm64/boot/Image /boot/Image
The kernel image is built successfully without any error in between but when I copy it to my /boot directory and replace it with my existing image and reboot the device, I end up with a blank screen.
I see the Nvidia logo during startup and the screen says:
“Warning Test key is used”
“L4T Launcher: Attempting Direct Boot”
“EFI Stub: Booting Linux Kernel …”
after this there is a blank screen although the Jetson is on and the fan is operational too.
Thank you for the quick reply.
Yes, I did try the instructions from this document. I’m trying to compile the kernel on the jetson module natively without a Host machine so I couldn’t find how I could use the instructions from this document regarding Cross-compiling in my case.
Can it be used in my case too? If so, can you help me out?
I’m new to kernel customisation so I’m not fully aware if I’m on the right path in doing it.
sorry that I didn’t notice you are doing it natively.
Did you also replace dtb files and nvgpu.ko as mentioned in the document?
Also, I think as you are doing it natively, directly replacing the kernel image may be dangerous, and I’d suggest backup the original entry in /boot/extlinux/extlinux.conf, and create another one for testing.
If it still does not do the trick, please dump UART log for further debugging.
I had tried replacing the nvgpu.ko file and I had the same result. I’ll try to replace the dtb files as well and also keep the backup for testing.
I’ll update you shortly.
If natively compiling, you don’t name the “ARCH” or any cross tools. It would go something like this (this might build things you are not interested in, and the actual “$TOP” location can differ…in fact most locations can differ):
# --- Setting Up: -------------------------------------------------------
# DO NOT BUILD AS ROOT/SUDO!!! You might need to install source code as root/sudo.
mkdir -p "${HOME}/build/kernel"
mkdir -p "${HOME}/build/modules"
mkdir -p "${HOME}/build/firmware"
export TOP="/usr/src/sources/kernel/kernel-4.9"
export TEGRA_KERNEL_OUT="${HOME}/build/kernel"
export TEGRA_MODULES_OUT="${HOME}/build/modules"
export TEGRA_FIRMWARE_OUT="${HOME}/build/firmware"
export TEGRA_BUILD="${HOME}/build"
# --- Notes: ------------------------------------------------------------
# It is assumed kernel source is at "/usr/src/sources/kernel/kernel-4.9".
# Check if you have 6 CPU cores, e.g., via "htop".
# If you are missing cores, then experiment with "sudo nvpmodel -m 0, -m 1, and -m 2".
# Perhaps use "htop" to see core counts.
# Using "-j 6" in hints below because of assumption of 6 cores.
# -----------------------------------------------------------------------
# Compile commands start in $TOP, thus:
cd $TOP
# Do not forget to provide a starting configuration. Probably copy of "/proc/config.gz",
# to $TEGRA_KERNEL_OUT, but also perhaps via:
make O=$TEGRA_KERNEL_OUT nconfig
# If building the kernel Image:
make -j 6 O=$TEGRA_KERNEL_OUT Image
# If you did not build Image, but are building modules:
make -j 6 O=$TEGRA_KERNEL_OUT modules_prepare
# To build modules:
make -j 6 O=$TEGRA_KERNEL_OUT modules
# To build device tree content:
make -j 6 O=$TEGRA_KERNEL_OUT dtbs
# To put modules in "$TEGRA_MODULES_OUT":
make -j 6 O=$TEGRA_KERNEL_OUT INSTALL_MOD_PATH=$TEGRA_MODULES_OUT modules_install
# To put firmware and device trees in "$TEGRA_FIRMWARE_OUT":
make -j 6 O=$TEGRA_KERNEL_OUT INSTALL_FW_PATH=$TEGRA_FIRMWARE_OUT
Update: I have been able to compile the kernel with the official Documentation itself by not naming any cross compile tools as suggested by @linuxdev. The screen is coming up and my newly compiled kernel is running when I checked with uname -a
Thank you for the help!
I’m facing some issue in updating the config and enabling the Bluetooth TTY and then compiling the kernel again with the updated config. Should be opening a separate Query for this?