summaryrefslogtreecommitdiffstats
path: root/scripts/package/mkspec
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-03-15 16:50:17 +0100
committerMasahiro Yamada <masahiroy@kernel.org>2023-03-16 14:45:56 +0100
commit81f59a26f3d59c6aeb137b7b5546848779222c65 (patch)
treec07af94f4b43b39cc988931dac817c2d12c0dc93 /scripts/package/mkspec
parentkbuild: deb-pkg: use dh_listpackages to know enabled packages (diff)
downloadlinux-81f59a26f3d59c6aeb137b7b5546848779222c65.tar.xz
linux-81f59a26f3d59c6aeb137b7b5546848779222c65.zip
kbuild: rpm-pkg: move source components to rpmbuild/SOURCES
Prepare to add more files to the source RPM. Also, fix the build error when KCONFIG_CONFIG is set: error: Bad file: ./.config: No such file or directory Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/package/mkspec12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 3c550960dd39..5f007137f5a0 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -15,15 +15,19 @@ if [ "$1" = prebuilt ]; then
MAKE="$MAKE -f $srctree/Makefile"
else
S=
+
+ mkdir -p rpmbuild/SOURCES
+ cp linux.tar.gz rpmbuild/SOURCES
+ cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config
fi
-if grep -q CONFIG_MODULES=y .config; then
+if grep -q CONFIG_MODULES=y include/config/auto.conf; then
M=
else
M=DEL
fi
-if grep -q CONFIG_DRM=y .config; then
+if grep -q CONFIG_DRM=y include/config/auto.conf; then
PROVIDES=kernel-drm
fi
@@ -48,7 +52,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
Vendor: The Linux Community
URL: https://www.kernel.org
$S Source0: linux.tar.gz
-$S Source1: .config
+$S Source1: config
Provides: $PROVIDES
$S BuildRequires: bc binutils bison dwarves
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
@@ -85,7 +89,7 @@ $S$M against the $__KERNELRELEASE kernel package.
$S$M
$S %prep
$S %setup -q -n linux
-$S cp %{SOURCE1} .
+$S cp %{SOURCE1} .config
$S
$S %build
$S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}