Skip to contentSkip to conversation

Get git version and transfer it to build target

PATCH New Touhtarian 2 participants 3 messages Oct 1, 2020 – Oct 2, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Touhtarian

#1 lore raw

PATCH 1/1 Get git version and transfer it to build target

---
 linux/linux.mk | 7 +++++++
 1 file changed, 7 insertions(+)
linux/linux.mk +6 -1
@@ -538,6 +538,13 @@ $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett  endif  endif
 
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
+define LINUX_GIT_VERSION
+	$(TOPDIR)/support/scripts/setlocalversion $(LINUX_DL_DIR)/git > 
+$(@D)/.scmversion endef LINUX_PRE_BUILD_HOOKS += LINUX_GIT_VERSION 
+endif
+
 ifeq ($(BR_BUILDING),y)
 
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
--

2.17.1

#2 lore raw

PATCH 1/1 Get git version and transfer it to build target

Eric, All,

Thanks for your contribution.

On 2020-10-01 14:47 +0000, Touhtarian, Eric via buildroot spake thusly:

Quoted 9 lines
---
 linux/linux.mk | 7 +++++++
 1 file changed, 7 insertions(+)

linux/linux.mk $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett endif endif · line 542

Quoted 5 lines
linux/linux.mk +4 -0
@@ -538,6 +538,13 @@ $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett  endif  endif
 
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
+define LINUX_GIT_VERSION
+	$(TOPDIR)/support/scripts/setlocalversion $(LINUX_DL_DIR)/git > 
+$(@D)/.scmversion endef LINUX_PRE_BUILD_HOOKS += LINUX_GIT_VERSION 

This patch is badly mangled , probably by your email client. Be sure to use 'git send-email' to send your patches, as this generates proper emails. See the manual:

https://buildroot.org/downloads/manual/manual.html#submitting-patches

linux/linux.mk $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett endif endif · line 543

Quoted 1 line
linux/linux.mk +1 -0
+endif

Why would we store the Linux kernel version on the target? If we were to do so, why would we not do that for all other packages as well?

Besides, the kernel version is already included in the kernel binary itself, if you set CONFIG_LOCALVERSION_AUTO=y in your kernel config file.

If what you need is accountability, then 'make show-info' will dump a json blurb with a lot of metadata about all packages in your build, including the kernel version.

Finally, if you need traceability, you probbly already have your kernel version string in your Buildroot configuration file.

I'll mark this patch as rejected. If you still think there is a valid use-case for it, that is not covered by one of the above, then please respin and provide a commit log that explains that use-case.

Regards,
Yann E. MORIN.

Quoted 10 lines
linux/linux.mk +0 -1
 ifeq ($(BR_BUILDING),y)
 
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
--

2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 Get git version and transfer it to build target

Hi Yann,

Sorry for bad email format for this request.

The issue is the kernel version, like using "uname -r" command, doesn't reflect the real git commit.

In case there are 6 commits after the release tag, we should return version like "v5.4.55-6-g10df54acb4be" but currently we always return the release version "v5.4.55". We would prefer having the commit version to identify the right used kernel on target.

The problem is "setlocalversion" script from kernel is called within buildroot/output/build/ linux-<xxxx> folder which doesn't contain git repository information and so it doesn't set the committed version.

Regards
Eric

________________________________________
De : Yann E. MORIN <[email protected]>
Envoy? : jeudi 1 octobre 2020 22:14
? : Touhtarian, Eric <[email protected]>
Cc?: buildroot at buildroot.org <[email protected]>
Objet : Re: [Buildroot] [PATCH 1/1] Get git version and transfer it to build target ?
Eric, All,

Thanks for your contribution.

On 2020-10-01 14:47 +0000, Touhtarian, Eric via buildroot spake thusly:

Quoted 10 lines

---
? linux/linux.mk | 7 +++++++
? 1 file changed, 7 insertions(+)

linux/linux.mk +0 -0
@@ -538,6 +538,13 @@ $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett? endif? endif

?

linux/linux.mk $(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL sett endif endif · line 542

Quoted 4 lines
linux/linux.mk +4 -0
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
+define LINUX_GIT_VERSION
+???? $(TOPDIR)/support/scripts/setlocalversion $(LINUX_DL_DIR)/git > 
+$(@D)/.scmversion endef LINUX_PRE_BUILD_HOOKS += LINUX_GIT_VERSION 

This patch is badly mangled , probably by your email client. Be sure to use 'git send-email' to send your patches, as this generates proper emails. See the manual:

??? https://urldefense.com/v3/__https:/buildroot.org/downloads/manual/manual.html*submitting-patches__;Iw!!Po4YltK3bPMkYw!hfkAz-K0QIf2YfE5FsVWnOLkmhiLRJj1KPj8ZiScTbirmmhVnVFLP93Ld_LqP0-jJ56K-sRu$

Quoted 1 line

+endif

Why would we store the Linux kernel version on the target? If we were to do so, why would we not do that for all other packages as well?

Besides, the kernel version is already included in the kernel binary itself, if you set CONFIG_LOCALVERSION_AUTO=y in your kernel config file.

If what you need is accountability, then 'make show-info' will dump a json blurb with a lot of metadata about all packages in your build, including the kernel version.

Finally, if you need traceability, you probbly already have your kernel version string in your Buildroot configuration file.

I'll mark this patch as rejected. If you still think there is a valid use-case for it, that is not covered by one of the above, then please respin and provide a commit log that explains that use-case.

Regards,
Yann E. MORIN.

Quoted 10 lines

? ifeq ($(BR_BUILDING),y)
?
? ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
--
2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
https://urldefense.com/v3/__http:/lists.busybox.net/mailman/listinfo/buildroot__;!!Po4YltK3bPMkYw!hfkAz-K0QIf2YfE5FsVWnOLkmhiLRJj1KPj8ZiScTbirmmhVnVFLP93Ld_LqP0-jJz9E4NdN$

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|? Yann E. MORIN? | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software? Designer | \ / CAMPAIGN???? |? ___?????????????? |
| +33 561 099 427 `------------.-------:? X? AGAINST????? |? \e/? There is no? |
| https://urldefense.com/v3/__http:/ymorin.is-a-geek.org/__;!!Po4YltK3bPMkYw!hfkAz-K0QIf2YfE5FsVWnOLkmhiLRJj1KPj8ZiScTbirmmhVnVFLP93Ld_LqP0-jJ1R7rICb$? | _/*\_ | / \ HTML MAIL??? |?? v?? conspiracy.? |
'------------------------------^-------^------------------^--------------------'