Commit 0724777
committed
FDE port from x86 to nvidia
- Modified files:
- targets/nvidia-jetson-orin/flake-module.nix
- modules/reference/hardware/jetpack/nvidia-jetson-orin/partition-template.nix
- modules/partitioning/deferred-disk-encryption.nix
What This Change Set Achieves
- Adds phase-1 full disk encryption (FDE) support for Orin AGX debug targets using deferred first-boot encryption.
- Keeps existing Orin targets intact; introduces additive -fde-phase1 target variants.
- Refactors flash flow so phase1 targets can produce working -flash-script / -flash-qspi artifacts.
- Preserves default installer-marker behavior globally, while bypassing marker only for phase1 targets.
Previously Added (same target file, same branch context)
- Logging enabled for all Orin targets (copied from x86 template style) in targets/nvidia-jetson-orin/flake-module.nix.
- GIVC enabled for AGX debug cross targets (agx-debug and agx-debug-nodemoapps) in targets/nvidia-jetson-orin/flake-module.nix.
Detailed Changes
- targets/nvidia-jetson-orin/flake-module.nix
- Added phase1 generator functions:
- generate-fde-phase1
- generate-fde-phase1-cross-from-x86_64
- New additive target variants for:
- nvidia-jetson-orin-agx-debug-fde-phase1
- nvidia-jetson-orin-agx-debug-nodemoapps-fde-phase1
- plus their -from-x86_64 variants.
- Phase1 target behavior:
- Disables sd-image format modules.
- Switches package output to system.build.ghafImage.
- Imports disko+verity partition modules.
- Enables deferred encryption.
- Overrides encrypted device path to "/dev/disk/by-partlabel/APP".
- Disables installer marker requirement for phase1 only.
- Cross image-builder compatibility tuning:
- Uses pkgs.buildPackages, enables binfmt, pins image-builder kernel packages to build-side kernel packages.
- Adds host/build platform overrides for disko builder config.
- Disk layout tuning for flash constraints:
- Forces disk image size/LV sizing (58G image, 44G root, 8G swap, 2G persist).
- Refactors flash package generation:
- Introduces flashableCrossTargets = crossTargets ++ fdePhase1CrossTargets.
- Flash artifacts are now emitted for both existing and phase1 cross targets.
- modules/partitioning/deferred-disk-encryption.nix
- Added new options:
- ghaf.storage.encryption.lvmPartitionDevice (nullable string override)
- ghaf.storage.encryption.requireInstallerMarker (bool, default true)
- Updated device selection logic:
- Uses override if provided, then verity path, then disko default.
- Marker handling is now conditional:
- Marker-check + marker-removal are wrapped under requireInstallerMarker.
- Result:
- Existing behavior unchanged by default.
- Phase1 can bypass installer marker safely and target APP.
- modules/reference/hardware/jetpack/nvidia-jetson-orin/partition-template.nix
- Refactored image handling to support two source layouts:
- Traditional sd-image (esp.offset/root.offset)
- Disko raw image (disk1.raw)
- For raw-image path:
- Detects ESP/APP partitions via fdisk.
- Extracts ESP and APP with dd.
- Added conv=sparse for root extraction to avoid temporary-space exhaustion.
- Added APP-size clamp to align with Jetson flash XML fixed upper bound:
- Prevents GPT generation failure (End sector for APP ... expected ... actual: 0).
Target/Artifact Matrix After Change
- Existing targets remain unchanged.
- New phase1 outputs include:
- ...-fde-phase1
- ...-fde-phase1-from-x86_64
- ...-fde-phase1-from-x86_64-flash-script
- ...-fde-phase1-from-x86_64-flash-qspi
- same for ...-agx-debug-nodemoapps...
Validation Performed
- Evaluated phase1 config options successfully:
- encryption enabled/deferred
- lvmPartitionDevice resolves to /dev/disk/by-partlabel/APP
- installer marker requirement false for phase1
- first-boot-encrypt initrd service enabled and wired
- Built successfully in Docker Compose:
- nvidia-jetson-orin-agx-debug-fde-phase1-from-x86_64
- nvidia-jetson-orin-agx-debug-nodemoapps-fde-phase1-from-x86_64
- ...-flash-script for both
- ...-flash-qspi evaluates and builds to initrd-flash output
- Fixed several intermediate blockers during validation:
- exec-format issues in image builder
- missing kernel module expectations in initrd
- flash temp-space issues
- APP GPT boundary mismatch
Runtime/Operational Guidance
- Recommended deployment flow for phase1:
- dd phase1 disk1.raw to USB.
- Flash only QSPI with ...-flash-qspi.
- Boot with USB attached.
- Why QSPI-only:
- Avoids potential APP label ambiguity between internal and external media during deferred encryption.
What Is Not Changed
- Non-phase1 targets do not inherit deferred-encryption behavior.
- Global default marker requirement remains enabled (true), preserving existing installer-based expectations outside phase1.
Signed-off-by: vadik likholetov <vadikas@gmail.com>1 parent b897227 commit 0724777
File tree
3 files changed
+169
-22
lines changed- modules
- partitioning
- reference/hardware/jetpack/nvidia-jetson-orin
- targets/nvidia-jetson-orin
3 files changed
+169
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| |||
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
588 | | - | |
589 | | - | |
590 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
591 | 597 | | |
592 | 598 | | |
593 | 599 | | |
| |||
619 | 625 | | |
620 | 626 | | |
621 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
622 | 640 | | |
623 | 641 | | |
624 | 642 | | |
| |||
Lines changed: 51 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
152 | 227 | | |
153 | 228 | | |
154 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
155 | 241 | | |
156 | 242 | | |
157 | 243 | | |
158 | 244 | | |
159 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
160 | 248 | | |
161 | 249 | | |
162 | 250 | | |
163 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
164 | 254 | | |
165 | | - | |
| 255 | + | |
166 | 256 | | |
167 | 257 | | |
168 | 258 | | |
169 | | - | |
| 259 | + | |
170 | 260 | | |
171 | 261 | | |
172 | 262 | | |
| |||
175 | 265 | | |
176 | 266 | | |
177 | 267 | | |
178 | | - | |
| 268 | + | |
179 | 269 | | |
180 | 270 | | |
181 | 271 | | |
| |||
0 commit comments