Skip to contentSkip to conversation

kbuild: Add make tarzst-pkg build option

PATCH In review Paweł Jasiak 2 participants 2 messages Oct 8, 2021 – Oct 12, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Add make tarzst-pkg build option

Add tarzst-pkg and perf-tarzst-src-pkg targets to build zstd compressed tarballs.

---
 scripts/Makefile.package | 10 +++++++---
 scripts/package/buildtar |  4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)
scripts/Makefile.package +7 -3
index b74c65284fb2..77b612183c08 100644
@@ -103,7 +103,7 @@ snap-pkg:
 
 # tarball targets
 # ---------------------------------------------------------------------------
-tar-pkgs := dir-pkg tar-pkg targz-pkg tarbz2-pkg tarxz-pkg
+tar-pkgs := dir-pkg tar-pkg targz-pkg tarbz2-pkg tarxz-pkg tarzst-pkg
 PHONY += $(tar-pkgs)
 $(tar-pkgs):
 	$(MAKE) -f $(srctree)/Makefile
@@ -130,10 +130,12 @@ $(if $(findstring tar-src,$@),,                                     \
 $(if $(findstring bz2,$@),$(KBZIP2),                                 \
 $(if $(findstring gz,$@),$(KGZIP),                                  \
 $(if $(findstring xz,$@),$(XZ),                                     \
-$(error unknown target $@))))                                       \
+$(if $(findstring zst,$@),$(ZSTD),                                  \
+$(error unknown target $@)))))                                      \
 	-f -9 $(perf-tar).tar)
 
-perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg perf-tarxz-src-pkg
+perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg \
+		 perf-tarxz-src-pkg perf-tarzst-src-pkg
 PHONY += $(perf-tar-pkgs)
 $(perf-tar-pkgs):
 	$(call cmd,perf_tar)
@@ -153,9 +155,11 @@ help:
 	@echo '  targz-pkg           - Build the kernel as a gzip compressed tarball'
 	@echo '  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball'
 	@echo '  tarxz-pkg           - Build the kernel as a xz compressed tarball'
+	@echo '  tarzst-pkg          - Build the kernel as a zstd compressed tarball'
 	@echo '  perf-tar-src-pkg    - Build $(perf-tar).tar source tarball'
 	@echo '  perf-targz-src-pkg  - Build $(perf-tar).tar.gz source tarball'
 	@echo '  perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
 	@echo '  perf-tarxz-src-pkg  - Build $(perf-tar).tar.xz source tarball'
+	@echo '  perf-tarzst-src-pkg - Build $(perf-tar).tar.zst source tarball'
 
 .PHONY: $(PHONY)
scripts/package/buildtar +4 -0
index 221aa7df008d..cb54c7f1aa80 100755
@@ -39,6 +39,10 @@ case "${1}" in
 		opts="-I ${XZ}"
 		tarball=${tarball}.xz
 		;;
+	tarzst-pkg)
+		opts="-I ${ZSTD}"
+		tarball=${tarball}.zst
+		;;
 	*)
 		echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2
 		exit 1
Signature · 1 line
2.33.0
#1 lore raw
Quoted 5 lines · Paweł Jasiak

Add tarzst-pkg and perf-tarzst-src-pkg targets to build zstd compressed tarballs.

Applied to linux-kbuild. Thanks.

Quoted 63 lines
---
 scripts/Makefile.package | 10 +++++++---
 scripts/package/buildtar |  4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)
scripts/Makefile.package +7 -3
index b74c65284fb2..77b612183c08 100644
@@ -103,7 +103,7 @@ snap-pkg:
 
 # tarball targets
 # ---------------------------------------------------------------------------
-tar-pkgs := dir-pkg tar-pkg targz-pkg tarbz2-pkg tarxz-pkg
+tar-pkgs := dir-pkg tar-pkg targz-pkg tarbz2-pkg tarxz-pkg tarzst-pkg
 PHONY += $(tar-pkgs)
 $(tar-pkgs):
        $(MAKE) -f $(srctree)/Makefile
@@ -130,10 +130,12 @@ $(if $(findstring tar-src,$@),,                                     \
 $(if $(findstring bz2,$@),$(KBZIP2),                                 \
 $(if $(findstring gz,$@),$(KGZIP),                                  \
 $(if $(findstring xz,$@),$(XZ),                                     \
-$(error unknown target $@))))                                       \
+$(if $(findstring zst,$@),$(ZSTD),                                  \
+$(error unknown target $@)))))                                      \
        -f -9 $(perf-tar).tar)
 
-perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg perf-tarxz-src-pkg
+perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg \
+                perf-tarxz-src-pkg perf-tarzst-src-pkg
 PHONY += $(perf-tar-pkgs)
 $(perf-tar-pkgs):
        $(call cmd,perf_tar)
@@ -153,9 +155,11 @@ help:
        @echo '  targz-pkg           - Build the kernel as a gzip compressed tarball'
        @echo '  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball'
        @echo '  tarxz-pkg           - Build the kernel as a xz compressed tarball'
+       @echo '  tarzst-pkg          - Build the kernel as a zstd compressed tarball'
        @echo '  perf-tar-src-pkg    - Build $(perf-tar).tar source tarball'
        @echo '  perf-targz-src-pkg  - Build $(perf-tar).tar.gz source tarball'
        @echo '  perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
        @echo '  perf-tarxz-src-pkg  - Build $(perf-tar).tar.xz source tarball'
+       @echo '  perf-tarzst-src-pkg - Build $(perf-tar).tar.zst source tarball'
 
 .PHONY: $(PHONY)
scripts/package/buildtar +4 -1
index 221aa7df008d..cb54c7f1aa80 100755
@@ -39,6 +39,10 @@ case "${1}" in
                opts="-I ${XZ}"
                tarball=${tarball}.xz
                ;;
+       tarzst-pkg)
+               opts="-I ${ZSTD}"
+               tarball=${tarball}.zst
+               ;;
        *)
                echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2
                exit 1
--

2.33.0

Signature · 2 lines
Best Regards
Masahiro Yamada