From patchwork Thu Feb 9 03:07:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Hardin X-Patchwork-Id: 1739770 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PC1xg3Gmmz23hX for ; Thu, 9 Feb 2023 14:07:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7C40D40992; Thu, 9 Feb 2023 03:07:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7C40D40992 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DEpZMcAxQv01; Thu, 9 Feb 2023 03:07:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 7DE1F4094D; Thu, 9 Feb 2023 03:07:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7DE1F4094D X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 1AAEA1BF4E5 for ; Thu, 9 Feb 2023 03:07:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 01159820C0 for ; Thu, 9 Feb 2023 03:07:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 01159820C0 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id szqIADT713Ct for ; Thu, 9 Feb 2023 03:07:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 01340820B6 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by smtp1.osuosl.org (Postfix) with ESMTPS id 01340820B6 for ; Thu, 9 Feb 2023 03:07:12 +0000 (UTC) Received: by mail-ot1-x32b.google.com with SMTP id g21-20020a9d6495000000b0068bb336141dso177408otl.11 for ; Wed, 08 Feb 2023 19:07:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YMFyFWQKAe34++kCrhB6kdtTnsf5oxhzFqpnzvqB97s=; b=75vmYuWaVC5/MBAxxOTVTokjGtoUkHitjfCce5VPDWRaHLTCfzNF2jbDJhF6hFSfa9 o/4Qe9huA2RHzUPdcX12b59T5AWj2MGLUg48TvQKMW37jVN2zBOquQ2DB6wSKLceMaLA yKSKR541JeOw+hID1a8ao5UeLdjgxTCqlTHBqv21gpQb1DYGjWkCKJqLBbRnga6mhaDn WF7PPKdRlHCrwBJfH3Rx4ZgPX2gK4ZUXELbQr+fcczYKD0EnpPrKL+hBHvxwIBT+CnJQ xxiIYaZjLIYiMln6DImV6eclZ6OBl1z2tcbN5JWDglR6m8HVnLdGUlOCgOtCKs5ttOtk mjvQ== X-Gm-Message-State: AO0yUKUHFnyXShmNhBCaRitbPkaBOIL2SO9BUZQVVFDitRNNGTBGRPWR Cd6iTSxv6aEIqOq15ESULyR6plbnq4Y= X-Google-Smtp-Source: AK7set8sZBLivIras01sVrDA6Ve/dIOD993nLQQHt9Deeclie3YfK1inRm+3FWmnPfxbwhzyuZSVqg== X-Received: by 2002:a05:6830:922:b0:686:b638:259c with SMTP id v34-20020a056830092200b00686b638259cmr5727698ott.35.1675912031445; Wed, 08 Feb 2023 19:07:11 -0800 (PST) Received: from nowhere.attlocal.net ([2600:1700:65a0:14f0:dce0:30dc:b696:f26]) by smtp.gmail.com with ESMTPSA id d8-20020a05683018e800b00670679748f9sm83631otf.49.2023.02.08.19.07.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Feb 2023 19:07:09 -0800 (PST) From: Charles Hardin X-Google-Original-From: Charles Hardin To: buildroot@buildroot.org Date: Wed, 8 Feb 2023 19:07:05 -0800 Message-Id: <20230209030706.33870-1-charles.hardin@chargepoint.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YMFyFWQKAe34++kCrhB6kdtTnsf5oxhzFqpnzvqB97s=; b=aeuxxqavBxs2nXkOPSfuLDdxORN08fdnubyEgIhGZ0OBfU0jw7AiTHeEBrsXj8Iazt ggj475wBJiIp9W1zKLmAPC6Ymg+sle/6z6cSofPV2G619Jf81/M7ngiRHzqEd2XjD1sg lY2s5iNtKQg6uvCqh4fEcxPIwnHmzc33gdtUvx/afoKvXlSSb0B1wVnsYqnpEoYCTveJ fFTjD5+VkSGP0vWZKJLoM8CBslzSIA9/Qfti2QWjGD6xmlN4Dnke9sRmmfRv8HeE6NW9 8ec2hDWHnu7zE5koVjjXs6pZImUSEkU2L31jCIKX947On/UwbmTjLCrmZgkrTb2NKWFf k9nA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=aeuxxqav Subject: [Buildroot] [PATCH 1/2] linux: create a scmversion file based on the custom repo variables X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Charles Hardin , Charles Hardin Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Charles Hardin When using the custom repositories, the archive creation will omit the source history to get reproducible hashes. This has the side effect of making the setlocalversion scripts within the builds to not create the tracking information as expected. So, just generate a .scmversion so that kernels will be labelled with where buildroot referenced them. For example (line wrapped) #define UTS_RELEASE "5.4.70-repo-version-" \ "92c23d10d0031e0a13244a1a97e7530d3b53fc6e" Signed-off-by: Charles Hardin Signed-off-by: Charles Hardin --- linux/linux.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/linux/linux.mk b/linux/linux.mk index 7645b5f507..0b27c8dee2 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -596,6 +596,20 @@ endif ifeq ($(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL)),) $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL setting) endif + +# Create a custom scm version file to reflect the source version since the +# archive will omit source directories like .git to maintain reproducible +# hashes for the archives +LINUX_CUSTOM_REPO_SCMVERSION = \ + "-repo-version-$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION))" +define LINUX_CUSTOM_REPO_SCMVERSION_HOOK + (cd $(@D); \ + if [ ! -f .scmversion ]; then \ + echo $(LINUX_CUSTOM_REPO_SCMVERSION) > .scmversion; \ + fi) +endef + +LINUX_POST_EXTRACT_HOOKS += LINUX_CUSTOM_REPO_SCMVERSION_HOOK endif ifeq ($(BR_BUILDING),y) From patchwork Thu Feb 9 03:04:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Hardin X-Patchwork-Id: 1739769 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PC1vP0JYSz23hX for ; Thu, 9 Feb 2023 14:05:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E313140940; Thu, 9 Feb 2023 03:05:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E313140940 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mjeXYecHvxwL; Thu, 9 Feb 2023 03:05:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id DEB1E40934; Thu, 9 Feb 2023 03:05:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DEB1E40934 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D23121BF4E5 for ; Thu, 9 Feb 2023 03:05:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B958B40934 for ; Thu, 9 Feb 2023 03:05:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B958B40934 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Krzec5Atp4de for ; Thu, 9 Feb 2023 03:05:11 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D18C340865 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by smtp4.osuosl.org (Postfix) with ESMTPS id D18C340865 for ; Thu, 9 Feb 2023 03:05:10 +0000 (UTC) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-15ff0a1f735so1006425fac.5 for ; Wed, 08 Feb 2023 19:05:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ci8hfX2AyisEF+wOmPmcZ/gFDTTtuSVj9metqb1uE48=; b=gsVnYkxTbZxt7fYxrHZgiNBtBu0m+Aasq6QV5r4uiQaofezzL7R99Squ+cSVLwOw8h m+i3c/QFT7vowCjAjFgIRQuX/eWQ4fc29bEyxPEX7S3nfsNPETTudWvCMdNFbyYu1HLM GBZXBYgYYtEIf/bfZcxZYlkqd6ZVoV9VSASuFv33e746s7KmS/klgC1l8ARsyK6kk7fR 5pW+ULSz7YqYM6JT9yxjP42JhKhR8dIjop8xZle6p0nNKiNtXwQhgC6S8Jh+kR+a/rrc iBZsgArUESE7lsXPp5qiV5dOi3Mg/Ex3qWtlrp8xejnCoRcEBjsuC9QA4Cfgza97CaUM nVjg== X-Gm-Message-State: AO0yUKUEF2mKjdcROe06LiKWM9NRIj7b+EEdNnJ9s3bH/YO78WGH2HX2 jnIe/o88S/HsiOq2tXpL5e2+HUWIcHA= X-Google-Smtp-Source: AK7set8UBxtz0TQPcQgHEEl/GlOCvGM7n2tDuKhS8Lok08WPxYM/9e3h4ihF1AXSG46TcgYy4Qde1g== X-Received: by 2002:a05:6870:a1a7:b0:163:2f1c:eb07 with SMTP id a39-20020a056870a1a700b001632f1ceb07mr5802036oaf.53.1675911909794; Wed, 08 Feb 2023 19:05:09 -0800 (PST) Received: from nowhere.attlocal.net ([2600:1700:65a0:14f0:dce0:30dc:b696:f26]) by smtp.gmail.com with ESMTPSA id m5-20020a056870a10500b0014fe4867dc7sm108383oae.56.2023.02.08.19.05.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Feb 2023 19:05:09 -0800 (PST) From: Charles Hardin X-Google-Original-From: Charles Hardin To: buildroot@buildroot.org Date: Wed, 8 Feb 2023 19:04:05 -0800 Message-Id: <20230209030405.33574-4-charles.hardin@chargepoint.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230209030405.33574-1-charles.hardin@chargepoint.com> References: <20230209030405.33574-1-charles.hardin@chargepoint.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ci8hfX2AyisEF+wOmPmcZ/gFDTTtuSVj9metqb1uE48=; b=S6chyOh5iJCSskS9N19TJszJc0O1epYxscCkGQrtUWgshRkNaRTuJGQuEf1jmSJkja Ryo30RNIfWo9ccDBphfJQDjMXbClqr6rpNvlrRH0AWmN0/o26PDgdAK/8rXKPchXrPRW 76s13AHRkSSnCEJTfZC/bdDaqHRTjjuR46V2d6MfVnLSGh0QaWvLOTVdTxgQ8FoQeqMJ KsFPHrL776pOlZbKeIUFPZiOlxysQ4X7tLo+Q7dnZweHGj+MJYN01jxY4c+p9RjLKA/p HXo4nuT5r4JSuh1XXftR0zMEBp4SonPA+FlCcxRTqonXUiEEbtoYnmECzdMsL6dOcPNk hn8g== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=S6chyOh5 Subject: [Buildroot] [PATCH 2/2] linux: add a setlocalversion rsync hook when overriding srcdir X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Charles Hardin , Charles Hardin Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Charles Hardin During development the override srcdir is often used with a local git repo and branch. To help track the builds used in those flows it is useful to have the scm version available as part of the info. With this hook, the auto generated version include will include the example. #define UTS_RELEASE "5.4.70-00031-g92c23d10d003" Signed-off-by: Charles Hardin Signed-off-by: Charles Hardin --- linux/linux.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linux/linux.mk b/linux/linux.mk index 7645b5f507..e88856d71e 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -46,6 +46,18 @@ LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v$(firstword $(subst ., ,$(LINUX_ endif endif +ifneq ($(LINUX_OVERRIDE_SRCDIR),) +define LINUX_OVERRIDE_SRCDIR_SETLOCALVERSION + (cd $(@D); \ + if [ -x ./scripts/setlocalversion ]; then \ + ./scripts/setlocalversion --save-scmversion \ + $(abspath $(LINUX_OVERRIDE_SRCDIR)) ||:; \ + fi) +endef + +LINUX_POST_RSYNC_HOOKS += LINUX_OVERRIDE_SRCDIR_SETLOCALVERSION +endif + ifeq ($(BR2_LINUX_KERNEL)$(BR2_LINUX_KERNEL_LATEST_VERSION),y) BR_NO_CHECK_HASH_FOR += $(LINUX_SOURCE) endif