Skip to content

Commit 81f59a2

Browse files
committed
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 <[email protected]>
1 parent 36862e1 commit 81f59a2

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ modules.order
7878
# RPM spec file (make rpm-pkg)
7979
#
8080
/*.spec
81+
/rpmbuild/
8182

8283
#
8384
# Debian directory (make deb-pkg)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ MRPROPER_FILES += include/config include/generated \
16051605
certs/signing_key.pem \
16061606
certs/x509.genkey \
16071607
vmlinux-gdb.py \
1608-
*.spec \
1608+
*.spec rpmbuild \
16091609
rust/libmacros.so
16101610

16111611
# clean - Delete most, but leave enough to build external modules

scripts/Makefile.package

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PHONY += srcrpm-pkg
8989
srcrpm-pkg: linux.tar.gz
9090
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
9191
+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 .'
9393

9494
# binrpm-pkg
9595
# ---------------------------------------------------------------------------

scripts/package/mkspec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ if [ "$1" = prebuilt ]; then
1515
MAKE="$MAKE -f $srctree/Makefile"
1616
else
1717
S=
18+
19+
mkdir -p rpmbuild/SOURCES
20+
cp linux.tar.gz rpmbuild/SOURCES
21+
cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config
1822
fi
1923

20-
if grep -q CONFIG_MODULES=y .config; then
24+
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
2125
M=
2226
else
2327
M=DEL
2428
fi
2529

26-
if grep -q CONFIG_DRM=y .config; then
30+
if grep -q CONFIG_DRM=y include/config/auto.conf; then
2731
PROVIDES=kernel-drm
2832
fi
2933

@@ -48,7 +52,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
4852
Vendor: The Linux Community
4953
URL: https://www.kernel.org
5054
$S Source0: linux.tar.gz
51-
$S Source1: .config
55+
$S Source1: config
5256
Provides: $PROVIDES
5357
$S BuildRequires: bc binutils bison dwarves
5458
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
@@ -85,7 +89,7 @@ $S$M against the $__KERNELRELEASE kernel package.
8589
$S$M
8690
$S %prep
8791
$S %setup -q -n linux
88-
$S cp %{SOURCE1} .
92+
$S cp %{SOURCE1} .config
8993
$S
9094
$S %build
9195
$S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}

0 commit comments

Comments
 (0)