Skip to content

feat(ddi): build OS payload as verity /usr image pinned by verity.usrhash - #153

Open
mrbobbytables wants to merge 2 commits into
projectbluefin:mainfrom
mrbobbytables:feat/ddi-verity-usr
Open

mrbobbytables wants to merge 2 commits into
projectbluefin:mainfrom
mrbobbytables:feat/ddi-verity-usr

Conversation

@mrbobbytables

Copy link
Copy Markdown
Contributor

Summary

Builds the OS payload as a dm-verity /usr image pinned by verity.usrhash in the target UKI cmdline (#135, Phase 4 of the Flatcar base migration design in PR #123).

Changes

  • elements/oci/bluefin-server-ddi.bst:
    • Adds freedesktop-sdk.bst:components/cryptsetup.bst to build-depends for veritysetup.
    • Enforces the hard 1,065,345,024-byte size budget before creating the filesystem, failing loudly if the payload content exceeds the limit.
    • Pre-allocates the image to the exact budget offset (HASH_OFFSET=1065345024) and creates an XFS filesystem formatted with mkfs.xfs -f -L bluefin-usr.
    • Formats and appends the dm-verity hash tree at offset 1,065,345,024 via veritysetup format (260,094 blocks of 4096 bytes).
    • Prints the root hash to build output and saves verity.usrhash and bluefin-server-ddi-<version>.verity into the install root.
  • elements/oci/bluefin-server-installer.bst:
    • Reads the root hash from /ddi/verity.usrhash staged from the DDI element.
    • Updates the target OS UKI command line in dracut and ukify build to include verity.usr=PARTLABEL=USR-A verity.usrhash=${USR_HASH}.
  • Tests:
    • Updates tests/unit/test_installer_contract.py to assert verity.usr=PARTLABEL=USR-A and verity.usrhash=${USR_HASH} in the target UKI command line.
    • Adds tests/unit/test_ddi_verity.py covering cryptsetup build dependency, budget enforcement, veritysetup formatting arguments, root hash emission, and target UKI cmdline pinning.
  • Documentation:
    • Updates docs/skills/ddi-installer.md to document the appended verity hash tree and verity.usrhash pinning.

Verification

  • pytest tests/unit: 217 passed, 1 xfailed.
  • bats tests/unit: 62 passed.
  • python3 .github/scripts/docs-checks.py: passed.
  • python3 .github/scripts/check-release-version.py: passed.
  • python3 .github/scripts/check-k0s-version.py: passed.

Closes #135

— hive: backend=copilot model=gemini-3.8-flash

🐝 Hive Agent: contributor | SHA: 8d4909c

mrbobbytables and others added 2 commits September 15, 2026 00:53
…hash

Enforce the Flatcar-compatible /usr dm-verity contract in the DDI and
installer UKI (projectbluefin#135, Phase 4 of the Flatcar base
migration design):

- In elements/oci/bluefin-server-ddi.bst:
  - Add freedesktop-sdk.bst:components/cryptsetup.bst build-depends.
  - Enforce the 1,065,345,024-byte hard size budget before filesystem creation,
    failing loudly if payload content exceeds the limit.
  - Pre-allocate the filesystem to the exact budget offset and format with
    mkfs.xfs -f -L bluefin-usr.
  - Format and append the dm-verity hash tree at offset 1,065,345,024
    using veritysetup format (260,094 blocks of 4096 bytes).
  - Print the root hash to build output and save to verity.usrhash.
- In elements/oci/bluefin-server-installer.bst:
  - Read the verity root hash from /ddi/verity.usrhash.
  - Add verity.usr=PARTLABEL=USR-A verity.usrhash=${USR_HASH} to the target
    UKI kernel command line in dracut and ukify.
- In tests/unit/test_ddi_verity.py and test_installer_contract.py:
  - Add comprehensive contract tests validating budget checks, cryptsetup
    dependency, veritysetup formatting arguments, and UKI cmdline pinning.
- Update docs/skills/ddi-installer.md with verity payload details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants