Skip to contentSkip to conversation

kbuild: save overridden KERNELRELEASE in include/config/kernel.release

PATCH New Masahiro Yamada 1 participant 1 message Jan 27, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

This patch will replace the buggy
https://lore.kernel.org/linux-kbuild/[email protected]/T/#u

 Makefile | 4 ++++
 1 file changed, 4 insertions(+)
Makefile +4 -0
index 203b86e95197..aeea900eff71 100644
@@ -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
Signature · 1 line
2.34.1