Skip to content

feat(ddi): build the OS payload as a verity /usr image pinned by verity.usrhash #135

Closed

Description

@castrojo

Design: docs/superpowers/specs/2026-09-13-flatcar-base-migration-design.md (PR #123), phase 4. Blocked by the partition layout ticket.

Stage 1's /init, extracted from the kernel:

veritysetup --panic-on-corruption --hash-offset=1065345024 open "${verityusr}" usr "${verityusr}" "${usrhash}"
status=$(dmsetup status usr | cut -d " " -f 4)
[ "${status}" = V ] || { echo "Verity setup failed" >&2; false; }

Consequences

  1. One partition, not two. The offset is hardcoded, with the upstream comment "Hardcoded expected value from the image GPT layout". Filesystem occupies the first 1,065,345,024 bytes; the verity hash tree follows in the same partition. This is incompatible with systemd-repart's Verity=data/Verity=hash model, so bluefin-server-ddi.bst appends the hash itself and repart keeps using CopyBlocks= - the existing contract, unchanged.
  2. Hard size budget. /usr must fit in 1,065,345,024 bytes. Flatcar uses 454 MiB of it. The element must fail the build when exceeded, never silently overrun the hash offset.
  3. Root hash into the UKI. ukify --cmdline gains verity.usr=PARTLABEL=USR-A verity.usrhash=<roothash>. That binds one UKI to exactly one /usr image, which is the property A/B updates need. Flatcar publishes theirs per release in flatcar_production_image_verity.txt; ours is a build output.
  4. Filesystem stays XFS. mount -t "${usrfstype}" passes the type through; only auto and btrfs get Flatcar's rescue=nologreplay handling.

Acceptance

  • DDI element emits a /usr image with an appended verity hash tree at offset 1,065,345,024 and prints the root hash.
  • Build fails loudly when /usr exceeds the budget.
  • UKI cmdline carries verity.usr= and verity.usrhash=.
  • Boot succeeds and dmsetup status usr reports V.
  • Corrupting a byte in USR-A makes the boot panic rather than proceed.

Activity

  1. HuntedRaven7 commented on Sep 21, 2026

    @HuntedRaven7

    Issue #135 was already implemented and closed once: PR #153 ("feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash") failed the DDI build gate and was closed unmerged by maintainer review.

    What blocks the issue:

    1. Hard verity budget, payload overrun. The budget is not tunable: --hash-offset=1065345024 is hardcoded in upstream flatcar/bootengine minimal-init line 137 ("Hardcoded expected value from the image GPT layout") and include/flatcar.yml pins Flatcar 4593.2.5. The current /usr payload is 1,770,078,417 bytes — a 705 MB overrun — so the "fail loudly when /usr exceeds the budget" acceptance criterion fires on the current OS stack. The three routes to green (cut 705 MB from elements/bluefin-server/os-stack.bst, adopt systemd's native usrhash= / repart Verity=data|hash model instead of Flatcar's minimal-init, or change the offset via a different layout) are architectural decisions that remain unanswered.
    2. Prerequisite feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134 still open. verity.usr=PARTLABEL=USR-A cannot resolve on a real install until the Flatcar EFI-SYSTEM/USR-A/USR-B/ROOT partition layout lands. Issue feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134 is still open and its implementation PR feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #191 (feat/installer: adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout) is still open, predating the fix(boot): resolve QEMU installer boot deadlock and console readiness probe #220 boot-deadlock fix and needing a rebase for a real installer-test result. USR-A exists nowhere in files/ or elements/ on main.

    No merged PR covers this issue; re-landing it now would reproduce PR #153's exact build failure (payload vs. budget guard). It is sequenced ahead of #134 and the unanswered size/architecture decision.

    — hive: backend=pi model=cline-free/deepseek-v4.1-flash

    🐝 Hive Agent: contributor | SHA: 6bcf5f6

  2. repires commented on Sep 22, 2026

    @repires

    Work on issue #135 remains blocked on unanswered architectural decisions and unmerged prerequisite work:

    1. Prerequisite feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134 remains unmerged: Target partition USR-A does not yet exist on main (where files/installer/repart.d/ still provisions 10-esp.conf, 20-root-a.conf, and 30-var.conf). Issue feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134 is open with two competing unmerged PRs (feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #191 and feat(installer): adopt Flatcar EFI-SYSTEM/USR-A/USR-B/OEM/ROOT layout #230). Until a partition layout landing USR-A merges, verity.usr=PARTLABEL=USR-A cannot resolve.
    2. Payload size overrun against hardcoded verity budget: Upstream Flatcar bootengine minimal-init hardcodes --hash-offset=1065345024. As demonstrated when PR feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash #153 was closed unmerged by maintainer review, the current /usr payload (~1.77 GB) overruns this budget by ~705 MB, causing the budget guard in the DDI build to fail. Resolving this requires maintainer architectural direction on which path to take (shrinking /usr in elements/bluefin-server/os-stack.bst, adopting systemd's native repart verity model, or changing the partition offset via layout redesign).

    No merged PR covers this issue yet, and re-implementing it without these architectural prerequisites resolved reproduces the exact build failure of PR #153.

    — hive: backend=agy

    🐝 Hive Agent: contributor | SHA: 3f79592

  3. kylerankin commented on Sep 23, 2026

    @kylerankin
    Contributor

    Re-assessed against current main (tree clean, fetched upstream): this issue is not shippable in isolation.

    The implementation already existed and was rejected: PR #153 ("feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash") was closed unmerged by maintainer review. The blocker was the approach's correctness, not its shape — the budget guard and the 1065345024 constant are right; the guard fires exactly as this issue requires.

    What blocks it (both internal to this repo, no external dependency):

    1. Unanswered maintainer architectural decision. The current /usr payload is 1,770,078,417 bytes against a hardcoded verity budget of 1,065,345,024 bytes (a ~705 MB overrun). That budget matches the --hash-offset hardcoded in upstream flatcar/bootengine minimal-init, so the init we boot dictates it. The maintainer closed feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash #153 stating the three routes to green — (1) shrink /usr by cutting what elements/bluefin-server/os-stack.bst ships, (2) abandon Flatcar minimal-init for systemd's native usrhash=/repart Verity=data|hash, or (3) change the partition offset — are "all architectural, and each is yours to choose, not mine." None has been chosen; unilaterally cutting 705 MB of server packages or switching init systems is exactly the product decision declined.
    2. Unmerged in-repo prerequisite feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134. The Flatcar EFI-SYSTEM/USR-A/USR-B/ROOT layout is still open with two competing unmerged PRs (feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #191, feat(installer): adopt Flatcar EFI-SYSTEM/USR-A/USR-B/OEM/ROOT layout #230). USR-A exists nowhere on main, so verity.usr=PARTLABEL=USR-A cannot resolve.

    No merged PR covers this issue. git grep -i verity shows no existing DDI verity infrastructure to extend. Re-landing #153 now would reproduce PR #153's exact build failure (payload-vs-budget guard). Sequenced ahead of #134 and the size decision.

    — hive: backend=pi model=lemonade/Ornith-1.5-35B-A3B-GGUF-Q6_K

    🐝 Hive Agent: contributor | SHA: 3772407

  4. mendezr commented on Sep 24, 2026

    @mendezr
    Contributor

    Re-assessed against current main (7177d85, fetched 2026-09-24): the blockers recorded when PR #153 was closed have partially moved, but this issue remains sequenced behind #134 and its open design decision.

    What changed since the last assessment:

    What still blocks this issue:

    1. The issue body sequences it behind the partition-layout ticket, and feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #134 is still open with both of its implementation PRs (feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #191, feat(installer): adopt Flatcar EFI-SYSTEM/USR-A/USR-B/OEM/ROOT layout #230) closed unmerged. feat(installer): adopt Flatcar's EFI-SYSTEM/USR-A/USR-B/ROOT partition layout #191's closure reserves the outstanding decision: an agreed way to stage updates into the idle read-only USR-A/USR-B slot and verify boot/rollback before the layout merges. Any new layout attempt must also reconcile with the open installer PRs feat(installer): delete dracut path; the Flatcar kernel already carries its initramfs (#128) #162 (dracut deletion) and feat(kubernetes): replace the k0s sysext with upstream kubeadm/kubelet, and fix the boot deadlocks behind it #210 (kubeadm/kubelet), which reshape the same UKI/installer path that this issue's verity.usr= / verity.usrhash= pinning rides on.
    2. Until a layout landing USR-A merges, verity.usr=PARTLABEL=USR-A cannot resolve and no repart recipe copies a verity /usr image to a target partition (files/installer/repart.d/ still provisions ESP + bluefin-server-root-a + var). Re-landing feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash #153 as-is reproduces its exact closure rationale.

    No merged PR covers this issue. The verity DDI element, budget guard, and UKI pinning work proceeds once the maintainer picks the #134 re-landing shape (A/B USR-slot staging design plus reconciliation with #162/#210) and a real build confirms the payload fits the hardcoded hash offset.

    — hive: backend=pi model=openrouter/z-ai/glm-5.3-flash

    🐝 Hive Agent: contributor | SHA: 5ebfeae

  5. jeefy commented on Sep 29, 2026

    @jeefy
    Collaborator

    Done in #262: /usr is an erofs image with a dm-verity hash partition, pinned by usrhash= in the signed netboot and disk UKIs (elements/oci/bluefin-server-usr.bst, elements/oci/bluefin-server-boot.bst).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions