Makefile: fix usage of kernelrelease with M=foo
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.
PATCH 1/1 Makefile: Make kernelrelease target work with M=
From: Tzafrir Cohen <[email protected]>
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
@@ -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
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
Makefiletarget. It is currently only being set whenKBUILD_EXTMODis not set. Make sure it is set in that case as well.Signed-off-by Tzafrir Cohen <[email protected]>
Applied to linux-kbuild/fixes. Thanks.
Quoted 20 lines
--- Makefile | 2 ++ 1 file changed, 2 insertions(+)Makefile +2
-1@@ -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