How to install custom kernel with Jetpack 4.4

How can install a new kernel on Jetpack 4.4?

Hi,

Please refer to the l4t developer guide -> Kernel customization.

Follow the steps to build new kernel and new kernel modules.

Then there are few methods to update the kernel image.

  1. For jetpack release prior to 4.3, you have to put Image to Linux_for_Tegra/kernel/Image and re-flash the kernel partition.

  2. For jetpack release >=4.3, you can directly copy and paste the Image to /boot/Image on device and reboot.

There is more to update a kernel than just to copy an image. e.g. the right sources, initrd, kernel modules… Can you provide a link to documentation how to setup the kernel with Jetpack 4.4?

Kernel sources are also on the dlc. Please check.

As for the initrd, please directly use the one under Linux_for_Tegra to do the customization.

Can you specify? Under JetPack_4.4_Linux_JETSON_AGX_XAVIER I see an empty directory source, some kernel package without the source in kernel subdir, I see a sync_source.sh but not the source itself.

Hi,

DLC means the download center.

If I replace /boot/Image with my custom Image the system will not boot anymore. The monitor starts flashing. I know tried both the versions from both DLC and git. I followed the similar Jetpack 4.4 instructions here https://developer.ridgerun.com/wiki/index.php?title=Jetson_Xavier_NX/Development/Building_the_Kernel_from_Source.
The result is always the same. Can you provide me step by step instructions how to get a new kernel to boot?

Where do I copy the Image? On the Jetson or the host? Do I have to flash anything? I have to copy kernel modules? Do I have to update initram? initrd? What about the dtb files?

e.g. all documentation updates the kernel in /kernel while the image is in /boot now

Hi,

It is common that updating kernel will cause system not able to boot.

Also, what you saw is just monitor disappeared, not definitely means the system “cannot boot”
I cannot tell which is the case you have met.
To debug, you need to dump the serial console log.

But what I want to suggest is please read the l4t developer guide first…

I told you to read it in previous comment but it seems you didn’t do it but refer to wiki pages from other sources.

The document is also in the dlc.

This may not answer every of your question. But it would be better for you to understand how this platform works first.

I will answer your questions later.

My first attempt was this NVIDIA guide: https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/kernel_custom.html via the recommended git approach.
Problem with this guide is that it doesn’t tell how to get in onto the Xavier after compiling the kernel and updating the L4T. What I notice is that all guides update Linux_for_Tegra/kernel/Image but never Linux_for_Tegra/rootfs/boot/Image. This seems to refer to the old style of kernel modifications.

Hi,

There are two methods to update kernel image.

Method 1. Just copy and paste the Image to /boot/Image on device and reboot.
Method 2. Copy the image to Linux_for_Tegra/kernel/Image and run the flash command again.

In method 2, this file will eventually be pushed as Linux_for_Tegra/rootfs/boot/Image too.

These two methods are both working fine on rel-32.4.3. For release prior to rel-32.3.1, only method 2 can work. But during that time, kernel image under /boot/ cannot work.

As for your booting issue, my answer is still same. You need to share the serial console log from uart.
Also, you need to tell us what you’ve done to the kernel image.

If you don’t know how to dump the log, please refer to this page I wrote.

It turned out that one of the 2 parameters I changed caused the kernel to hang during boot.
This method is indeed working:

  1. Flash Xavier with Jetpack 4.4 via SDKManager
  2. On the Xavier download L4T 32.4.3 sources here: https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/sources/T186/public_sources.tbz2
  3. tar -xvf ./public_sources.tbz2
  4. cd Linux_for_Tegra/source/public
  5. mkdir tmp;cd tmp
  6. tar -xvf …/kernel_src.tbz2
  7. ./nvbuild
  8. …Sources compiled successfully
  9. sudo cp ./kernel/kernel-4.9/arch/arm64/boot/Image /boot/Image