mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
gen_init_cpio gets the current time and uses it for each symlink, special file, and directory. Grab the current time once and make it possible to override it with the KBUILD_BUILD_TIMESTAMP variable for reproducible builds. Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
parent
53e6892c04
commit
a8b8017c34
3 changed files with 50 additions and 15 deletions
|
@ -287,8 +287,15 @@ done
|
|||
# we are carefull to delete tmp files
|
||||
if [ ! -z ${output_file} ]; then
|
||||
if [ -z ${cpio_file} ]; then
|
||||
timestamp=
|
||||
if test -n "$KBUILD_BUILD_TIMESTAMP"; then
|
||||
timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"
|
||||
if test -n "$timestamp"; then
|
||||
timestamp="-t $timestamp"
|
||||
fi
|
||||
fi
|
||||
cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)"
|
||||
usr/gen_init_cpio ${cpio_list} > ${cpio_tfile}
|
||||
usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile}
|
||||
else
|
||||
cpio_tfile=${cpio_file}
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue