kbuild: get rid of unwanted "+" when CONFIG_LOCALVERSION is set
PATCH 1/1 kbuild: get rid of unwanted "+" when CONFIG_LOCALVERSION is set
The scripts/setlocalversion script correctly tries not adding "+" when CONFIG_LOCALVERSION is defined. However, instead of grepping for it (as it is done for CONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION set in the shell which is not.
Export LOCALVERSION so scripts/setlocalversion could see it and not add unwanted "+" at the end of the kernelrelease.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -368,7 +368,7 @@ include $(srctree)/scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(call read-file, include/config/kernel.release) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION LOCALVERSION include $(srctree)/scripts/subarch.include
Signature · 1 line
2.41.0
Quoted 3 lines · Alexey Kardashevskiy
The
scripts/setlocalversionscript correctly tries not adding "+" whenCONFIG_LOCALVERSIONis defined.
I am afraid you are misunderstanding the script.
CONFIG_LOCALVERSION and the "+" sign is unrelated.
Quoted 8 lines
However, instead of grepping for it
(as it is done forCONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION set in the shell which is not.Export LOCALVERSION so
scripts/setlocalversioncould see it and not add unwanted "+" at the end of the kernelrelease.Signed-off-by Alexey Kardashevskiy <[email protected]>
So, scripts/setlocalversion will always see
defined LOCALVERSION.
With your patch, LOCALVERSION would be set to an empty value, which would make the following condition always false.
elif [ "${LOCALVERSION+set}" != "set" ]; then
Your patch is equivalent to deleting
line 175-183 of scripts/setlocalversion.
Of course, that is wrong and unacceptable.
Quoted 20 lines
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-2@@ -368,7 +368,7 @@ include $(srctree)/scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(call read-file, include/config/kernel.release) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION LOCALVERSION include $(srctree)/scripts/subarch.include --2.41.0
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 6 lines · Masahiro Yamada
Quoted 3 lines · Alexey Kardashevskiy
The
scripts/setlocalversionscript correctly tries not adding "+" whenCONFIG_LOCALVERSIONis defined.I am afraid you are misunderstanding the script.
Possibly :) I should have read of "+set"... sorry :-/ Thanks for spending time looking at this.
Quoted 1 line
CONFIG_LOCALVERSIONand the "+" sign is unrelated.
How come?
scripts/setlocalversion -> if [ "${LOCALVERSION+set}" != "set" ] -> scm_version --short -> echo "+".
Where is that LOCALVERSION supposed to come from, and when? Is not LOCALVERSION related to CONFIG_LOCALVERSION?
Quoted 16 lines
Quoted 8 lines
However, instead of grepping for it
(as it is done forCONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION set in the shell which is not.Export LOCALVERSION so
scripts/setlocalversioncould see it and not add unwanted "+" at the end of the kernelrelease.Signed-off-by Alexey Kardashevskiy <[email protected]>So,
scripts/setlocalversionwill always see
defined LOCALVERSION.With your patch, LOCALVERSION would be set to an empty value, which would make the following condition always false.
Quoted 7 lines
elif [ "${LOCALVERSION+set}" != "set" ]; then
Your patch is equivalent to deleting
line 175-183 ofscripts/setlocalversion.Of course, that is wrong and unacceptable.
Ok. What is the right way of getting rid of the "+"? Thanks,
Quoted 29 lines
Quoted 27 lines
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-2@@ -368,7 +368,7 @@ include $(srctree)/scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(call read-file, include/config/kernel.release) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION LOCALVERSION include $(srctree)/scripts/subarch.include --2.41.0
Quoted 38 lines · Alexey Kardashevskiy
Quoted 6 lines · Masahiro Yamada
Quoted 3 lines · Alexey Kardashevskiy
The
scripts/setlocalversionscript correctly tries not adding "+" whenCONFIG_LOCALVERSIONis defined.I am afraid you are misunderstanding the script.
Possibly :) I should have read of "+set"... sorry :-/ Thanks for spending time looking at this.
Quoted 1 line
CONFIG_LOCALVERSIONand the "+" sign is unrelated.How come?
scripts/setlocalversion-> if [ "${LOCALVERSION+set}" != "set" ] ->scm_version--short -> echo "+".Where is that LOCALVERSION supposed to come from, and when? Is not LOCALVERSION related to
CONFIG_LOCALVERSION?Quoted 19 lines
Quoted 8 lines
However, instead of grepping for it
(as it is done forCONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION set in the shell which is not.Export LOCALVERSION so
scripts/setlocalversioncould see it and not add unwanted "+" at the end of the kernelrelease.Signed-off-by Alexey Kardashevskiy <[email protected]>So,
scripts/setlocalversionwill always see
defined LOCALVERSION.With your patch, LOCALVERSION would be set to an empty value, which would make the following condition always false.
elif [ "${LOCALVERSION+set}" != "set" ]; then
Quoted 6 lines
Quoted 4 lines
Your patch is equivalent to deleting
line 175-183 ofscripts/setlocalversion.Of course, that is wrong and unacceptable.
Ok. What is the right way of getting rid of the "+"? Thanks,
make LOCALVERSION="" ...
seems to be the only way, is that right? I thought CONFIG_LOCALVERSION is good enough for not having "+", hmm.
Signature · 1 line
Alexey
Quoted 15 lines · Alexey Kardashevskiy
Quoted 6 lines · Masahiro Yamada
Quoted 3 lines · Alexey Kardashevskiy
The
scripts/setlocalversionscript correctly tries not adding "+" whenCONFIG_LOCALVERSIONis defined.I am afraid you are misunderstanding the script.
Possibly :) I should have read of "+set"... sorry :-/ Thanks for spending time looking at this.
Quoted 1 line
CONFIG_LOCALVERSIONand the "+" sign is unrelated.
Quoted 7 lines
How come?
scripts/setlocalversion-> if [ "${LOCALVERSION+set}" != "set" ] ->scm_version--short -> echo "+".Where is that LOCALVERSION supposed to come from, and when? Is not LOCALVERSION related to
CONFIG_LOCALVERSION?
1) LOCALVERSION is an environment variable.
$ LOCALVERSION=-foo make
or
$ make LOCALVERSION=-foo2) CONFIG_LOCALVERSION is a CONFIG option
$ make menuconfig
and set the value.
1) and 2) are orthogonal.
If you set both, you can get both of them.
Quoted 19 lines
Quoted 19 lines
Quoted 8 lines
However, instead of grepping for it
(as it is done forCONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION set in the shell which is not.Export LOCALVERSION so
scripts/setlocalversioncould see it and not add unwanted "+" at the end of the kernelrelease.Signed-off-by Alexey Kardashevskiy <[email protected]>So,
scripts/setlocalversionwill always see
defined LOCALVERSION.With your patch, LOCALVERSION would be set to an empty value, which would make the following condition always false.
elif [ "${LOCALVERSION+set}" != "set" ]; then
Quoted 6 lines
Quoted 4 lines
Your patch is equivalent to deleting
line 175-183 ofscripts/setlocalversion.Of course, that is wrong and unacceptable.
Ok. What is the right way of getting rid of the "+"? Thanks,
--
Best Regards
Masahiro Yamada
Quoted 49 lines · Alexey Kardashevskiy
Quoted 46 lines · Alexey Kardashevskiy
Quoted 7 lines · Masahiro Yamada
Quoted 3 lines · Alexey Kardashevskiy
The
scripts/setlocalversionscript correctly tries not adding "+" whenCONFIG_LOCALVERSIONis defined.I am afraid you are misunderstanding the script.
Possibly :) I should have read of "+set"... sorry :-/ Thanks for spending time looking at this.
Quoted 1 line
CONFIG_LOCALVERSIONand the "+" sign is unrelated.How come?
scripts/setlocalversion-> if [ "${LOCALVERSION+set}" != "set" ] ->scm_version--short -> echo "+".Where is that LOCALVERSION supposed to come from, and when? Is not LOCALVERSION related to
CONFIG_LOCALVERSION?Quoted 23 lines
Quoted 9 lines
However, instead of grepping for it
(as it is done forCONFIG_LOCALVERSION_AUTO=y), it relies on LOCALVERSION
set in the shell which is not.Export LOCALVERSION so
scripts/setlocalversioncould see it and not add unwanted "+" at the end of the kernelrelease.Signed-off-by Alexey Kardashevskiy <[email protected]>So,
scripts/setlocalversionwill always see
defined LOCALVERSION.With your patch, LOCALVERSION would be set to an empty value, which would make the following condition always false.
elif [ "${LOCALVERSION+set}" != "set" ]; then
Your patch is equivalent to deleting
line 175-183 ofscripts/setlocalversion.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Of course, that is wrong and unacceptable.
Ok. What is the right way of getting rid of the "+"? Thanks,
make LOCALVERSION="" ...
seems to be the only way, is that right? I thoughtCONFIG_LOCALVERSIONis good enough for not having "+", hmm.
Correct.
Reading the commit description of5df99bec210a2cf89dd91e52f0d0a714bf4cd96a
makes it clearer.
Best Regards
Masahiro Yamada