diff mbox series

[5/7] setlocalversion: absorb $(KERNELVERSION)

Message ID 20230122141428.115372-5-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/7] kbuild: do not put .scmversion into the source tarball | expand

Commit Message

Masahiro Yamada Jan. 22, 2023, 2:14 p.m. UTC
Print $(KERNELVERSION) in setlocalversion so that the callers get
simpler.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile                | 5 ++---
 scripts/setlocalversion | 4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index ed3294c7be97..d0a95277f08a 100644
--- a/Makefile
+++ b/Makefile
@@ -1247,8 +1247,7 @@  vmlinux: vmlinux.o $(KBUILD_LDS) modpost
 # make sure no implicit rule kicks in
 $(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): . ;
 
-filechk_kernel.release = \
-	echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
+filechk_kernel.release = $(srctree)/scripts/setlocalversion $(srctree)
 
 # Store (new) KERNELRELEASE string in include/config/kernel.release
 include/config/kernel.release: FORCE
@@ -2112,7 +2111,7 @@  checkstack:
 	$(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
 
 kernelrelease:
-	@echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
+	@$(srctree)/scripts/setlocalversion $(srctree)
 
 kernelversion:
 	@echo $(KERNELVERSION)
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index a4c9a61b0665..7c7cbefa5aa4 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -113,8 +113,10 @@  if [ -z "${KERNELVERSION}" ]; then
 	exit 1
 fi
 
+res="${KERNELVERSION}"
+
 # localversion* files in the build and source directory
-res="$(collect_files localversion*)"
+res="${res}$(collect_files localversion*)"
 if test ! "$srctree" -ef .; then
 	res="$res$(collect_files "$srctree"/localversion*)"
 fi