Repository navigation
1bit-update: end-to-end test on a loop-mounted installed disk; --shadowed reads the list out of the slot's SFS (engine#3342) - #3357
Conversation
…owed reads the list out of the slot's SFS (engine#3342) tests/update_e2e_loop_test.sh runs the REAL 1bit-update against a GPT disk image (ESP 1BIT-OS with grub.cfg, ext4 1BIT-DATA with /1bit and the shared save layer) inside its own mount namespace, then boots the new slot as an overlay (its SFS under the shared upper) and checks what the machine sees. The save layer is seeded through a real overlay mount with a hand-edited release script, a whiteout over a release tool, a kernel-made opaque directory, and the machine's own state. Found by it: when /initrd/pup_ro2 is not mounted, run_base is the slot's .sfs FILE, and the release-owned list was read from a path under that file. That path cannot exist, so --shadowed and --status fell through to /etc (where a save-layer copy of the list would win) and --shadowed refused. The list is now read out of the SFS with unsquashfs -cat; the temp copy is removed on exit. Root, loop devices and getfattr/setfattr are needed, so the test returns 77 in CI (tools/ci/ctest_skips.txt). Measured as root on ryzen: 14/14, no loop device or mount left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review from cl-buildenv: I ran the test in the CI image ( The skip is right today for the wrong reason, and it turns red if CI ever adds two packages.
Otherwise LGTM: a real overlay-made whiteout and an opaque directory, the update run inside |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Fixes #3342 (taken from cl-release on the orchestrator's assignment, 23 Nov). #3343 and #3345 are the fix itself. This PR adds the end-to-end test the issue still needed, plus a bug that test found.
tests/update_e2e_loop_test.sh: the real1bit-updateon a loop-mounted installed disk1BIT-OS(EFI/BOOT/grub.cfgwith one slot,/1bit, headless + serial) and an ext41BIT-DATApartition (/.installed,/1bitwith kernel, initrd and the old release's SFS, plus the shared save layerupup64rsave/upper). It is loop-attached with partitions./etc/init.d/05onboard-data;rmof a release tool, which the kernel records as a whiteout;rm -rf+mkdirofopt/1bit-package/1bit/npu, which the kernel markstrusted.overlay.opaque=y(the fixture row asserts all three);/etc/passwdand a user file.SHA256SUMS, insideunshare -mwith a bind-mounted/proc/cmdline(psubdir=1bit) and a tmpfs/var/log, so nothing on the host is touched. Every loop device is detached on exit.Result, as root on ryzen (14/14, no loop device or mount left before or after):
/1bit-altand linked to the shared layer;/1bit-altheadless, with the boot line's parameters kept;1bit-shadowed/<release>-<time>/, and the whiteout and opaque directory are recorded there;05onboard-data, the whiteout-hidden tool is back, and the new NPU set shows through the formerly opaque directory;--shadowedafterwards finds 0;Controls (
ONEBIT_E2E_CONTROL=<older script>, same disk, booted view):1bit-update05onboard-datathe new release runs1bit-heavy(whited out)npu/(opaque)5e58a37)d5f6acc)The bug the test found (
1bit-update, 9 lines)When
/initrd/pup_ro2is not mounted,run_basefalls back to the slot's.sfsfile. The release-owned list was then read from<file>.sfs/etc/1bit/release-owned, a path that cannot exist. So--shadowedand--statusfell through to/etc/1bit/release-owned, where a save-layer copy of the list would itself win, and on a tree without one--shadowedrefused: "the running release has no etc/1bit/release-owned list". The list is now read out of the SFS withunsquashfs -cat, and the temp copy is removed on exit, including in the install path'scleanup. The update path was already right, because it reads the new SFS withunsquashfs.CI
The test needs root, loop devices and
getfattr/setfattr. Without them it prints why and returns 77, and it is listed intools/ci/ctest_skips.txtwith that reason. ctest row:update_e2e_loop,SKIP_RETURN_CODE 77.tests/update_shadow_test.sh: 24/24, unchanged.tests/one_bit_update_slots_test.sh: ok.bash scripts/pre-pr-checks.sh --base origin/main: 18 green, 2 skipped (the gpu-kernels audits).getfattr/setfattrcame fromapt-get download attrunpacked locally. They are not installed on ryzen.Not run on the board. The appliance has
/initrd/pup_ro2and both attribute tools, so the release image's first1bit-updateis the hardware check (test-at-the-end).🤖 Generated with Claude Code