[OpenWrt-Devel] [PATCH v2 4/4] build: use zstd for SDK and ImageBuilder tarballs
Matthias Schiffer
mschiffer at universe-factory.net
Fri May 29 15:18:42 EDT 2020
On 5/17/20 1:51 PM, Matthias Schiffer wrote:
> Comression level -19 was chosen as it provides a very good tradeoff
> between compression ratio and performance, especially in multithreaded
> operation.
>
> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
Jow, do you have any opinion on this? I assume this will also require
changes to the phase2 builtbot config - at least the SDK download pattern,
and installation of zstd in the build environment. Anything else?
> ---
> target/imagebuilder/Makefile | 8 ++++----
> target/sdk/Makefile | 8 ++++----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
> index b463feb456ee..5c09109150a8 100644
> --- a/target/imagebuilder/Makefile
> +++ b/target/imagebuilder/Makefile
> @@ -21,7 +21,7 @@ IB_IDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(STAGING_DIR_IMAGE))
>
> all: compile
>
> -$(BIN_DIR)/$(IB_NAME).tar.xz: clean
> +$(BIN_DIR)/$(IB_NAME).tar.zst: clean
> rm -rf $(PKG_BUILD_DIR)
> mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
> $(PKG_BUILD_DIR)/target $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
> @@ -86,12 +86,12 @@ endif
> (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \
> $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host)
> STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
> - $(TAR) -cf - -C $(BUILD_DIR) $(IB_NAME) | xz -T$(if $(filter 1,$(NPROC)),2,0) -zc -7e > $@
> + $(TAR) -cf - -C $(BUILD_DIR) $(IB_NAME) | zstd -T0 -19 -f -o $@
>
> download:
> prepare:
> -compile: $(BIN_DIR)/$(IB_NAME).tar.xz
> +compile: $(BIN_DIR)/$(IB_NAME).tar.zst
> install: compile
>
> clean: FORCE
> - rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.xz
> + rm -rf $(PKG_BUILD_DIR) $(BIN_DIR)/$(IB_NAME).tar.zst
> diff --git a/target/sdk/Makefile b/target/sdk/Makefile
> index 6d818347204a..13389c849958 100644
> --- a/target/sdk/Makefile
> +++ b/target/sdk/Makefile
> @@ -81,7 +81,7 @@ KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(
>
> all: compile
>
> -$(BIN_DIR)/$(SDK_NAME).tar.xz: clean
> +$(BIN_DIR)/$(SDK_NAME).tar.zst: clean
> mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/package
> $(CP) -L $(INCLUDE_DIR) $(SCRIPT_DIR) $(SDK_BUILD_DIR)/
> $(TAR) -cf - -C $(TOPDIR) \
> @@ -156,13 +156,13 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
> find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf
> -make -C $(SDK_BUILD_DIR)/scripts/config clean
> (cd $(BUILD_DIR); \
> - tar -I 'xz -7e' -cf $@ $(SDK_NAME); \
> + tar -I 'zstd -T0 -19' -cf $@ $(SDK_NAME); \
> )
>
> download:
> prepare:
> -compile: $(BIN_DIR)/$(SDK_NAME).tar.xz
> +compile: $(BIN_DIR)/$(SDK_NAME).tar.zst
> install: compile
>
> clean:
> - rm -rf $(SDK_BUILD_DIR) $(BIN_DIR)/$(SDK_NAME).tar.xz
> + rm -rf $(SDK_BUILD_DIR) $(BIN_DIR)/$(SDK_NAME).tar.zst
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200529/0c770b96/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list