Commit 81f59a26 authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 36862e14
...@@ -78,6 +78,7 @@ modules.order ...@@ -78,6 +78,7 @@ modules.order
# RPM spec file (make rpm-pkg) # RPM spec file (make rpm-pkg)
# #
/*.spec /*.spec
/rpmbuild/
# #
# Debian directory (make deb-pkg) # Debian directory (make deb-pkg)
......
...@@ -1605,7 +1605,7 @@ MRPROPER_FILES += include/config include/generated \ ...@@ -1605,7 +1605,7 @@ MRPROPER_FILES += include/config include/generated \
certs/signing_key.pem \ certs/signing_key.pem \
certs/x509.genkey \ certs/x509.genkey \
vmlinux-gdb.py \ vmlinux-gdb.py \
*.spec \ *.spec rpmbuild \
rust/libmacros.so rust/libmacros.so
# clean - Delete most, but leave enough to build external modules # clean - Delete most, but leave enough to build external modules
......
...@@ -89,7 +89,7 @@ PHONY += srcrpm-pkg ...@@ -89,7 +89,7 @@ PHONY += srcrpm-pkg
srcrpm-pkg: linux.tar.gz srcrpm-pkg: linux.tar.gz
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \ +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \
--define='_smp_mflags %{nil}' --define='_sourcedir .' --define='_srcrpmdir .' --define='_smp_mflags %{nil}' --define='_sourcedir rpmbuild/SOURCES' --define='_srcrpmdir .'
# binrpm-pkg # binrpm-pkg
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -15,15 +15,19 @@ if [ "$1" = prebuilt ]; then ...@@ -15,15 +15,19 @@ if [ "$1" = prebuilt ]; then
MAKE="$MAKE -f $srctree/Makefile" MAKE="$MAKE -f $srctree/Makefile"
else else
S= S=
mkdir -p rpmbuild/SOURCES
cp linux.tar.gz rpmbuild/SOURCES
cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config
fi fi
if grep -q CONFIG_MODULES=y .config; then if grep -q CONFIG_MODULES=y include/config/auto.conf; then
M= M=
else else
M=DEL M=DEL
fi fi
if grep -q CONFIG_DRM=y .config; then if grep -q CONFIG_DRM=y include/config/auto.conf; then
PROVIDES=kernel-drm PROVIDES=kernel-drm
fi fi
...@@ -48,7 +52,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF ...@@ -48,7 +52,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
Vendor: The Linux Community Vendor: The Linux Community
URL: https://www.kernel.org URL: https://www.kernel.org
$S Source0: linux.tar.gz $S Source0: linux.tar.gz
$S Source1: .config $S Source1: config
Provides: $PROVIDES Provides: $PROVIDES
$S BuildRequires: bc binutils bison dwarves $S BuildRequires: bc binutils bison dwarves
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
...@@ -85,7 +89,7 @@ $S$M against the $__KERNELRELEASE kernel package. ...@@ -85,7 +89,7 @@ $S$M against the $__KERNELRELEASE kernel package.
$S$M $S$M
$S %prep $S %prep
$S %setup -q -n linux $S %setup -q -n linux
$S cp %{SOURCE1} . $S cp %{SOURCE1} .config
$S $S
$S %build $S %build
$S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release} $S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment