Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Hardin <ckhardin@gmail.com>
To: buildroot@buildroot.org
Cc: Charles Hardin <ckhardin@gmail.com>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>
Subject: [Buildroot] [PATCH v2 3/3] linux: add a scmversion rsync hook when overriding srcdir
Date: Wed, 22 Feb 2023 14:11:34 -0800	[thread overview]
Message-ID: <20230222221134.25904-4-ckhardin@gmail.com> (raw)
In-Reply-To: <20230209231518.9458-1-ckhardin@gmail.com>

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 <ckhardin@gmail.com>
---
 linux/linux.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 7645b5f507..b72318e3f2 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -24,12 +24,15 @@ LINUX_SOURCE = $(notdir $(LINUX_TARBALL))
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
 LINUX_SITE_METHOD = git
+LINUX_SCMVERSION = YES
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
 LINUX_SITE_METHOD = hg
+LINUX_SCMVERSION = YES
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_SVN),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
 LINUX_SITE_METHOD = svn
+LINUX_SCMVERSION = YES
 else ifeq ($(BR2_LINUX_KERNEL_LATEST_CIP_VERSION)$(BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION),y)
 LINUX_SOURCE = linux-cip-$(LINUX_VERSION).tar.gz
 LINUX_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/snapshot
@@ -46,6 +49,15 @@ LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v$(firstword $(subst ., ,$(LINUX_
 endif
 endif
 
+ifneq ($(LINUX_OVERRIDE_SRCDIR),)
+define LINUX_SCMVERSION_HOOK
+	$(TOPDIR)/support/download/scmversion \
+		$(abspath $(LINUX_OVERRIDE_SRCDIR)) $(@D)/.scmversion
+endef
+
+LINUX_POST_RSYNC_HOOKS += LINUX_SCMVERSION_HOOK
+endif
+
 ifeq ($(BR2_LINUX_KERNEL)$(BR2_LINUX_KERNEL_LATEST_VERSION),y)
 BR_NO_CHECK_HASH_FOR += $(LINUX_SOURCE)
 endif
-- 
2.24.3 (Apple Git-128)

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

  parent reply	other threads:[~2023-02-22 22:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Charles Hardin [this message]
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

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=20230222221134.25904-4-ckhardin@gmail.com \
    --to=ckhardin@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /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