Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] linux: create a scmversion file based on the custom repo variables
@ 2023-02-09 23:15 ckhardin
  2023-02-09 23:15 ` [Buildroot] [PATCH 2/4] boot/uboot: " ckhardin
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: ckhardin @ 2023-02-09 23:15 UTC (permalink / raw)
  To: buildroot; +Cc: Charles Hardin

From: Charles Hardin <ckhardin@gmail.com>

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 <ckhardin@gmail.com>
---
 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)
-- 
2.37.1 (Apple Git-137.1)

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-07-14 16:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 23:15 [Buildroot] [PATCH 1/4] linux: create a scmversion file based on the custom repo variables ckhardin
2023-02-09 23:15 ` [Buildroot] [PATCH 2/4] boot/uboot: " ckhardin
2023-02-09 23:15 ` [Buildroot] [PATCH 3/4] boot/uboot: add a setlocalversion rsync hook when overriding srcdir ckhardin
2023-02-09 23:15 ` [Buildroot] [PATCH 4/4] linux: " ckhardin
2023-02-14 21:46 ` [Buildroot] [PATCH 1/4] linux: create a scmversion file based on the custom repo variables Arnout Vandecappelle
2023-02-22 18:34   ` Charles Hardin
2023-02-22 22:11 ` [Buildroot] [PATCH v2 0/3] RFC source control tracking for linux/uboot Charles Hardin
2023-02-22 22:11 ` [Buildroot] [PATCH v2 1/3] support/download: add a helper scipt to generate scmversions Charles Hardin
2023-02-22 22:11 ` [Buildroot] [PATCH v2 2/3] boot/uboot: add a scmversion rsync hook when overriding srcdir Charles Hardin
2023-02-22 22:11 ` [Buildroot] [PATCH v2 3/3] linux: " Charles Hardin
2023-02-22 22:30 ` [Buildroot] RFC [PATCH v2 0/3] scmversion tracking for linux and uboot Charles Hardin
2023-02-22 22:30   ` [Buildroot] [PATCH v2 1/3] support/download: add a helper scipt to generate scmversions Charles Hardin
2024-07-14 16:41     ` Arnout Vandecappelle via buildroot
2023-02-22 22:30   ` [Buildroot] [PATCH v2 2/3] boot/uboot: add a scmversion rsync hook when overriding srcdir Charles Hardin
2024-07-14 16:47     ` Arnout Vandecappelle via buildroot
2023-02-22 22:30   ` [Buildroot] [PATCH v2 3/3] linux: " Charles Hardin

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