Skip to content

Commit

Permalink
setlocalversion: absorb $(KERNELVERSION)
Browse files Browse the repository at this point in the history
Print $(KERNELVERSION) in setlocalversion so that the callers get
simpler.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Feb 5, 2023
1 parent 75280bd commit ec31f86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1258,8 +1258,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
Expand Down Expand Up @@ -2124,7 +2123,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)
Expand Down
7 changes: 6 additions & 1 deletion scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ if ! test -e include/config/auto.conf; then
exit 1
fi

if [ -z "${KERNELVERSION}" ]; then
echo "KERNELVERSION is not set" >&2
exit 1
fi

# localversion* files in the build and source directory
res="$(collect_files localversion*)"
if test ! "$srctree" -ef .; then
Expand All @@ -127,4 +132,4 @@ elif [ "${LOCALVERSION+set}" != "set" ]; then
res="$res$(scm_version --short)"
fi

echo "$res"
echo "${KERNELVERSION}${res}"

0 comments on commit ec31f86

Please sign in to comment.