aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gen_initramfs_list.sh
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-03-31 17:16:42 -0400
committerMichal Marek <mmarek@suse.cz>2011-04-18 08:27:52 -0400
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 4a43fe12d17..d44cf675bc2 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -287,8 +287,15 @@ done
287# we are carefull to delete tmp files 287# we are carefull to delete tmp files
288if [ ! -z ${output_file} ]; then 288if [ ! -z ${output_file} ]; then
289 if [ -z ${cpio_file} ]; then 289 if [ -z ${cpio_file} ]; then
290 timestamp=
291 if test -n "$KBUILD_BUILD_TIMESTAMP"; then
292 timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"
293 if test -n "$timestamp"; then
294 timestamp="-t $timestamp"
295 fi
296 fi
290 cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" 297 cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)"
291 usr/gen_init_cpio ${cpio_list} > ${cpio_tfile} 298 usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile}
292 else 299 else
293 cpio_tfile=${cpio_file} 300 cpio_tfile=${cpio_file}
294 fi 301 fi