Fix NixOS booting issue on Jetson AGX Orin with Jetson Linux 34 #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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