summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-01-28 01:19:42 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-02-05 18:51:21 +0900
commit1cb86b6c313623486038165f90f4067578c2f5d5 (patch)
tree63228ef9f2b8cd2ce0f2a56e4c8781ff0669fa4d /Makefile
parentec31f868ec674edfcf653cc7c82b365c6f570cd9 (diff)
downloadlinux-stable-1cb86b6c313623486038165f90f4067578c2f5d5.tar.gz
linux-stable-1cb86b6c313623486038165f90f4067578c2f5d5.tar.bz2
linux-stable-1cb86b6c313623486038165f90f4067578c2f5d5.zip
kbuild: save overridden KERNELRELEASE in include/config/kernel.release
${KERNELRELEASE} is used as a part of the installation path. (INSTALL_DTBS_PATH, MODLIB, etc.) When KERNELRELEASE is overridden from the command line, it should be saved in include/config/kernel.release, so that it will be consistently used for the installation steps. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 203b86e95197..3e7f96f12f08 100644
--- a/Makefile
+++ b/Makefile
@@ -1258,7 +1258,11 @@ vmlinux: vmlinux.o $(KBUILD_LDS) modpost
# make sure no implicit rule kicks in
$(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): . ;
+ifeq ($(origin KERNELRELEASE),file)
filechk_kernel.release = $(srctree)/scripts/setlocalversion $(srctree)
+else
+filechk_kernel.release = echo $(KERNELRELEASE)
+endif
# Store (new) KERNELRELEASE string in include/config/kernel.release
include/config/kernel.release: FORCE
@@ -2123,7 +2127,7 @@ checkstack:
$(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
kernelrelease:
- @$(srctree)/scripts/setlocalversion $(srctree)
+ @$(filechk_kernel.release)
kernelversion:
@echo $(KERNELVERSION)