Skip to content

fix(deploy): refuse extension verity only, not the rootfs root hash - #225

Open
mobileoverlord wants to merge 1 commit into
mainfrom
jschneck/deploy-verity-guard
Open

fix(deploy): refuse extension verity only, not the rootfs root hash#225
mobileoverlord wants to merge 1 commit into
mainfrom
jschneck/deploy-verity-guard

Conversation

@mobileoverlord

Copy link
Copy Markdown
Contributor

avocado deploy refused every runtime with rootfs.image.verity: true:

ERROR: this runtime has extensions with image.verity: true; deploy does not publish their dm-verity hash trees yet ...

The guard grepped the whole manifest for "root_hash", but the rootfs verity hash is recorded at the manifest's top level (and travels in the boot FIT — no sidecar involved). Check extensions[].root_hash only, as connect upload already does. Test added.

https://claude.ai/code/session_01S75qGgqVA2cQUsZdW46qUz

The guard grepped the whole manifest for "root_hash" and so refused every
runtime with rootfs.image.verity on: that hash is recorded at the manifest's
top level and travels in the boot FIT, needing no sidecar. Check
extensions[].root_hash, the case the guard exists for, the same way
`connect upload` already does.
Copilot AI lite review requested due to automatic review settings August 28, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes avocado deploy incorrectly refusing runtimes whenever rootfs.image.verity: true by narrowing the guard to only reject manifests that contain extensions[].root_hash (extension dm-verity trees aren’t published on this path, while the rootfs verity hash is carried in the boot FIT).

Changes:

  • Replace a whole-file "root_hash" grep with JSON-aware detection of extensions[].root_hash in the deploy hash-collection script.
  • Add a unit test asserting the generated script checks extensions rather than grepping the entire manifest.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +706 to 713
if python3 -c '
import json, sys
m = json.load(open(sys.argv[1]))
sys.exit(0 if any(e.get("root_hash") for e in m.get("extensions", [])) else 1)
' "$MANIFEST_FILE"; then
echo "ERROR: this runtime has extensions with image.verity: true; deploy does not publish their dm-verity hash trees yet, so the device would refuse them. Provision instead, or build without verity." >&2
exit 1
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c96c268: key presence ("root_hash" in e), matching connect upload; a manifest that cannot be read or has no extensions list exits 2 and the shell fails the deploy with its own message, so a parse error can never read as "no verity".

@mobileoverlord

Copy link
Copy Markdown
Contributor Author

Note: the fixes referenced in the thread replies are written and tested locally but not pushed yet - the commit-signing agent stopped answering mid-batch. The replies will be followed up with the real commit SHA once it lands; until then the branch head is unchanged.

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.

2 participants