Skip to contentSkip to conversation

Makefile: fix usage of kernelrelease with M=foo

PATCH In review [email protected] 2 participants 3 messages Mar 14, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

Commit 1cb86b6c3136 ("kbuild: save overridden KERNELRELEASE in include/config/kernel.release") set the command that is used for printing the output of kernelrelease only when KBUILD_EXTMOD is not set.

Test:

make M=$PWD -s kernelversion
make M=$PWD -s kernelrelease

Should print both. Prints only kernelversion and an empty line for kernelrelease. Included a simple patch that fixes this test.

#1 lore raw

PATCH 1/1 Makefile: Make kernelrelease target work with M=

From: Tzafrir Cohen <[email protected]>

Fixes commit 1cb86b6c3136 ("kbuild: save overridden KERNELRELEASE in include/config/kernel.release")

That commit required the use of filechk_kernel.release for the kernelrelease Makefile target. It is currently only being set when KBUILD_EXTMOD is not set. Make sure it is set in that case as well.

---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index 3e7f96f12f08..e0859c608147 100644
@@ -1880,6 +1880,8 @@ endif
 
 else # KBUILD_EXTMOD
 
+filechk_kernel.release = echo $(KERNELRELEASE)
+
 ###
 # External module support.
 # When building external modules the kernel used as basis is considered
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH] Makefile: Make kernelrelease target work with M=

Quoted 10 lines · On Tue, Mar 14, 2023 at 10:04 PM <[email protected]> wrote:

From: Tzafrir Cohen <[email protected]>

Fixes commit 1cb86b6c3136 ("kbuild: save overridden KERNELRELEASE in include/config/kernel.release")

That commit required the use of filechk_kernel.release for the kernelrelease Makefile target. It is currently only being set when KBUILD_EXTMOD is not set. Make sure it is set in that case as well.

Applied to linux-kbuild/fixes. Thanks.

Quoted 20 lines
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -1
index 3e7f96f12f08..e0859c608147 100644
@@ -1880,6 +1880,8 @@ endif
 
 else # KBUILD_EXTMOD
 
+filechk_kernel.release = echo $(KERNELRELEASE)
+
 ###
 # External module support.
 # When building external modules the kernel used as basis is considered
--

2.39.2

Signature · 2 lines
Best Regards
Masahiro Yamada