Decide kernel image in bootloader

I wanted to know whether it is possible or not to decide between two kernel images at bootloader stage. Something like having a grub menu to decide between two kernel images, just to avoid having to flash the TX2 again if the Image is wrongly built.

I hesitate to answer since some content now requires being signed, but take a look at “/boot/extlinux/extlinux.conf” (I have not tested on recent releases). You might duplicate the first entry, and make an alternate entry. The alternate might look like the following, with “Image” renamed:

LABEL primary
      MENU LABEL primary kernel
      LINUX <b>/boot/Image-custom</b>
      APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4

Keep in mind that all modules must be found in “/lib/modules/$(uname -r)/”, and thus if this custom Image results in the same “uname -r”, then you won’t need a separate module directory…but if there is a difference, then modules must also be added.

Selecting alternate entries is only available via serial console by interrupting U-Boot at the critical moment with a keystroke. If you interrupt before it asks for kernel to select, then simply continue with the “boot” command (kernel selection phase immediately follows this). Serial console information is here:

It is possible that the alternate kernel will be selected, but then rejected if signing is getting in the way.