kbuild: optimize the increments the version number rules
PATCH 1/1 kbuild: optimize the increments the version number rules
Currently, the build version of the kernel can only count integers. If the user defines that the version in .version is a non-integer number, the build version will be '1'.
The original intention of the version rule as I understand it is to initialize the version to '1' when the user does not define a build version.
In order to allow users to define a non-integer kernel version, and it will not be automatically changed to '1' after definition, this modification is submitted
Fixes 2df8220cc511 ("kbuild: build init/built-in.a just once")
Signed-off-by Meng Tang <[email protected]>
--- init/build-version | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
init/build-version +6 -1
@@ -3,7 +3,12 @@ prev_ver=$(cat .version 2>/dev/null) && ver=$(expr ${prev_ver} + 1 2>/dev/null) || -ver=1 +if [ X$prev_ver = "X" ] +then + ver=1 +else + ver=$prev_ver +fi echo ${ver} > .version
Signature · 1 line
2.20.1