make cpio reproducible - #199
Open
bsandu-peridio wants to merge 1 commit into
Open
Conversation
bsandu-peridio
requested review from
mobileoverlord
and
a lite review from Copilot
August 12, 2026 20:49
There was a problem hiding this comment.
Pull request overview
This PR aims to make initramfs cpio outputs reproducible by normalizing filesystem mtimes in the staged initramfs tree before the archive is created.
Changes:
- Add a build-script step that normalizes mtimes under
$INITRAMFS_WORKtoSOURCE_DATE_EPOCH(defaulting to 0). - Add unit tests that assert the mtime-normalization step is emitted and ordered correctly relative to release-file injection and
cpiocreation.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+118
to
+120
| echo "Normalizing initramfs mtimes to SOURCE_DATE_EPOCH=${{SOURCE_DATE_EPOCH:-0}}" | ||
| find "$INITRAMFS_WORK" -print0 \ | ||
| | xargs -0r touch -h -d "@${{SOURCE_DATE_EPOCH:-0}}" |
bsandu-peridio
force-pushed
the
beni/dev
branch
from
August 12, 2026 21:03
6fb3bc3 to
75ca11f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/commands/initramfs/image.rs:129
- You pin
LC_ALL=Cfor the cpio entry sort to avoid locale-driven archive drift, but the initramfs build ID is also derived from a locale-sensitive sort of RPM NEVRAs earlier in this generated script (rpm -qa ... | sort). If the SDK/container ever gains additional locales or forwardsLC_*from the host, the same package set could produce a differentINITRAMFS_BUILD_ID. Consider pinning that earlier sort toLC_ALL=Cas well.
# Reproducibility notes for the pipeline below:
# * `LC_ALL=C sort` — entry order is archive order (and, with
# --renumber-inodes, decides the inode numbers), so collation must not
# drift. Today's SDK ships only the C/POSIX locales, which makes this a
# no-op, but it stops the archive from changing if the image ever gains
# real locales or the CLI starts forwarding the host's LC_* vars.
Signed-off-by: Beniamin Sandu <b.sandu@peridio.com>
bsandu-peridio
force-pushed
the
beni/dev
branch
from
August 12, 2026 21:30
75ca11f to
9cd0f95
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/commands/initramfs/image.rs:126
xargspasses arbitrary filenames from the staged tree intotouch. If any path begins with-,touchcan interpret it as an option. Add--after thetouchoptions so all subsequent arguments are treated as paths.
| xargs -0r touch -h -d "@${{SOURCE_DATE_EPOCH:-0}}"
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.
No description provided.