Skip to content

Commit 3c65a27

Browse files
committed
kbuild: do not create intermediate *.tar for tar packages
Commit 05e96e9 ("kbuild: use git-archive for source package creation") split the compression as a separate step to factor out the common build rules. With the previous commit, we got back to the situation where source tarballs are compressed on-the-fly. There is no reason to keep the separate compression rules. Generate the comressed tar packages directly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
1 parent f8d94c4 commit 3c65a27

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

scripts/Makefile.package

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ fi ; \
2727
tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \
2828
--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3)
2929

30-
# tarball compression
31-
# ---------------------------------------------------------------------------
32-
33-
%.tar.gz: %.tar
34-
$(call cmd,gzip)
35-
36-
%.tar.bz2: %.tar
37-
$(call cmd,bzip2)
38-
39-
%.tar.xz: %.tar
40-
$(call cmd,xzmisc)
41-
42-
%.tar.zst: %.tar
43-
$(call cmd,zstd)
44-
4530
# Git
4631
# ---------------------------------------------------------------------------
4732

@@ -154,10 +139,17 @@ tar-install: FORCE
154139
$(Q)$(MAKE) -f $(srctree)/Makefile
155140
+$(Q)$(srctree)/scripts/package/buildtar $@
156141

142+
compress-tar.gz = -I "$(KGZIP)"
143+
compress-tar.bz2 = -I "$(KBZIP2)"
144+
compress-tar.xz = -I "$(XZ)"
145+
compress-tar.zst = -I "$(ZSTD)"
146+
157147
quiet_cmd_tar = TAR $@
158-
cmd_tar = cd $<; tar cf ../$@ --owner=root --group=root --sort=name *
148+
cmd_tar = cd $<; tar cf ../$@ $(compress-tar$(suffix $@)) --owner=root --group=root --sort=name *
149+
150+
dir-tarballs := $(addprefix linux-$(KERNELRELEASE)-$(ARCH), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst)
159151

160-
linux-$(KERNELRELEASE)-$(ARCH).tar: tar-install
152+
$(dir-tarballs): tar-install
161153
$(call cmd,tar)
162154

163155
PHONY += dir-pkg

0 commit comments

Comments
 (0)