From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7077563473267261440 X-Received: by 2002:a5d:6d4e:0:b0:1e3:3636:b104 with SMTP id k14-20020a5d6d4e000000b001e33636b104mr24288754wri.605.1647975178333; Tue, 22 Mar 2022 11:52:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:6d8d:0:b0:203:dadb:4a0c with SMTP id l13-20020a5d6d8d000000b00203dadb4a0cls38461wrs.1.gmail; Tue, 22 Mar 2022 11:52:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZHnQNTQ3D1fY5MYe6bwNyAKW5DLvI5Ui+fWG2mN+QsCgBUI9v6aQtoLyl1+0K07+S8Uy8 X-Received: by 2002:a05:6000:2cd:b0:204:1bf4:e4f8 with SMTP id o13-20020a05600002cd00b002041bf4e4f8mr7035703wry.682.1647975177202; Tue, 22 Mar 2022 11:52:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647975177; cv=pass; d=google.com; s=arc-20160816; b=cMHoOz1bds1NcPce7MWxX8STothCaod3DTo9JNm+URBip4uMS/Ykh6R0jT2tqfvbci ct2iSwxbJ86CT0rsHCNZjBGP2py8pWv1cOU1SOvjmqHUh84WZ0CnfzbDoeSXtJvfQche u4WlEZU6w1i4eNhsjt/Rn8DCo6p5toJWuCNS+2fjqHS4IBHZHwNivcWtD/2hsXAc4TY1 ZuoSpwLvgqz0SUsU7vIZQqv+e0//AUTlsgo497CyCCC9DYv6sjKvuLT3MUi7po7Ci6sP bX9xW4Z45L5BgCWpvMx1idZXU7QdYAu/IO/PfZWoPDL183qAdliIxbdxoAdWyWtnQIPr tI2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=DdhE/Aktp4L8KuCkFW2dgFzmDI++IT1ur3BD74EgCbY=; b=qjmm3er8uw5nhqsviW/U5D7gU4LmQvtzIOx4ufIFCGfQSSoCS2S8LfM+G7yBbqIHL4 CkmbzAzfAs03xlQip+LGuUs7N7fmMaWYZ//0+kpY2yoBgCKbo5d0v+51LP21bxcUyFxI ywyrBCgi6tsSmqb+MsdZYY80ugH9TVJOdZDUBsrKGnRW+HKBS8AFrIS7sn3ujDBGEpmW uZxU+iRKgZhU+isTIs3Mz62XxVPQQQyu4wxUVIg2pNVul3ZDsxZnB7y80zhaQzLJO5Vx cjzeG9A/JfHgse6su4kTPSFMsBm0Dzt2yZDfemkR2pYzN3RIbX6+eFdv1PZWYPvJ9rsi Tqvg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=U2qkIVi5; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:fe06::61b as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02on061b.outbound.protection.outlook.com. [2a01:111:f400:fe06::61b]) by gmr-mx.google.com with ESMTPS id r2-20020a05600c35c200b0038c99860114si243821wmq.0.2022.03.22.11.52.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2022 11:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:fe06::61b as permitted sender) client-ip=2a01:111:f400:fe06::61b; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=U2qkIVi5; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:fe06::61b as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKxtsP5M1qPAs58ICz1P3mIIN3GD1JuYoq/lq7iqEHT+SFIUHVf3zJXIvv3oELesDlqLQIdHaVshWl2USPvg6uIfXFDYIfWbO002wGDytHrrZuxh2QU/qyTHfOBzYjDMca72+uQrYvUHh+FX0zIAltFgLwuJT5M/q9icHSb1g8P7zasswxvO9XPsh/S8WBklCvPiiM7+84bT8EX+fiOEQB4i2WUOHgB4sXUwGz/I8k9hhxfGZSLF5/iWcKDEOM1TMrFTaKPWsGdpvZsUKGwqhO+lZDiUBvkoTgZAFyKGvpohMbHarGwFP9S/Q1xgI5cHnqTyFKjbcSvpHrbAkke4Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DdhE/Aktp4L8KuCkFW2dgFzmDI++IT1ur3BD74EgCbY=; b=gY34pHTR/9ln0h3Yb4R7KZDkKaueYIzQXaw+7GyLTptXanL9O7p+k3lD7zlH9RLGURuzM3W2rOAgZl4mPS8e/pRF87xzXyn18jrLxzIDcXOwc1B2aWyoGgJRJaKPp539qzmmseOXZbY5yykXQQo6BZDsxp6Fdu1Yef+ucSqRdUTFeX4BM7CCXcaAkU53svblQOTcnHRJy5J3RGh1zLz4xbN1eJL62FqRorvYqPwayI6VpfYACADo7GPFTCgUmLcqpDFH1eCTZTLNfi/iyO7wEq8WTniLQIFrzefUQvvwHr7C5HsYMCJwH5fCShu+pBnuWzQ2gpzHOs9sFFiQAMXlcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) smtp.rcpttodomain=googlegroups.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DdhE/Aktp4L8KuCkFW2dgFzmDI++IT1ur3BD74EgCbY=; b=U2qkIVi5e3O3R36Qy/2SJuPl1QNYEATicv746rWNYDz5522KkiUJgW43Ot4dcK9q7j4xGHfJG8iiddF8DVjxbQ+jRdVs0YzP6fi/W/YtzO8USgudajioa4GxC7pg0FtrzWYpWSkUQ9/HEKyHFbXF/dlEX9DVWB62oYvdHBUfkMENqKdYtf/TnCiF2U13WUAhs8AiD7hvfRhflw3CW9B6xy36nzd66xDt4gYtuC2H6j0Kmcf44GjevYM7tbDmYib0FuVpJcbh8aJZfTwC0fLkGoQJzzXy8R299yrhcY1R5/EuNIPlQ8GlURAb5QIzBva8Dm1PccIjQGGcAQ7Bkk3XNQ== Received: from AM6P195CA0067.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::44) by HE1PR1001MB1403.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:3:f1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.19; Tue, 22 Mar 2022 18:52:55 +0000 Received: from VE1EUR01FT088.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:87:cafe::9c) by AM6P195CA0067.outlook.office365.com (2603:10a6:209:87::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.21 via Frontend Transport; Tue, 22 Mar 2022 18:52:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.73) by VE1EUR01FT088.mail.protection.outlook.com (10.152.2.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5081.10 via Frontend Transport; Tue, 22 Mar 2022 18:52:54 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 22 Mar 2022 19:52:54 +0100 Received: from [139.22.133.251] (139.22.133.251) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 22 Mar 2022 19:52:53 +0100 Message-ID: <2d581ef7-5eb8-12e9-a27f-8ec166780de6@siemens.com> Date: Tue, 22 Mar 2022 19:52:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for custom kernels Content-Language: en-US To: "Moessbauer, Felix" CC: "isar-users@googlegroups.com" References: <20220321144017.3684886-1-felix.moessbauer@siemens.com> <33854e3c-f3a6-b667-5e67-18c22b646619@siemens.com> From: Jan Kiszka In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-Path: jan.kiszka@siemens.com X-Originating-IP: [139.22.133.251] X-ClientProxiedBy: DEMCHDC8A1A.ad011.siemens.net (139.25.226.107) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc20497a-23be-4229-4e48-08da0c352cc6 X-MS-TrafficTypeDiagnostic: HE1PR1001MB1403:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 37/LcYakka5w5+7dgFFsGE0CKs4V5eDBaXsCmRoIlnpz/BFPZbDa+qY1SjrGMQSqcyEs4vBy+5e2nlvH0H4s+3y4EflvBBF0LG3fqv287xFwFd42ZL4J/FxWWJMffCkmiDnfUPB19nX7QErGRXNOlPog2Cu9m0Ode9JajMyGhl3FAczyfCr6JSeiDPTH7YJvWm4u5dghFGA0M80iFdK8ogfs8MFdCN8KkrC6ZDL18U348my7o2L8DJPNRLJ3pEmnT/Gr9g6abvTsE16prEluw/ZQGVO00HniOiRPrwjJthHHIrbYljCr0fejsp27XJ+Rju0IdR1i8kdb9DPL1YBaLHJoRbPe/TwiEF3MNp2T8eJPuOvh7ZoMqNvrEmgLVgBr2WEcQEcWktQ5Ct1CVmqtySiiL6YuveCEjCyMBJ0vgclv3qixf0yMtNgNvsRzndrJGgIaNhK8vk8/TIrjtYUpwaWUkjP2ZNqPclkAztau1VDLMS+z5wi3eaDpBgZtl9Gs5xpEpZsLCYcCrYTJoUzgBUnf6EX5klwONCO1h+srlEnNNTIiNRr6A0n7dwTUHZ3ok4Qvwwy9hsYchkGw7DyPTlJMVQgGveH7V4oZp3aWv0rXadRid6n1j7KO5p8DZv3ieurO7p4xDfAQWpCslMxcDDOpZx8KrHo5/OcKx49gZ3FClka6/LzP3Sjc9DeSPTaZTb30q2eLi3ujj/WYpD06l9d+rF2x/xjcr7i9jxGO1N95tsLwhHpBjTDHcNfgY1JbzEcbWkZU4FOUzQUnQqPx+g== X-Forefront-Antispam-Report: CIP:194.138.21.73;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(47076005)(186003)(336012)(26005)(2616005)(956004)(31686004)(53546011)(36860700001)(83380400001)(2906002)(82960400001)(70586007)(70206006)(6862004)(4326008)(8676002)(40460700003)(44832011)(81166007)(36756003)(508600001)(82310400004)(6706004)(6636002)(8936002)(16576012)(316002)(16526019)(31696002)(86362001)(37006003)(356005)(5660300002)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2022 18:52:54.9815 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc20497a-23be-4229-4e48-08da0c352cc6 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;Ip=[194.138.21.73];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT088.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR1001MB1403 X-TUID: AfKmTMf4zKGT On 22.03.22 18:27, Moessbauer, Felix wrote: >> -----Original Message----- >> From: Kiszka, Jan (T CED) >> Sent: Tuesday, March 22, 2022 3:49 PM >> To: Moessbauer, Felix (T CED SES-DE) >> Cc: isar-users@googlegroups.com >> Subject: Re: [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP for >> custom kernels >> >> On 22.03.22 09:54, Moessbauer, Felix (T CED SES-DE) wrote: >>>> -----Original Message----- >>>> From: Kiszka, Jan (T CED) >>>> Sent: Monday, March 21, 2022 6:52 PM >>>> To: Moessbauer, Felix (T CED SES-DE) ; >>>> isar- users@googlegroups.com >>>> Subject: Re: [PATCH 1/1] add support to set KBUILD_BUILD_TIMESTAMP >>>> for custom kernels >>>> >>>> On 21.03.22 18:33, Moessbauer, Felix (T CED SES-DE) wrote: >>>>> Hi Jan, >>>>> >>>>>> -----Original Message----- >>>>>> From: Kiszka, Jan (T CED) >>>>>> Sent: Monday, March 21, 2022 6:18 PM >>>>>> To: Moessbauer, Felix (T CED SES-DE) >>>>>> ; >>>>>> 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 >>>>>>> --- >>>>>>> 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. >>>>> >>>>> >>>> >>>> Then how does the regular Debian kernel set a stable date? We should >>>> align to that and surely not force the user to set anything manually >>>> (that is my interpretation of the behavior of the current patch). >>> >>> They set it in the rules file to "$(SOURCE_DATE)" [1], which itself is computed >> from the changelog: >>> SOURCE_DATE := $(shell dpkg-parsechangelog -SDate) >>> >>> Unfortunately, this is not possible for us because we generate the changelog >> on the fly. >>> Setting "KBUILD_BUILD_TIMESTAMP" to the current build time (as >>> default) should be reasonable, Simply because we do not have better >> information. That's also how it was previously. >>> The only addition here is do give the user support to set it to something >> different. >>> >> >> There must be more information in the build env because other packages that >> do evaluate SOURCE_DATE_EPOCH find that properly set, automatically. > > Well... the SOURCE_DATE_EPOCH variable is set by debhelper to the date of the last entry in the changelog [1], [2]. > This is technically the same as stated above, but already happens automatically. > > In our use-case, that does not help much, as the changelog is auto-generated by ISAR. It does help because it will already deliver a stable (even if meaningless) timestamp. And if there is a changelog that is appended, its last entry date is used. > Actually, it points to the begin of the Unix epoch, which is questionable. > At least there, we should add the current build time (and add an option to overwrite, otherwise dpkg-raw recipes can no longer be cached). That would be counterproductive for reproducibility and was the reason to pin it to 0 not that long ago (53d315fdd3f3). If you want proper changelog with proper dates, don't use deb_add_changelog. Jan -- Siemens AG, Technology Competence Center Embedded Linux