Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ckhardin@gmail.com
To: buildroot@buildroot.org
Cc: Charles Hardin <ckhardin@gmail.com>
Subject: [Buildroot] [PATCH 3/4] boot/uboot: add a setlocalversion rsync hook when overriding srcdir
Date: Thu,  9 Feb 2023 15:15:17 -0800	[thread overview]
Message-ID: <20230209231518.9458-3-ckhardin@gmail.com> (raw)
In-Reply-To: <20230209231518.9458-1-ckhardin@gmail.com>

From: Charles Hardin <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 PLAIN_VERSION "2018.03-01358-gbda75d6a8b"
    #define U_BOOT_VERSION "U-Boot " PLAIN_VERSION

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
---
 boot/uboot/uboot.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index d735b47326..3f8479e623 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -40,6 +40,18 @@ UBOOT_SITE = https://ftp.denx.de/pub/u-boot
 UBOOT_SOURCE = u-boot-$(UBOOT_VERSION).tar.bz2
 endif
 
+ifneq ($(UBOOT_OVERRIDE_SRCDIR),)
+define UBOOT_OVERRIDE_SRCDIR_SETLOCALVERSION
+	(cd $(@D); \
+		if [ -x ./scripts/setlocalversion ]; then \
+			./scripts/setlocalversion --save-scmversion \
+				$(abspath $(UBOOT_OVERRIDE_SRCDIR)) ||:; \
+		fi)
+endef
+
+UBOOT_POST_RSYNC_HOOKS += UBOOT_OVERRIDE_SRCDIR_SETLOCALVERSION
+endif
+
 ifeq ($(BR2_TARGET_UBOOT)$(BR2_TARGET_UBOOT_LATEST_VERSION),y)
 BR_NO_CHECK_HASH_FOR += $(UBOOT_SOURCE)
 endif
-- 
2.37.1 (Apple Git-137.1)

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

  parent reply	other threads:[~2023-02-09 23:15 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 ` ckhardin [this message]
2023-02-09 23:15 ` [Buildroot] [PATCH 4/4] linux: add a setlocalversion rsync hook when overriding srcdir 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

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=20230209231518.9458-3-ckhardin@gmail.com \
    --to=ckhardin@gmail.com \
    --cc=buildroot@buildroot.org \
    /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