diff options
author | Dmitry Safonov <dima@arista.com> | 2023-12-20 00:33:15 +0000 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-12-29 22:25:21 +0900 |
commit | f3b2306bea33b3a86ad2df4dcfab53b629e1bc84 (patch) | |
tree | 86c6539435bb41d935f3bcb84eadd67ef52e5830 /scripts | |
parent | 7beba04eb305393e3f8386390f25b4a9475f27f2 (diff) |
gen_init_cpio: Apply mtime supplied by user to all file types
Currently gen_init_cpio -d <timestamp> is applied to symlinks,
directories and special files. These files are created by
gen_init_cpio from their description. Without <timestamp> option
current time(NULL) is used. And regular files that go in initramfs
are created before cpio generation, so their mtime(s) are preserved.
This is usually not an issue as reproducible builds should rebuild
everything in the distribution, including binaries, configs and whatever
other regular files may find their way into kernel's initramfs.
On the other hand, gen_initramfs.sh usage claims:
> -d <date> Use date for all file mtime values
Ar Arista initramfs files are managed with version control system
that preserves mtime. Those are configs, boot parameters, init scripts,
version files, platform-specific files, probably some others, too.
While it's certainly possible to work this around by copying the file
into temp directory and adjusting mtime prior to gen_init_cpio call,
I don't see why it needs workarounds.
The intended user of -d <date> option is the one that needs to create
a reproducible build, see commit a8b8017c34fe ("initramfs: Use
KBUILD_BUILD_TIMESTAMP for generated entries"). If a user wants
the build reproduction, they use -d <date>, which can be set on all
types of files, without surprising exceptions and workarounds.
Let's KISS here and just apply the time that user specified
with -d option.
Based-on-a-patch-by: Baptiste Covolato <baptiste@arista.com>
Link: https://lore.kernel.org/lkml/20181025215133.20138-1-baptiste@arista.com/
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions