HomeFreeBSD

mkimg: Make output reproducible using a specific timestamp

Description

mkimg: Make output reproducible using a specific timestamp

In commit 95ac5b0e27e9 ("mkimg: Add a reproducible mode"), I added a -R
flag to mkimg, indicating that output should be reproducible.

There is one place in the VHD image backend that uses time(3) to
populate an image metadata field; this field is visible to tools which
know how to process VHD images. Rather than picking an arbitrary value
for that timestamp, it seems better to behave like makefs(8) and let the
invoker pick a suitable timestamp.

So, remove -R and instead add a -t option which lets the timestamp be
specified directly. Then, modify the VHD backend to use that timestamp.

Fixes: 95ac5b0e27e9 ("mkimg: Add a reproducible mode")
Reviewed by: bnovkov
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51077

Details

Provenance
markjAuthored on Jul 7 2025, 8:27 PM
Reviewer
bnovkov
Differential Revision
D51077: mkimg: Make output reproducible using a specific timestamp
Parents
rGed4c64bc792f: tests/ci: Use suitable variable for qemu-user-static existence check
Branches
Unknown
Tags
Unknown