You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mkcomposefs: building from a directory silently loses hardlinks #444
(The flags only remove unrelated differences: cfsctl otherwise defaults to SHA-512 and propagates "/usr" metadata to the root inode.)
Control: replace the ln with cp and both tools emit the identical digest, the writers agree byte-for-byte at baseline, so the hardlink is the only issue here. This breaks any digest-based cross-check between images built from a directory and by hardlink-aware tools like composefs-rs, or mkcomposefs --from-file).
Yes, this is a bug conceptually, but I don't think we can change the default because someone might be relying on it. In the composefs-rs reimplementation of this, it's opt-in via --hardlinks and I think we need to do the same thing here.
I've checked fsverity digest of the cfs image generated with mkcomposefs --hardlinks (the fix in #446) and it matches the one produced by cfsctl --no-repo --hash sha256 --erofs-version 1 compute-id --no-propagate-usr-to-root.
But how are you dealing with the problem of missing / metadata?
The / metadata isn't missing in this case, mkcomposefs <dir> <out> applies the dir's own metadata to /, and cfsctl compute-id --no-propagate-usr-to-root does the same.
For classical OCI container images with tar layers, I generate a composefs-dump file following the canonical construction (/usr metadata applied to /) and call mkcomposefs --from-file, the resulting fsverity digest is identical to what cfsctl oci compute-id produces.
Activity
cgwalters commentedon Jul 28, 2026
Yes, this is a bug conceptually, but I don't think we can change the default because someone might be relying on it. In the composefs-rs reimplementation of this, it's opt-in via
--hardlinksand I think we need to do the same thing here.mike-sul commentedon Jul 29, 2026
Yes, it makes sense: keeping the default and fixing via the
--hardlinks.I'll check that the image built with
--hardlinksnow matches the cfsctl compute-id digest and report back.mike-sul commentedon Jul 30, 2026
I've checked fsverity digest of the cfs image generated with
mkcomposefs --hardlinks(the fix in #446) and it matches the one produced bycfsctl --no-repo --hash sha256 --erofs-version 1 compute-id --no-propagate-usr-to-root.lib: Add LCFS_BUILD_TRACK_HARDLINKS for directory scans
mkcomposefs: Add --hardlinks flag, matching composefs-rs
lib: Add LCFS_BUILD_TRACK_HARDLINKS for directory scans
mkcomposefs: Add --hardlinks flag, matching composefs-rs
cgwalters commentedon Aug 3, 2026
But how are you dealing with the problem of missing
/metadata?mike-sul commentedon Aug 4, 2026
The
/metadata isn't missing in this case,mkcomposefs <dir> <out>applies the dir's own metadata to/, andcfsctl compute-id --no-propagate-usr-to-rootdoes the same.For classical OCI container images with tar layers, I generate a composefs-dump file following the canonical construction (
/usrmetadata applied to/) and callmkcomposefs --from-file, the resulting fsverity digest is identical to whatcfsctl oci compute-idproduces.