[PATCH 1/2] kbuild: allow toggling the `with_devel` RPM macro
From: Pratham Patel
Date: Wed Apr 17 2024 - 00:38:36 EST
As it stands, there is no way to toggle the `with_devel` RPM macro
that is defined in the scripts/package/kernel.spec file, without
manually building the RPM.
Introduce the Kbuild variable KBUILD_RPM_WITH_DEVEL to toggle the
`with_devel` macro when building the binary PRM package.
The prior default of not building the `-devel` RPM package is preserved.
Signed-off-by: Pratham Patel <prathampatel@xxxxxxxxxxxxxx>
---
scripts/Makefile.package | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 38653f3e8108..715e068eae60 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -47,6 +47,8 @@ $(linux-tarballs): .tmp_HEAD FORCE
# rpm-pkg srcrpm-pkg binrpm-pkg
# ---------------------------------------------------------------------------
+export KBUILD_RPM_WITH_DEVEL ?= 0
+
quiet_cmd_mkspec = GEN $@
cmd_mkspec = $(srctree)/scripts/package/mkspec $@
@@ -71,7 +73,8 @@ rpm-pkg srcrpm-pkg binrpm-pkg: rpmbuild/SPECS/kernel.spec
+$(strip rpmbuild -b$(build-type) rpmbuild/SPECS/kernel.spec \
--define='_topdir $(abspath rpmbuild)' \
$(if $(filter a b, $(build-type)), \
- --target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}' \
+ --target $(UTS_MACHINE)-linux --build-in-place --noprep \
+ --define='_smp_mflags %{nil}' --define='with_devel $(KBUILD_RPM_WITH_DEVEL)' \
$$(rpm -q rpm >/dev/null 2>&1 || echo --nodeps)) \
$(RPMOPTS))
--
2.42.0