Flash.sh does not update Kernel

I’ve built a custom kernel for Jetpack 4.4.1 but I am unable to flash it onto my device. The command ./flash.sh -k kernel jetson-xavier mmcblk0p1 seems to execute just fine, but my new kernel which is at Linux_for_Tegra/kernel/Image during flashing never shows up on the device which continues to boot using the old version.

If, however, I just copy manually from Linux_for_Tegra/kernel/Image into /boot/Image and reboot the AGX, my new kernel loads just fine.

So is ./flash.sh no longer the correct tool for kernel updates?

hello zeke1cx4u,

it’s a CBoot feature to load kernel image from the LINUX entry,
since you’re using flash commands, it’ll write kernel image into kernel partition,
if you removing FDT entry from the extlinux.conf configuration file, CBoot should loads it via kernel partition instead,

please also refer to CBoot session and please also check the [Kernel Boot Sequence Using extlinux.conf] session.
thanks

Looks like its the same situation for the device tree too?

So instead of flash.sh, the normal kernel & device-tree modification work flow now is to just copy the modified files into /boot on the Jetson and then reboot?

hello zeke1cx4u,

as you can see from the CBoot session, the default extlinux.conf file did not contain FDT entry.
so, it loads device tree from kernel-dtb partition by default.
thanks

There seems to be some misinformation here. Let me attempt to clear it up.

On AGX, CBoot acts like U-Boot on other boards and will look for an extlinux.conf file in /boot/extlinux. This file tells CBoot which kernel, initrd and (optional) DTB to load from the rootfs (/boot), and any extra kernel command line arguments to add (via APPEND). So when you copied your new Image (kernel boot image binary) to /boot/Image, it loaded OK.

The ‘kernel’ and ‘kernel-dtb’ partitions on eMMC on AGX are only used by CBoot if there is no extlinux.conf file found, or no entries for LINUX (kernel) or FDT (dtb). So flashing your new kernel via flash.sh -k kernel will have no effect, unless you remove extlinux.conf (not recommended). Once you finalize your kernel changes, it is a good idea to reflash it to the kernel partition so that it matches the Image file in /boot (same for kernel-dtb, if you change that, especially as by default extlinux.conf does NOT contain an FDT line, so CBoot always loads the DTB from the eMMC partition).

So FDT is for the kernel DTB file location, not the kernel image.
LINUX is for the kernel image file location, not the DTB.
And if either is missing, CBoot on AGX will load that binary from the appropriate partition.
And finally, I always put an kernel DTB I wish to load via extlinux in /boot/dtb, not /boot. Less confusion about what DTB is used then.

Hope this helps,

Tom

Just to help save some sanity, I recommend never replacing the original Image and other content until it is tested. You can use a second boot entry in extlinux.conf, and pick the alternate entry with serial console during boot. If it turns out that this works, then simply alter the “DEFAULT” and it will then use that entry, but the original would still be there as a safety for selection by serial console.