Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+11 -6
+1
.gitignore
··· 78 78 # RPM spec file (make rpm-pkg) 79 79 # 80 80 /*.spec 81 + /rpmbuild/ 81 82 82 83 # 83 84 # Debian directory (make deb-pkg)
+1 -1
Makefile
··· 1605 1605 certs/signing_key.pem \ 1606 1606 certs/x509.genkey \ 1607 1607 vmlinux-gdb.py \ 1608 - *.spec \ 1608 + *.spec rpmbuild \ 1609 1609 rust/libmacros.so 1610 1610 1611 1611 # clean - Delete most, but leave enough to build external modules
+1 -1
scripts/Makefile.package
··· 89 89 srcrpm-pkg: linux.tar.gz 90 90 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 91 91 +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \ 92 - --define='_smp_mflags %{nil}' --define='_sourcedir .' --define='_srcrpmdir .' 92 + --define='_smp_mflags %{nil}' --define='_sourcedir rpmbuild/SOURCES' --define='_srcrpmdir .' 93 93 94 94 # binrpm-pkg 95 95 # ---------------------------------------------------------------------------
+8 -4
scripts/package/mkspec
··· 15 15 MAKE="$MAKE -f $srctree/Makefile" 16 16 else 17 17 S= 18 + 19 + mkdir -p rpmbuild/SOURCES 20 + cp linux.tar.gz rpmbuild/SOURCES 21 + cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config 18 22 fi 19 23 20 - if grep -q CONFIG_MODULES=y .config; then 24 + if grep -q CONFIG_MODULES=y include/config/auto.conf; then 21 25 M= 22 26 else 23 27 M=DEL 24 28 fi 25 29 26 - if grep -q CONFIG_DRM=y .config; then 30 + if grep -q CONFIG_DRM=y include/config/auto.conf; then 27 31 PROVIDES=kernel-drm 28 32 fi 29 33 ··· 52 48 Vendor: The Linux Community 53 49 URL: https://www.kernel.org 54 50 $S Source0: linux.tar.gz 55 - $S Source1: .config 51 + $S Source1: config 56 52 Provides: $PROVIDES 57 53 $S BuildRequires: bc binutils bison dwarves 58 54 $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex ··· 89 85 $S$M 90 86 $S %prep 91 87 $S %setup -q -n linux 92 - $S cp %{SOURCE1} . 88 + $S cp %{SOURCE1} .config 93 89 $S 94 90 $S %build 95 91 $S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}