How to install a custom kernel for testing puroses (AGX Xavier)

Hi, im currently trying to install a customized kernel on a AGX XAVIER.

So far I have compiled a kernel on the Jetson itself and am now stuck on getting it to boot that kernel.

Following are the steps I tried:

  • Downloaded the Jetson kernel sources
  • Installed needed build tools
  • Set up a .config with custom kernel suffix
  • Compiled the kernel
  • Did a make modules_install
  • Did a make install

After that I checked that the in /boot the new kernel, dtb’s and initrd are present.
I edited extlinux.conf to have the primary label point to the new initrd and kernel.

Is something wrong with this approach or did I miss something?
I also looked over the boot log, which is printed over the serial console, but coudn’t really figure out why it proceeds to boot the old kernel.

Also in the documentation secureboot is mentioned, is it mandatory to sign the new kernel, or can I omit that for now?

Also can someone explain me where exactly the device tree files have to be placed?
The nvidia documentation says to place everything from $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/ in L4T/kernel/dtb/.
But for example the Raspberry Pi documentation handels this slightly different with *.dtb under /boot and *.dtbo under /boot/overlays.
What determines where these have to go?


Were you performing those steps natively on the Xavier? What was the kernel suffix you used? What happened with the failure (did the system not boot, or did something else go wrong)?

It is always a good idea in such kernel cases to provide a full serial console boot log to see what goes on in setup prior to the failure, and to see the details of the actual failure. Looks like you had the log, but need to post it to the forum. Make sure your extlinux.conf does not use the “quiet” parameter anywhere.

What occurs for boot can differ wildly with embedded hardware. Embedded systems don’t have a BIOS to present a uniform boot interface, and each embedded system basically flashes what would be considered the CMOS BIOS along with the rest of the boot content, customized for the particular device. You would mostly ignore any RPi information so far as boot and kernel setup goes (there is a strong chance that parts of it match the Jetson information, but one difference implies a failure to boot).

Often the location to search for items is in the extlinux.conf. This is read by CBoot, which does not exist in an RPi. I don’t know the answer to the “.dtb/.dtbo” question, but even in the case of a Jetson this varies depending on what release you are using. You should state the L4T release (see “head -n 1 /etc/nv_tegra_release”).

Note that there are times when changes to a kernel are needed to be put into the initrd, but there are also plenty of times when this is not needed. You’d need to state what kind of changes you made, specifically if the changes involve early boot stages (an example of this would be changes to use a different filesystem type, or perhaps to use a new module needed for boot).

boot.log (95.5 KB)
extlinux.conf (809 Bytes)

Thanks for your Answer,
I appended the log I received from the uart and also the extlinux.conf.

The failure is, there is no failure in the log. At least none which lets me get a hint of what I did wrong.
Its starts to boot the old kernel which I labelled backup in the .conf, without really mentioning something about the primary option.

The old kernel is named 4.9.140-tegra and the freshly compiled one is 4.9.201-tegra-custom_kernel.
I compiled it natively on the Xavier, with basically no customization made till now, since I wanted to have a bootable kernel prior to making any changes.
I only used the kernelconfig of the running system to have the new kernel configured the same way (beside the LOCALVERSION string).
I downloaded the sources directly from Nvidia.
L4T release:
# R32 (release), REVISION: 2.1, GCID: 16294929, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 13 04:45:36 UTC 2019

The RPi reference was just because I have some experience with kernel building on the Pi and wondered how its meant to work in general. (I’d really like a recommendation for a good comprehensive read)

One thing I noticed just now, I guess has to do with the new initrd (which was generated by make install), is that a wifi dongle I used wont work anymore.

I think the error is the form of the kernel you installed. I don’t think vmlinuz will work on a Jetson. The uncompressed base kernel is usually (always?) built when building other forms, and that is just the file “Image”. Jetsons don’t support all of the kernel formats a PC supports. Jetsons used to support zImage (compressed), but when moving from 32-bit to 64-bit, due to Linux understanding this but the boot chain prior to Linux not dealing well with 64-bit (64-bit ARM was brand new), the uncompressed Image file started use.

Look in your kernel source at “kernel/Image” if you still have your build, and replace this:
…with something derived from the Image file, e.g.:

Note that this is the same kernel, but the file format differs.

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