Skip to content

Commit 1cb86b6

Browse files
committed
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 <[email protected]>
1 parent ec31f86 commit 1cb86b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,11 @@ vmlinux: vmlinux.o $(KBUILD_LDS) modpost
12581258
# make sure no implicit rule kicks in
12591259
$(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): . ;
12601260

1261+
ifeq ($(origin KERNELRELEASE),file)
12611262
filechk_kernel.release = $(srctree)/scripts/setlocalversion $(srctree)
1263+
else
1264+
filechk_kernel.release = echo $(KERNELRELEASE)
1265+
endif
12621266

12631267
# Store (new) KERNELRELEASE string in include/config/kernel.release
12641268
include/config/kernel.release: FORCE
@@ -2123,7 +2127,7 @@ checkstack:
21232127
$(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
21242128

21252129
kernelrelease:
2126-
@$(srctree)/scripts/setlocalversion $(srctree)
2130+
@$(filechk_kernel.release)
21272131

21282132
kernelversion:
21292133
@echo $(KERNELVERSION)

0 commit comments

Comments
 (0)