Skip to content

Commit b9b5de1

Browse files
authored
fix(provision): hold the ARK boot chain, and let nvidia-jetpack install (#134)
/boot/Image and /boot/*.dtb* are ordinary package files, not conffiles, and the image ships NVIDIA's apt source live. NVIDIA's repo has carried a newer stamp than any image we ship since 36.5.2, so one apt upgrade replaces the ARK defconfig and DTBs with stock. The DTB half is silent — the board still runs the ARK tree from the kernel-dtb partition, so only jetson-io notices, dying on the model mismatch it now sees between /proc/device-tree and /boot/dtb. The camera pin had a second, unrelated cost: nvidia-jetpack-runtime wants nvidia-l4t-gstreamer (>> 36.5-0) (<< 36.6-0), so a truthful 36.4.4 stamp made `apt install nvidia-jetpack` an "impossible situation" no matter what the holds said. Restamping the repacked debs to 36.5.99 puts them inside that window and above NVIDIA's newest 36.5.x, so the metapackage resolves and apt still never wants to upgrade them. Same binaries, same bench-validated stack.
1 parent 547c527 commit b9b5de1

3 files changed

Lines changed: 56 additions & 10 deletions

File tree

docs/argus_relaunch_regression.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ Conclusions the data forces:
4545

4646
## The fix (shipped in this repo)
4747

48-
`--provision` now pins the camera userspace stack to `NV_CAMERA_STACK_VERSION` (versions.env, currently `36.4.4-20250616085344` = JetPack 6.2.1, the newest bench-clean release). Because the 36.4.x debs declare `nvidia-l4t-core (<< 36.5-0)` and exact-stamp deps on cuda/nvsci, provision.sh repacks them (`relax_l4t_deps`): core cap relaxed, out-of-set exact deps unversioned, in-set exact deps retargeted, version suffixed `+ark1` for traceability. They then install as one ordinary `apt-get install --allow-downgrades` transaction — dpkg/apt state stays consistent (`apt-get check` clean) — and are `apt-mark hold` so an on-device upgrade against NVIDIA's repo can't drag them back to the regressed stamp.
48+
`--provision` now pins the camera userspace stack to `NV_CAMERA_STACK_VERSION` (versions.env, currently `36.4.4-20250616085344` = JetPack 6.2.1, the newest bench-clean release). Because the 36.4.x debs declare `nvidia-l4t-core (<< 36.5-0)` and exact-stamp deps on cuda/nvsci, provision.sh repacks them (`relax_l4t_deps`): core cap relaxed, out-of-set exact deps unversioned, in-set exact deps retargeted, and the version restamped to `NV_CAMERA_PIN_VERSION` (`36.5.99-20250616085344+ark1`). They then install as one ordinary `apt-get install --allow-downgrades` transaction — dpkg/apt state stays consistent (`apt-get check` clean) — and are `apt-mark hold` so an on-device upgrade against NVIDIA's repo can't drag them back to the regressed stamp.
4949

5050
Already-flashed 6.2.2.x devices can be fixed in place with the same four repacked debs: `sudo apt-get install -y --allow-downgrades ./ark1_*.deb && sudo apt-mark hold nvidia-l4t-gstreamer nvidia-l4t-camera nvidia-l4t-multimedia nvidia-l4t-multimedia-utils && sudo systemctl restart nvargus-daemon`.
5151

52-
On each BSP bump, rerun the repro below against the new stock stack; drop the pin (set `NV_CAMERA_STACK_VERSION` back to the BSP stamp) once NVIDIA ships a fixed userspace. Known tradeoff while pinned: the camera stack stops receiving NVIDIA's 36.5.x security/bug updates, and `nvidia-jetpack` metapackage installs that pull exact-version camera components may need the hold lifted.
52+
On each BSP bump, rerun the repro below against the new stock stack; drop the pin (set `NV_CAMERA_STACK_VERSION` back to the BSP stamp) once NVIDIA ships a fixed userspace. Known tradeoff while pinned: the camera stack stops receiving NVIDIA's 36.5.x security/bug updates.
53+
54+
### Why the version is restamped, not just suffixed
55+
56+
`nvidia-jetpack-runtime` declares `nvidia-l4t-gstreamer (>> 36.5-0), (<< 36.6-0)`, which no truthful 36.4.4 stamp can satisfy — `apt install nvidia-jetpack` failed outright with "you have requested an impossible situation". `36.5.99` sits inside that window and above NVIDIA's newest 36.5.x, so the metapackage resolves and apt still never wants to upgrade the set. Nothing else in that dependency tree is tighter: `nvidia-l4t-jetson-multimedia-api` asks only for `(>> 36.0) (<< 37.0)` on camera/multimedia/multimedia-utils, and the CUDA/TensorRT/VPI side doesn't depend on them at all.
57+
58+
The contents are still `NV_CAMERA_STACK_VERSION`; the `+ark1` suffix and the real `20250616085344` build stamp in the debian revision are what say so. When the pin is dropped, both variables go back to the BSP stamp together.
5359

5460
For Gremsy (#107): their custom IMX586 driver is not the cause — stock sensors reproduce it. They can apply the same pinned userspace on a 36.5.0-based release (best: current kernel + working cameras), or stay on `b2275f3` (R36.4.3) until NVIDIA fixes 36.5.x.
5561

provision.sh

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,14 @@ sudo chroot "$ROOTFS_DIR" sh -c 'ls /usr/lib/ark-os/mavsdk/lib/libmavsdk.so.* >/
130130
# nvidia-l4t-gstreamer, which the BSP set lacks) with the pinned known-good set. The
131131
# pinned debs' deps assume their own release, so repack each with the out-of-set bounds
132132
# relaxed (nvidia-l4t-core upper cap, exact-stamp cuda/nvsci) and the in-set exact deps
133-
# retargeted to the +ark1 version — a clean apt install instead of dpkg --force-depends,
134-
# so on-device apt stays consistent. Hold the set so an on-device upgrade can't drag it
135-
# back to the regressed BSP stamp.
133+
# retargeted to NV_CAMERA_PIN_VERSION — a clean apt install instead of dpkg
134+
# --force-depends, so on-device apt stays consistent. Hold the set so an on-device
135+
# upgrade can't drag it back to the regressed BSP stamp.
136+
#
137+
# The restamp is also what keeps `apt install nvidia-jetpack` working: the metapackage
138+
# demands nvidia-l4t-gstreamer (>> 36.5-0) (<< 36.6-0), which a truthful 36.4.4 stamp
139+
# can never satisfy, so the whole install failed as an "impossible situation". Nothing
140+
# else in that dependency tree constrains the set any tighter than (>> 36.0, << 37.0).
136141
relax_l4t_deps() {
137142
local in="$1" out="$2" work
138143
work=$(mktemp -d)
@@ -141,13 +146,13 @@ relax_l4t_deps() {
141146
-e "s/nvidia-l4t-core (<< [0-9.]*-0)/nvidia-l4t-core (<< 37.0-0)/" \
142147
-e "s/nvidia-l4t-cuda (= [^)]*)/nvidia-l4t-cuda/" \
143148
-e "s/nvidia-l4t-nvsci (= [^)]*)/nvidia-l4t-nvsci/" \
144-
-e "s/(= ${NV_CAMERA_STACK_VERSION})/(= ${NV_CAMERA_STACK_VERSION}+ark1)/g" \
145-
-e "s/^Version: .*/&+ark1/" \
149+
-e "s/(= ${NV_CAMERA_STACK_VERSION})/(= ${NV_CAMERA_PIN_VERSION})/g" \
150+
-e "s/^Version: .*/Version: ${NV_CAMERA_PIN_VERSION}/" \
146151
"$work/DEBIAN/control"
147152
dpkg-deb -b --root-owner-group "$work" "$out" >/dev/null
148153
rm -rf "$work"
149154
}
150-
echo "Installing the pinned camera userspace stack (${NV_CAMERA_STACK_VERSION}+ark1)..."
155+
echo "Installing the pinned camera userspace stack (${NV_CAMERA_STACK_VERSION} as ${NV_CAMERA_PIN_VERSION})..."
151156
NV_CAMERA_TMP_DEBS=()
152157
for pkg in "${NV_CAMERA_PKGS[@]}"; do
153158
deb=$(nv_camera_deb "$pkg")
@@ -163,8 +168,8 @@ sudo chroot "$ROOTFS_DIR" apt-get install -y --allow-downgrades --allow-change-h
163168
sudo chroot "$ROOTFS_DIR" apt-mark hold "${NV_CAMERA_PKGS[@]}"
164169
for pkg in "${NV_CAMERA_PKGS[@]}"; do
165170
v=$(sudo chroot "$ROOTFS_DIR" dpkg-query -W -f='${Version}' "$pkg")
166-
[ "$v" = "${NV_CAMERA_STACK_VERSION}+ark1" ] || {
167-
echo "ERROR: $pkg is '$v', expected ${NV_CAMERA_STACK_VERSION}+ark1." >&2; exit 1; }
171+
[ "$v" = "${NV_CAMERA_PIN_VERSION}" ] || {
172+
echo "ERROR: $pkg is '$v', expected ${NV_CAMERA_PIN_VERSION}." >&2; exit 1; }
168173
done
169174
# Assert the plugin actually loads and registers nvarguscamerasrc — file existence
170175
# alone misses unresolvable libraries. Inspect the plugin *file*, not the element:
@@ -177,6 +182,34 @@ sudo chroot "$ROOTFS_DIR" env GST_REGISTRY=/tmp/provision-gst-registry.bin \
177182
sudo rm -f "$ROOTFS_DIR/tmp/provision-gst-registry.bin"
178183
for pkg in "${NV_CAMERA_PKGS[@]}"; do sudo rm -f "$ROOTFS_DIR/tmp/ark1_$(nv_camera_deb "$pkg")"; done
179184

185+
### Hold the boot chain we build ourselves
186+
# /boot/Image and /boot/*.dtb* are ordinary package files owned by nvidia-l4t-kernel
187+
# and nvidia-l4t-kernel-dtbs, not conffiles, and the image ships NVIDIA's apt source
188+
# live — so one `apt upgrade` swaps the ARK defconfig and DTBs for stock. The DTB half
189+
# is the silent one: the board keeps running the ARK tree from the kernel-dtb
190+
# partition, so only jetson-io notices, dying on the resulting model mismatch.
191+
# nvidia-l4t-bootloader is in the set because its postinst rewrites the QSPI that
192+
# carries our MB1 BCT pinmux. The kernel packages hold as one group — vermagic ties
193+
# the OOT modules to the kernel, so a partial upgrade is worse than either.
194+
NV_BOOT_CHAIN_PKGS=(
195+
nvidia-l4t-kernel
196+
nvidia-l4t-kernel-dtbs
197+
nvidia-l4t-kernel-headers
198+
nvidia-l4t-kernel-oot-headers
199+
nvidia-l4t-kernel-oot-modules
200+
nvidia-l4t-display-kernel
201+
nvidia-l4t-bootloader
202+
)
203+
echo "Holding the ARK-built boot chain against NVIDIA's apt repo..."
204+
sudo chroot "$ROOTFS_DIR" apt-mark hold "${NV_BOOT_CHAIN_PKGS[@]}"
205+
# apt-mark hold is a no-op on a package that is not installed, so assert the result
206+
# rather than the command.
207+
held=$(sudo chroot "$ROOTFS_DIR" apt-mark showhold)
208+
for pkg in "${NV_BOOT_CHAIN_PKGS[@]}" "${NV_CAMERA_PKGS[@]}"; do
209+
printf '%s\n' "$held" | grep -qx "$pkg" || {
210+
echo "ERROR: $pkg is not held; an apt upgrade would replace it." >&2; exit 1; }
211+
done
212+
180213
### Install pip
181214
sudo chroot "$ROOTFS_DIR" apt-get install -y python3-pip
182215

versions.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,10 @@ JETSON_STATS_VERSION="4.3.2" # jtop daemon + client, installed system-wide via
4747
# one set: mixed stamps break the NvBufSurface ABI.
4848
# On each BSP bump: retest with the BSP stamp and drop the pin once NVIDIA fixes it.
4949
NV_CAMERA_STACK_VERSION="36.4.4-20250616085344"
50+
51+
# Version the repacked debs are restamped to. Must sit inside (36.5-0, 36.6-0) so
52+
# nvidia-jetpack-runtime's "nvidia-l4t-gstreamer (>> 36.5-0) (<< 36.6-0)" resolves,
53+
# and above NVIDIA's newest 36.5.x so apt never wants to upgrade the set. Contents
54+
# are NV_CAMERA_STACK_VERSION; the +ark1 suffix and the real build stamp in the
55+
# debian revision are what say so.
56+
NV_CAMERA_PIN_VERSION="36.5.99-20250616085344+ark1"

0 commit comments

Comments
 (0)