Skip to content

Commit ef6609a

Browse files
committed
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 <[email protected]>
1 parent b28d6ca commit ef6609a

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,6 @@ export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL KBUILD_RUSTFLAGS_KERNEL
609609
export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
610610
-name CVS -o -name .pc -o -name .hg -o -name .git \) \
611611
-prune -o
612-
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
613-
--exclude CVS --exclude .pc --exclude .hg --exclude .git
614612

615613
# ===========================================================================
616614
# Rules shared between *config targets and build targets

scripts/Makefile.package

+1-23
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@
44
include $(srctree)/scripts/Kbuild.include
55
include $(srctree)/scripts/Makefile.lib
66

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-
287
# Git
298
# ---------------------------------------------------------------------------
309

@@ -157,9 +136,8 @@ snap-pkg:
157136
rm -rf $(objtree)/snap
158137
mkdir $(objtree)/snap
159138
$(MAKE) clean
160-
$(call cmd,src_tar,$(KERNELPATH))
161139
sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \
162-
s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \
140+
s@SRCTREE@$(abs_srctree)@" \
163141
$(srctree)/scripts/package/snapcraft.template > \
164142
$(objtree)/snap/snapcraft.yaml
165143
cd $(objtree)/snap && \

scripts/package/snapcraft.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ parts:
1010
kernel:
1111
plugin: kernel
1212
source: SRCTREE
13-
source-type: tar
13+
source-type: local
1414
kernel-with-firmware: false

0 commit comments

Comments
 (0)