summaryrefslogtreecommitdiff
path: root/scripts/gen_initramfs_list.sh
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-03-31 23:16:42 +0200
committerMichal Marek <mmarek@suse.cz>2011-04-18 14:27:52 +0200
commita8b8017c34fefcb763d8b06c294b58d1c480b2e4 (patch)
tree61f638af2d7e5ad95990055414788f6f9c0a82dc /scripts/gen_initramfs_list.sh
parent53e6892c0411006848882eacfcfea9e93681b55d (diff)
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>
Diffstat (limited to 'scripts/gen_initramfs_list.sh')
-rw-r--r--scripts/gen_initramfs_list.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 4a43fe12d179..d44cf675bc22 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -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