public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: "jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: RE: [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for custom kernels
Date: Mon, 21 Mar 2022 17:33:19 +0000	[thread overview]
Message-ID: <AM9PR10MB486914A9CC81181F63A4A6FF89169@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <33854e3c-f3a6-b667-5e67-18c22b646619@siemens.com>

Hi Jan,

> -----Original Message-----
> From: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>
> Sent: Monday, March 21, 2022 6:18 PM
> To: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>; isar-
> users@googlegroups.com
> Subject: Re: [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for
> custom kernels
> 
> On 21.03.22 15:40, Felix Moessbauer wrote:
> > 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.
> >
> 
> Agreed.
> 
> > Setting this to a fixed string further helps to profit from ccache
> > caching on repeated builds.
> 
> Hmm, but the practical impact of this variable should have been limited /wrt
> ccache. I was seeing significant build-time reduction before the commit already.

Yes, but of course depends on configuration.

> 
> >
> > 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)"
> 
> Can't we use SOURCE_DATE_EPOCH like the rest?

This variable is still not honored by the kernel (AFAIK).
Also the kernel documentation only mentions KBUILD_BUILD_TIMESTAMP.
There is a patch from 2015 which has not been applied [1].

We could do the mapping in ISAR, but I prefer to have it explicit.

[1] https://patchwork.kernel.org/project/linux-kbuild/patch/1443741332.2730.75.camel@decadent.org.uk/

Felix

> 
> > +
> >  # 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
> 
> Jan
> 
> --
> Siemens AG, Technology
> Competence Center Embedded Linux

  reply	other threads:[~2022-03-21 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 14:40 Felix Moessbauer
2022-03-21 17:18 ` Jan Kiszka
2022-03-21 17:33   ` Moessbauer, Felix [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR10MB486914A9CC81181F63A4A6FF89169@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM \
    --to=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox