Booting Kairos on Nvidia Jetson ARM
Note
Please note that the following page contains only development reference. At the time of writing, we have tried porting Kairos to Jetson Nano eMMC without success. This is due to the old kernel supported (4.9), not properly working withEFISTUB
and U-boot
(you can see the issue here). However, the steps outlined should be a good reference to port Kairos to those architecture when a new kernel version is available. We have tested, and have successfully booted a Jetson Nano with the 5.15 kernel, however, due to the lack of driver support, eMMC partitions are not properly recognized.
This page is a development reference in order to boot Kairos in Nvidia Jetson devices. Nvidia Jetson images by default ship extlinux
as bootloader, without EFI boot. This guide explains how to get instead u-boot to chainload to grub2
, which can be used to boot and load Kairos
.
Note that currently there are no official Kairos core images for Jetson images, this page will refer to Jetson Nano eMMC version as the current reference, but the steps should be similar, as outline how to use the Nvidia SDK to flash the OS onboard in the eMMC of the device.
The steps involved are:
- Prepare the Kernel (if you have one, compatible with
EFISTUB
, you can skip this part) - Flash u-boot (If the U-boot version support booting efi shells, you might skip this part too)
- Prepare the Kairos partitions
- Flash the image to the board
Prerequisites
You need the Nvidia SDK and few other dependencies in the system. Note that for the Jetson Nano you can’t use the latest SDK version as it is not anymore supporting it. The latest version available with support for Jetson Nano is r32.7.3:
Prepare the Kernel
The only requirement of the kernel in order to this to work is that has to have CONFIG_EFI_STUB
and CONFIG_EFI
enabled.
The default kernel with the Nvidia Jetson Nano is 4.9
and it turns out to not have those enabled.
Build from official Nvidia sources
If your kernel is not compiled to boot as EFI stub you can refer to the steps below to compile the official Nvidia kernel with EFISTUB
:
Note that, with the Jetson NANO, the kernel will fail to boot allocating the memory during the EFI stub boot phase.
Build from official linux kernel
Seems the kernel 5.15
boots fine on the Jetson Nano, however, it fails to load eMMC drivers to detect eMMC partitions. A configuration reference can be found here.
Prepare container image (Kairos)
Now we need a container image with the OS image. The image need to contain the kernel and the initramfs generated with dracut
.
For instance, given that the kernel is available at /boot/Image
, and the modules at /lib/modules
:
Flashing
In order to flash to the eMMC
we need the Nvidia SDK.
Replace U-boot (optional)
If the version of u-boot
is old and doesn’t support EFI booting, you can replace the u-boot
binary like so:
Disable Extlinux
We need to disable extlinux, in order for u-boot to scan for EFI shells:
Prepare Partitions
We need to prepare the partitions from the container image we want to boot, in order to achieve this, we can use osbuilder
, which will prepare the img
files ready to be flashed for the SDK:
This command should create efi.img
, oem.img
, persistent.img
, recovery_partition.img
, state_partition.img
in the bootloader
directory
Configure the SDK
In order to flash the partitions to the eMMC of the board, we need to configure the SDK to write the partitions to the board via its configuration files.
For the Jetson Nano, the configuration file for the partitions is located at bootloader/t210ref/cfg/flash_l4t_t210_emmc_p3448.xml
, where we replace the partition name=APP
with:
Note: The order matters here. We want to replace the default “APP” partition with our set of partitions.
If you didn’t changed the default size of the images you should be fine, however, you should check the <size></size>
of each of the blocks if corresponds to the files generated from your container image:
Flash
Turn the board in recovery mode, depending on the model this process might differ:
- Turn off the board
- Jump the FCC REC pin to ground
- Plug the USB cable
- Power on the board
If you see the board ready to be flashed, you should see the following:
To flash the configuration to the board, run:
Troubleshooting notes
You can use picom
to see the serial console:
References
- https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/SD/SoftwarePackagesAndTheUpdateMechanism.html#update-with-partition-layout-changes
- https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html?highlight=kernel
- https://en.opensuse.org/HCL:Jetson_Nano#Update_Firmware
- https://nullr0ute.com/2020/11/installing-fedora-on-the-nvidia-jetson-nano/
- https://forums.developer.nvidia.com/t/support-nano-on-openwrt/219168/7
Feedback
Was this page helpful?
Awesome! Glad to hear it! Please tell us how we can improve.
Oh snap! Sorry to hear that. Please tell us how we can improve.