From: Olaf Hering Pass a timestamp to kbuild via an enviroment variable. TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux This can be used when the kernel source is in a SCM and uname -v is supposed to give the commit date and not the package build time. Signed-off-by: Olaf Hering Cc: Sam Ravnborg Signed-off-by: Andrew Morton --- scripts/mkcompile_h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) diff -puN scripts/mkcompile_h~kbuild-override-build-timestamp scripts/mkcompile_h --- a/scripts/mkcompile_h~kbuild-override-build-timestamp +++ a/scripts/mkcompile_h @@ -30,7 +30,12 @@ UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi -UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`" +if [ -n "$BUILD_TIMESTAMP" ]; then + TIMESTAMP="`LC_ALL=C LANG=C date -d "$BUILD_TIMESTAMP"`" +else + TIMESTAMP="`LC_ALL=C LANG=C date`" +fi +UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" # Truncate to maximum length _