grow-var: resolve the whole disk with lsblk -d; refuse anything else - #3
Conversation
`lsblk -no PKNAME <partition>` also lists the partition's holders, and for a dm slave the dm child's row comes first - its PKNAME is the partition itself. On an encrypted /var this resolved "disk" to /dev/nvme0n1p16 and `sgdisk -e` then wrote a fresh GPT over the LUKS2 header (primary at 0, secondary at 16 KiB both destroyed; the mapping survived only because the key was already in the kernel). Observed on a Jetson Orin Nano on the first encrypted-/var boot; the plaintext path never hit it because there the var device is the partition and lsblk's first row is its own. Use -d (no dependents) and, before sgdisk touches anything, require the resolved device to be of TYPE disk. Claude-Session: https://claude.ai/code/session_01AqE5abpz1hSdeM9ZCRLLrf
The LUKS branch used blockdev --getsz, which util-linux-blockdev provides and the image does not ship: on a Jetson AGX Thor with encrypted /var the partition was extended and then the unit died with 'line 128: blockdev: command not found' (status 127) before the dm/partition size comparison. /sys/class/block/<dev>/size is the same 512-byte sector count for both the partition and the dm-N node behind /dev/mapper/var.
|
Pushed one commit: The two fixes here are correct, but without a version move they would not have reached a device. The extension declares That is not hypothetical. Why this PR matters more than it looksConfirmed on hardware today (
One design question for the reviewerThe distro now grows This extension ships its own vendored copy at Worth deciding whether the extension should carry this at all, or drop the overlay and defer to the distro. That vendored snapshot is precisely how a copy survived the upstream rewrite and kept failing after the component it duplicates had been redesigned. Out of scope for this PR — merging it stops the boot-time failure either way. |
4a069fb to
1366c1e
Compare
|
Corrected the version bump: 0.1.0-r0 → 0.2.0-r0, not a release bump. A release bump would have been wrong here. The payload changed, not just its packaging — Amended in place (force-with-lease); the two fix commits are untouched. Release path is already correct on this repo: |
The two commits above fix the runtime failure, but the extension still declared 0.1.0-r0 - the exact NEVR already published. Rebuilding at that version republishes the same package and a resolving device keeps whichever copy it already has: the broken one. 0.2.0 rather than a release bump: the payload changed, not just its packaging. grow-var no longer calls blockdev(8) and resolves the whole disk differently, so this is a new version of the thing being shipped. r0 restarts for it, as it does for any new upstream version. This is the same trap that just cost a day on avocado-img-bootfiles, where a correctly-built package sat in 2026/next unreachable because its version did not sort above the stale one. A content fix that does not move the version is not a release. Claude-Session: https://claude.ai/code/session_0126qmPTM1gce9r9CEh2vxbo
1366c1e to
ab9bce3
Compare
release.yml publishes to 2026/next and 2024/next; test.yml only built against 2024/next. A change that breaks against 2026 - the feed a 2026 project actually resolves - goes green on the PR and ships anyway. Mirror the release matrix so a PR builds against exactly the feeds its tag publishes into. Claude-Session: https://claude.ai/code/session_0126qmPTM1gce9r9CEh2vxbo
lsblk -no PKNAME <partition>also lists the partition's holders, and for a dm slave the dm child's row comes first — its PKNAME is the partition itself. On an encrypted/varthis resolved "disk" to/dev/nvme0n1p16andsgdisk -ewrote a fresh GPT over the LUKS2 header (primary and secondary both destroyed; the mapping survived only because the key was already in the kernel). Observed on a Jetson Orin Nano on its first encrypted-/varboot (meta-avocado #310). Plaintext boards never hit it because there the var device is the partition and lsblk's first row is its own — but every encrypted-var target (imx93, qemu) is exposed.Fix:
lsblk -dno PKNAME, and refuse to runsgdiskunless the resolved device isTYPE=disk.Verified on the board: fixed resolution gives
/dev/nvme0n1 type=disk ptable=gpt; the old form givesnvme0n1p16 type=part.