Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NixOS booting issue on Jetson AGX Orin with Jetson Linux 34 #18

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

nesteroff
Copy link
Contributor

@nesteroff nesteroff commented Jan 20, 2023

Description of changes

Currently some Jetson AGX Orin development kits are shipped with Jetson Linux 34. After UEFI firmware is updated using flash-orin-agx-devkit script the system fails to boot from a USB stick with NixOS ISO image.

As it turned out the reason why NixOS fails to boot is that UEFI firmware loads device tree from the EMMC even though we are booting from a USB device. The flash script only updates QSPI because EMMC entry is completely deleted from the flash.xml using this XPath expression: '//device[@type="sdmmc_user"]’. It means that in this case we still have device tree from version 34 on EMMC but NixOS is built based on version 35 and it fails to boot because the device tree is not compatible.

The simplest fix would be to keep kernel-dtb partitions in the flash.xml so that the flash script updates device tree on EMMC as well. Another idea is to change the XPath expression to '//device[@type="sdmmc_user"]/*’ so that it keeps an empty sdmmc_user tag to make the flash script erase the EMMC. When EMMC is erased the UEFI firmware will use the device tree from the QSPI. However the problem with these ideas is that they both make changes to the EMMC which may not be expected when flashing a bootloader.

In order to not to make any changes to EMMC I decided to create a small patch for UEFI firmware so that it doesn't try to load the device tree from EMMC at all. With this patch it will use the device tree from QSPI.

We could also try to copy device tree files to the ISO image and then load it in GRUB but it's probably a lot harder to implement especially considering that the same image is supposed to work on different models.

Testing
  • Flash Jetson Linux 34.1 on Jetson AGX Orin devkit.
  • Flash UEFI firmware.
  • Insert a USB stick with NixOS ISO image.
  • NixOS fails to boot but with this patch it boots fine.

Signed-off-by: Yuri Nesterov <yuriy.nesterov@unikie.com>
@danielfullmer
Copy link
Collaborator

This is an excellent writeup of the issue and solution! Thanks!

I agree with the approach taken here--given we're just trying to turn these devices into standard UEFI-based systems, it makes most sense to use the device tree included with UEFI instead of using a kernel-dtb partition from the eMMC. If we later want to make this like a more standard L4T setup (like in #16), we might make this conditional.

@danielfullmer danielfullmer merged commit 57e5858 into anduril:master Jan 23, 2023
@nesteroff nesteroff deleted the fix-orin-boot branch January 23, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants