public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for custom kernels
@ 2022-03-21 14:40 Felix Moessbauer
  2022-03-21 17:18 ` Jan Kiszka
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Moessbauer @ 2022-03-21 14:40 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Felix Moessbauer

This patch adds the infrastructure to overwrite the
KBUILD_BUILD_TIMESTAMP environment variable for custom kernel
builds. By that, we improve the support for reproducible
kernel builds.

Setting this to a fixed string further helps to profit from
ccache caching on repeated builds.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/recipes-kernel/linux/files/debian/isar/build.tmpl  | 1 +
 meta/recipes-kernel/linux/files/debian/isar/common.tmpl | 2 ++
 meta/recipes-kernel/linux/linux-custom.inc              | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
index b7749cec..32d2eb23 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
@@ -34,6 +34,7 @@ print_settings() {
 # ---------------
 # ARCH=${ARCH}
 # CROSS_COMPILE=${CROSS_COMPILE}
+# KBUILD_BUILD_TIMESTAMP=${KBUILD_BUILD_TIMESTAMP}
 EOF
 }
 
diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
index b7752fb6..ffe84745 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
@@ -7,6 +7,7 @@ ARCH=${KERNEL_ARCH}
 KERNEL_PKG_IMAGE=linux-image-${KERNEL_NAME_PROVIDED}
 KERNEL_PKG_KERN_HEADERS=linux-headers-${KERNEL_NAME_PROVIDED}
 KERNEL_PKG_LIBC_HEADERS=linux-libc-dev
+KBUILD_BUILD_TIMESTAMP="${KBUILD_BUILD_TIMESTAMP}"
 
 # Constants
 KCONF=.config
@@ -36,6 +37,7 @@ main() {
 
     # variables to be exported
     export ARCH
+    export KBUILD_BUILD_TIMESTAMP
 
     # are we cross-compiling?
     BUILD_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 8a5dbf82..f8e87453 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -33,6 +33,8 @@ KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, \
 
 KERNEL_LIBC_DEV_DEPLOY ?= "0"
 
+KBUILD_BUILD_TIMESTAMP ??= "LANG=C $(date)"
+
 # Settings that may be changed on a per distro, machine or layer basis
 # --------------------------------------------------------------------
 
@@ -73,6 +75,7 @@ TEMPLATE_VARS += "                \
     LINUX_VERSION_EXTENSION       \
     KERNEL_NAME_PROVIDED          \
     KERNEL_CONFIG_FRAGMENTS       \
+    KBUILD_BUILD_TIMESTAMP        \
 "
 
 inherit dpkg
-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-22 18:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 14:40 [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for custom kernels Felix Moessbauer
2022-03-21 17:18 ` Jan Kiszka
2022-03-21 17:33   ` Moessbauer, Felix
2022-03-21 17:51     ` Jan Kiszka
2022-03-22  8:54       ` Moessbauer, Felix
2022-03-22 14:49         ` Jan Kiszka
2022-03-22 17:27           ` Moessbauer, Felix
2022-03-22 18:52             ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox