Repository navigation
etc-merge: Fix fs-verity only diff on files - #2650
Merged
Merged
Conversation
We were never checking the fs-verity difference between files in the current and pristine etc, and any modified files were always skipped from the diff and merge. We never hit this issue because our /etc mount does not have fs-verity enabled on any files which would end up the code taking the content hash path every time Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
There was a problem hiding this comment.
🟡 Changes recommended
The digest comparison can misclassify unchanged files and overwrite updated image defaults, while an incorrect bootc path prevents the regression test from reaching its assertions.
2 open issues
What changed in this PR
Updates bootc’s /etc merge logic to detect content changes in fs-verity-enabled files, helping preserve local configuration during composefs upgrades.
Changes:
- Compares verity digests and falls back to content hashes when only one file has verity enabled.
- Adds JSON output to the internal directory-diff command and regression cases for verity-enabled files.
- Installs fs-verity tooling in test images.
| File | Description |
|---|---|
tmt/tests/booted/test-etc-merge-conflict.nu |
Adds verity-enabled and mixed-verity diff regression cases. |
Dockerfile |
Installs fsverity-utils and enables EPEL where needed. |
crates/lib/src/cli.rs |
Adds dir-diff --json and passes directory handles for hashing. |
crates/lib/src/bootc_composefs/finalize.rs |
Supplies directory handles during upgrade and finalization diffing. |
crates/etc-merge/src/lib.rs |
Adds verity-aware comparison, content-hash fallback, and serializable diff types. |
crates/etc-merge/Cargo.toml |
Adds the Serde dependency. |
Cargo.lock |
Records Serde as an etc-merge dependency. |
Review effort: Balanced
Also add test for fs-verity enabled diff Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Johan-Liebert1
force-pushed
the
etc-merge-stuff
branch
from
November 12, 2026 06:58
a92edf5 to
64aebdf
Compare
cgwalters
approved these changes
Nov 13, 2026
| let mut pristine_hash = old_meta.content_hash.clone(); | ||
| let mut current_hash = current_meta.content_hash.clone(); | ||
|
|
||
| let compute_hash = |mut file: cap_std::fs::File| -> anyhow::Result<String> { |
Member
There was a problem hiding this comment.
The nesting here is getting really deep, surely we could factor some of this out into a helper function
|
|
||
| pristine_hash != current_hash | ||
| } | ||
| (Some(old_verity), Some(current_verity)) => { |
Member
There was a problem hiding this comment.
If we moved this case up, then the match statement for the case above could just be a fallthrough of _
Member
Author
|
Will address the comments in a followup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

etc-merge: Fix fs-verity only diff on files
We were never checking the fs-verity difference between files in the
current and pristine etc, and any modified files were always skipped
from the diff and merge.
We never hit this issue because our /etc mount does not have fs-verity
enabled on any files which would end up the code taking the content hash
path every time
cli: Add
--jsonflag toDirDiffcommandAlso add test for fs-verity enabled diff