From 0b7f12f5912de636a9c1671ee343f31f21c42b2f Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 30 Sep 2017 10:10:07 +0900 Subject: kbuild: rpm-pkg: fix build error when CONFIG_MODULES is disabled When CONFIG_MODULES is disabled, make rpm-pkg / binrpm-pkg fails with the following message: The present kernel configuration has modules disabled. Type 'make config' and enable loadable module support. Then build a kernel with module support enabled. Do not install modules in the case. Also, omit the devel package. Signed-off-by: Masahiro Yamada --- scripts/package/mkspec | 57 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/scripts/package/mkspec b/scripts/package/mkspec index b341d5d8e793..d352a0188770 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -16,6 +16,12 @@ else S= fi +if grep -q CONFIG_MODULES=y .config; then + M= +else + M=DEL +fi + if grep -q CONFIG_DRM=y .config; then PROVIDES=kernel-drm fi @@ -30,6 +36,7 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \ # # Labels: # $S: this line is enabled only when building source package +# $M: this line is enabled only when CONFIG_MODULES is enabled sed -e '/^DEL/d' -e 's/^\t*//' <