[OpenWrt-Devel] [PATCH 07/13] include/kernel: set build timestamp to SOURCE_DATE_EPOCH if available

Alexander Couzens lynxis at fe80.eu
Mon Jan 25 15:49:29 EST 2016


There is no additional information in the build timestamp.
As long we have no information on the kernel timestamp,
use as constant base for this timestamp the OpenWrt repository.

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 include/kernel.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/kernel.mk b/include/kernel.mk
index 432e8ce..2f477cf 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -5,6 +5,8 @@
 # See /LICENSE for more information.
 #
 
+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/getsource_date_epoch.sh)
+
 ifeq ($(__target_inc),)
   include $(INCLUDE_DIR)/target.mk
 endif
@@ -21,6 +23,10 @@ else
 
   LINUX_KMOD_SUFFIX=ko
 
+  ifneq (,$(SOURCE_DATE_EPOCH))
+    export KBUILD_BUILD_TIMESTAMP=$(shell date -d @$(SOURCE_DATE_EPOCH))
+  endif
+
   ifneq (,$(findstring uml,$(BOARD)))
     KERNEL_CC?=$(HOSTCC)
     KERNEL_CROSS?=
-- 
2.7.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list