build: use zstd for IB, toolchain, SDK and LLVM compression

Use similar efficient but faster compression algorithm.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren 2024-02-13 01:03:44 +01:00 committed by Christian Marangi
parent 98235e60ed
commit 2496f436a8
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
4 changed files with 16 additions and 14 deletions

View File

@ -24,7 +24,7 @@ BUNDLER_COMMAND := PATH=$(BUNDLER_PATH) $(XARGS) $(SCRIPT_DIR)/bundle-libraries.
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/linux $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
@ -118,15 +118,16 @@ endif
$(BUNDLER_COMMAND))
$(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib
STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
(cd $(BUILD_DIR); \
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \
tar -I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' -cf $@ $(IB_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
)
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

View File

@ -12,11 +12,11 @@ override MAKEFLAGS=
LLVM_VERSION := $(shell cat $(STAGING_DIR_HOST)/llvm-bpf/.llvm-version)
LLVM_BPF_PREFIX := llvm-bpf-$(LLVM_VERSION).$(HOST_OS)-$(HOST_ARCH)
LLVM_TAR := $(BIN_DIR)/$(LLVM_BPF_PREFIX).tar.xz
LLVM_TAR := $(BIN_DIR)/$(LLVM_BPF_PREFIX).tar.zst
$(LLVM_TAR): $(STAGING_DIR_HOST)/llvm-bpf/.llvm-version
tar -C $(STAGING_DIR_HOST) \
-I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' \
-I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
-cf $@.tmp llvm-bpf $(LLVM_BPF_PREFIX)
mv $@.tmp $@

View File

@ -101,7 +101,7 @@ USERSPACE_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 \
@ -181,15 +181,16 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
find $(SDK_BUILD_DIR) -name .svn | $(XARGS) rm -rf
find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf
-make -C $(SDK_BUILD_DIR)/scripts/config clean
(cd $(BUILD_DIR); \
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(SDK_NAME) \
tar -I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' -cf $@ $(SDK_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
)
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

View File

@ -26,7 +26,7 @@ all: compile
TOOLCHAIN_PREFIX:=$(TOOLCHAIN_BUILD_DIR)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz: clean
$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst: clean
mkdir -p $(TOOLCHAIN_BUILD_DIR)
$(TAR) -cf - -C $(TOPDIR)/staging_dir/ \
$(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
@ -62,14 +62,14 @@ $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz: clean
find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
mkdir -p $(BIN_DIR)
(cd $(BUILD_DIR); \
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(TOOLCHAIN_NAME) \
tar -I '$(STAGING_DIR_HOST)/bin/zstd -T0 --ultra -20' -cf $@ $(TOOLCHAIN_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
)
download:
prepare:
compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst
install: compile
clean:
rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.zst