]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - scripts/gen_initramfs_list.sh
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
[linux-3.10.git] / scripts / gen_initramfs_list.sh
index 55caecdad995b18940ce746650e45502f2fd11f0..d44cf675bc22a6ac942500ad471cc27a5ebf9828 100644 (file)
@@ -226,7 +226,7 @@ cpio_list=
 output="/dev/stdout"
 output_file=""
 is_cpio_compressed=
-compr="gzip -9 -f"
+compr="gzip -n -9 -f"
 
 arg="$1"
 case "$arg" in
@@ -240,7 +240,7 @@ case "$arg" in
                output_file="$1"
                cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
                output=${cpio_list}
-               echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f"
+               echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f"
                echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f"
                echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f"
                echo "$output_file" | grep -q "\.xz$" && \
@@ -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