diff options
author | Michal Marek <mmarek@suse.cz> | 2011-03-31 17:16:42 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-04-18 08:27:52 -0400 |
commit | a8b8017c34fefcb763d8b06c294b58d1c480b2e4 (patch) | |
tree | 61f638af2d7e5ad95990055414788f6f9c0a82dc /scripts | |
parent | 53e6892c0411006848882eacfcfea9e93681b55d (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')
-rw-r--r-- | scripts/gen_initramfs_list.sh | 9 |
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 | |||
287 | # we are carefull to delete tmp files | 287 | # we are carefull to delete tmp files |
288 | if [ ! -z ${output_file} ]; then | 288 | if [ ! -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 |