summaryrefslogtreecommitdiff
path: root/scripts/Makefile.package
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-02-15 10:20:26 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-02-26 15:18:47 +0900
commit6fc91752d7c4706f1036838544b1ef5d9f41c058 (patch)
tree1bb3b1ec73c3384965f94c7ac0dc5e3534b8c1fc /scripts/Makefile.package
parent1ec9bb704faf50c48727b5daa33bc42e7334db60 (diff)
kbuild: srcrpm-pkg: create source package without cleaning
If you run 'make (src)rpm-pkg', all objects are lost due to 'make clean', which makes the incremental builds impossible. Instead of cleaning, pass the exclude list to tar's --exclude-from option. Previously, the .config was contained in the source tarball. With this commit, the source rpm consists of separate linux.tar.gz and .config. Remove stale comments. Now, 'make (src)rpm-pkg' works with O= option. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.package')
-rw-r--r--scripts/Makefile.package32
1 files changed, 4 insertions, 28 deletions
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 55441d776d70..7266a11855f4 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -3,27 +3,6 @@
include $(srctree)/scripts/Kbuild.include
-# RPM target
-# ---------------------------------------------------------------------------
-# The rpm target generates two rpm files:
-# /usr/src/packages/SRPMS/kernel-2.6.7rc2-1.src.rpm
-# /usr/src/packages/RPMS/i386/kernel-2.6.7rc2-1.<arch>.rpm
-# The src.rpm files includes all source for the kernel being built
-# The <arch>.rpm includes kernel configuration, modules etc.
-#
-# Process to create the rpm files
-# a) clean the kernel
-# b) Generate .spec file
-# c) Build a tar ball, using symlink to make kernel version
-# first entry in the path
-# d) and pack the result to a tar.gz file
-# e) generate the rpm files, based on kernel.spec
-# - Use /. to avoid tar packing just the symlink
-
-# Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT,
-# but the binrpm-pkg target can; for some reason O= gets ignored.
-
-# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
KDEB_SOURCENAME ?= linux-upstream
KBUILD_PKG_ROOTCMD ?="fakeroot -u"
@@ -42,8 +21,7 @@ if test "$(objtree)" != "$(srctree)"; then \
echo >&2; \
echo >&2 " ERROR:"; \
echo >&2 " Building source tarball is not possible outside the"; \
- echo >&2 " kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
- echo >&2 " binrpm-pkg target instead."; \
+ echo >&2 " kernel source tree. Don't set KBUILD_OUTPUT"; \
echo >&2; \
false; \
fi ; \
@@ -95,12 +73,10 @@ rpm-pkg: srcrpm-pkg
# srcrpm-pkg
# ---------------------------------------------------------------------------
PHONY += srcrpm-pkg
-srcrpm-pkg:
- $(MAKE) clean
+srcrpm-pkg: linux.tar.gz
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
- $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
- +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ts $(KERNELPATH).tar.gz \
- --define='_smp_mflags %{nil}' --define='_srcrpmdir $(srctree)'
+ +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \
+ --define='_smp_mflags %{nil}' --define='_sourcedir .' --define='_srcrpmdir .'
# binrpm-pkg
# ---------------------------------------------------------------------------