nvidia: move to a 2 stage install#1752
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the NVIDIA Jetson Orin target to use a two-stage, initrd-based flashing flow that builds and flashes standalone ESP (FAT32) and root (ext4) partition images, replacing the legacy single sdImage approach.
Changes:
- Switch Orin flake outputs to expose the new initrd-based flash script (
initrdFlashScript) instead of the legacy flash script. - Add
ghafFlashImagesbuild output producingesp.img.zstandroot.img.zst, and wiresystem.build.ghafImageto that output. - Remove legacy sdImage/partition-template modules and introduce the new two-phase initrd flashing implementation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| targets/nvidia-jetson-orin/flake-module.nix | Switches exported flash script package from legacy to initrd-based script. |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/sdimage.nix | Removes legacy sdImage-based image generation. |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/partition-template.nix | Removes legacy flash.xml templating and sdImage partition extraction logic. |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/initrd-flash.nix | Adds device+host two-phase initrd flashing flow (RCM boot + USB mass storage image write). |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/format-module.nix | Rewires ghafImage to ghafFlashImages instead of sdImage. |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/flash-images.nix | Builds standalone compressed ESP/root images used by the initrd flash flow. |
| modules/reference/hardware/jetpack/nvidia-jetson-orin/default.nix | Updates Orin module imports to include the new flash-images and initrd-flash modules. |
modules/reference/hardware/jetpack/nvidia-jetson-orin/initrd-flash.nix
Outdated
Show resolved
Hide resolved
810ebc6 to
402382d
Compare
| mount -t configfs none /sys/kernel/config | ||
| if [ -e /sys/kernel/config/usb_gadget ] ; then | ||
| gadget=/sys/kernel/config/usb_gadget/g.1 | ||
| mkdir $gadget |
There was a problem hiding this comment.
If /sys/kernel/config/usb_gadget is missing (or gadget setup fails), ttyGS is never set and the host-side script will hang waiting for /dev/serial/by-id/.... Since the rest of the flashing protocol depends on USB ACM, consider failing fast here (print an error and drop to a shell / reboot) rather than continuing silently.
Builds standalone ESP and root partition images for initrd-based flashing. These replace the legacy sdImage approach: instead of a single disk image, we build ESP (FAT32) and root (ext4) as independent compressed images that are written to eMMC partitions created on-device by sgdisk. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
402382d to
b9c9a61
Compare
|
Could we get testing instructions please? Also, we are not yet quite sure how to make this work in the automated tests. That will need to be figured out before this can be merged. |
done, for the instructions. |
|
Tried this on Orin AGX nix build .#nvidia-jetson-orin-agx-debug-from-x86_64-flash-script --option builders '' sudo ./result/bin/flash-ghaf-host Didn't get feelings of success joy and happiness. It does not boot, obviously because waiting FIRMWARE_DONE timed out. |
|
Checked on AGX 32GB failed. Fixed the flash script Now working on AGX 32 GB. https://github.com/emrahbillur/ghaf-support-for-nx/tree/initrd-flash-image Will be checking the AGX 64GB also tonight. |
|
After testing AGX 64GB I'll merge my commits on this PR |
|
Fails on AGX 32 GB also again, it works after flash but lost after first reboot. This is due to the renaming of the flash storage device name. We need to adjust it to fix the flash. |
Builds standalone ESP and root partition images for initrd-based flashing. These replace the legacy sdImage approach: instead of a single disk image, we build ESP (FAT32) and root (ext4) as independent compressed images that are written to eMMC partitions created on-device by sgdisk.
Description of Changes
Type of Change
Related Issues / Tickets
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify: