Skip to contentSkip to conversation

build: allow a downstream suffix in the version shown during boot

PATCH In review Nicolas Boulenguez 2 participants 3 messages Mar 14, 2022 – Apr 13, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: allow a downstream suffix in the version shown during boot

Hello.

https://lists.denx.de/pipermail/u-boot/2022-February/474887.html got no answer, probably because it is trivial and has been lost among more important topics, so I am submitting it again.

It is convenient for redistributors to add a build number to the U-boot source version, which is displayed at boot and useful to know if a device has been successfully updated, to triage bugs and so on.

For example, Debian adds '+dfsg-N' where N changes with each release of a .deb package.

Author: Vagrant Cascadian <[email protected]>
Author: Nicolas Boulenguez <[email protected]>

Makefile +1 -1
@@ -456,7 +456,7 @@ KBUILD_AFLAGS	+= $(call cc-option,-fno-PIE)
 
 # Read UBOOTRELEASE from include/config/uboot.release (if it exists)
 UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
-UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)$(BUILD_VERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
 export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
doc/build/gcc.rst +5 -0
@@ -151,6 +151,11 @@
 Note that the :doc:`tools` are always built with the included version of libfdt
 so it is not possible to build U-Boot tools with a system libfdt, at present.
 
+If you are modifying the upstream sources, please make this visible
+at boot time by defining the BUILD_VERSION version suffix.
+
+* BUILD_VERSION=+<vendor><build number><...>
+
 Other build targets
 ~~~~~~~~~~~~~~~~~~~
 
#1 lore raw
Quoted 31 lines · Nicolas Boulenguez

Hello.

https://lists.denx.de/pipermail/u-boot/2022-February/474887.html got no answer, probably because it is trivial and has been lost among more important topics, so I am submitting it again.

It is convenient for redistributors to add a build number to the U-boot source version, which is displayed at boot and useful to know if a device has been successfully updated, to triage bugs and so on.

For example, Debian adds '+dfsg-N' where N changes with each release of a .deb package.

Author: Vagrant Cascadian <[email protected]>
Author: Nicolas Boulenguez <[email protected]>

Makefile +1 -1
@@ -456,7 +456,7 @@ KBUILD_AFLAGS	+= $(call cc-option,-fno-PIE)
 
 # Read UBOOTRELEASE from include/config/uboot.release (if it exists)
 UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
-UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)$(BUILD_VERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
 export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR

doc/build/gcc.rst line 160

Quoted 10 lines
doc/build/gcc.rst +5 -0
@@ -151,6 +151,11 @@
 Note that the :doc:`tools` are always built with the included version of libfdt
 so it is not possible to build U-Boot tools with a system libfdt, at present.
 
+If you are modifying the upstream sources, please make this visible
+at boot time by defining the BUILD_VERSION version suffix.
+
+* BUILD_VERSION=+<vendor><build number><...>
+
 Other build targets
 ~~~~~~~~~~~~~~~~~~~

Why do you need this, instead of just using CONFIG_LOCALVERSION? What do you do for linux kernel builds, which are also Kbuild based? Thanks.

Signature · 1 line
Tom
#2 lore raw
Quoted 1 line

Why do you need this, instead of just using CONFIG_LOCALVERSION?

Because we were not aware of this option.
Thanks for the hint and sorry for the noise.