Skip to content

Commit

Permalink
rpm-pkg: Do not package the whole source directory
Browse files Browse the repository at this point in the history
The source tree can contain lots of uninteresting data like tag or
cscope files, packaging which slows down make rpm needlessly. It can
also break the build, if the tree contains an unrelated file named
*.spec. The downside of this change is that new subdirectories have to
be added to the KBUILD_ALLDIRS variable in the top-level Makefile. The
upside is that the behavior is more predictable.

Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
michal42 committed Apr 18, 2013
1 parent 6bc6c94 commit 6615d6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,8 @@ export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
export LDFLAGS_vmlinux
# used by scripts/pacmage/Makefile
export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools virt)

vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN)

Expand Down
6 changes: 5 additions & 1 deletion scripts/package/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \

# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
# Include only those top-level files that are needed by make, plus the GPL copy
TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \
Kbuild Kconfig COPYING $(wildcard localversion*)
TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT))
MKSPEC := $(srctree)/scripts/package/mkspec
PREV := set -e; cd -P ..;

Expand All @@ -45,7 +49,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE
$(MAKE) clean
$(PREV) ln -sf $(srctree) $(KERNELPATH)
$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT)
$(PREV) rm $(KERNELPATH)
rm -f $(objtree)/.scmversion
set -e; \
Expand Down

0 comments on commit 6615d6c

Please sign in to comment.