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

kbuild: remove the last use of old cmd_src_tar rule in packaging

The rpm-pkg and deb-pkg targets have transitioned to using 'git archive'
for tarball creation.

Although the old cmd_src_tar is still used by snap-pkg, there is no need
to pack and unpack a tarball solely for passing the source to snapcraft.

Instead, you can use 'source-type: local' to tell the source location to
snapcraft.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+2 -26
-2
Makefile
··· 609 609 export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ 610 610 -name CVS -o -name .pc -o -name .hg -o -name .git \) \ 611 611 -prune -o 612 - export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ 613 - --exclude CVS --exclude .pc --exclude .hg --exclude .git 614 612 615 613 # =========================================================================== 616 614 # Rules shared between *config targets and build targets
+1 -23
scripts/Makefile.package
··· 4 4 include $(srctree)/scripts/Kbuild.include 5 5 include $(srctree)/scripts/Makefile.lib 6 6 7 - KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) 8 - # Include only those top-level files that are needed by make, plus the GPL copy 9 - TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \ 10 - include init io_uring ipc kernel lib mm net rust \ 11 - samples scripts security sound tools usr virt \ 12 - .config Makefile \ 13 - Kbuild Kconfig COPYING $(wildcard localversion*) 14 - 15 - quiet_cmd_src_tar = TAR $(2).tar.gz 16 - cmd_src_tar = \ 17 - if test "$(objtree)" != "$(srctree)"; then \ 18 - echo >&2; \ 19 - echo >&2 " ERROR:"; \ 20 - echo >&2 " Building source tarball is not possible outside the"; \ 21 - echo >&2 " kernel source tree. Don't set KBUILD_OUTPUT"; \ 22 - echo >&2; \ 23 - false; \ 24 - fi ; \ 25 - tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \ 26 - --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3) 27 - 28 7 # Git 29 8 # --------------------------------------------------------------------------- 30 9 ··· 136 157 rm -rf $(objtree)/snap 137 158 mkdir $(objtree)/snap 138 159 $(MAKE) clean 139 - $(call cmd,src_tar,$(KERNELPATH)) 140 160 sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ 141 - s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \ 161 + s@SRCTREE@$(abs_srctree)@" \ 142 162 $(srctree)/scripts/package/snapcraft.template > \ 143 163 $(objtree)/snap/snapcraft.yaml 144 164 cd $(objtree)/snap && \
+1 -1
scripts/package/snapcraft.template
··· 10 10 kernel: 11 11 plugin: kernel 12 12 source: SRCTREE 13 - source-type: tar 13 + source-type: local 14 14 kernel-with-firmware: false