[LEDE-DEV,1/2] target/toolchain: Switch to xz compression instead of bz2

Message ID 1504538663-32751-1-git-send-email-koen.vandeputte@ncentric.com
State New
Headers show
Series
  • [LEDE-DEV,1/2] target/toolchain: Switch to xz compression instead of bz2
Related show

Commit Message

Koen Vandeputte Sept. 4, 2017, 3:24 p.m.
Switch to xz compression instead of bz2
This reduces the output size here from 41M to 29M

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
---
 target/toolchain/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Karl Palsson Sept. 5, 2017, 10:39 a.m. | #1
This is going to make builds _much_ slower :( 


Koen Vandeputte <koen.vandeputte@ncentric.com> wrote:
> Switch to xz compression instead of bz2
> This reduces the output size here from 41M to 29M
> 
> Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
> ---
>  target/toolchain/Makefile | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/toolchain/Makefile
> b/target/toolchain/Makefile index ef2dc68..da1a6d2 100644
> --- a/target/toolchain/Makefile
> +++ b/target/toolchain/Makefile
> @@ -26,7 +26,7 @@ all: compile
>  
>  TOOLCHAIN_PREFIX:=$(TOOLCHAIN_BUILD_DIR)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
>  
> -$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
> +$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz: clean
>  	mkdir -p $(TOOLCHAIN_BUILD_DIR)
>  	$(TAR) -cf - -C $(TOPDIR)/staging_dir/  \
>  	       $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
> @@ -59,13 +59,13 @@ $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
>  	find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
>  	mkdir -p $(BIN_DIR)
>  	(cd $(BUILD_DIR); \
> -		tar cfj $@ $(TOOLCHAIN_NAME); \
> +		tar cfJ $@ $(TOOLCHAIN_NAME); \
>  	)
>  
>  download:
>  prepare:
> -compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
> +compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
>  install: compile
>  
>  clean:
> -	rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
> +	rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
Koen Vandeputte Sept. 5, 2017, 12:23 p.m. | #2
On 2017-09-05 12:39, Karl Palsson wrote:
> This is going to make builds _much_ slower :(
>

Hi Karl,

You are right, but the main reasons for this patch were:

- Use same output as ie. target/SDK (cleanup)
- Toolchain build is disabled by default (as is SDK)
- Eventually switch to multithreaded version for XZ  (like your patch [1])



I've done some benchmarks on a machine here (i7 4770K):


tar bz2:    0m19.271s    (now)
tar cfJ:      1m3.384s
xz:            1m19.958s    (patch)
xz - T 0:    0m38.587s    (Future with -T 0 ?)


[1] http://patchwork.ozlabs.org/patch/802620/

Koen

Patch

diff --git a/target/toolchain/Makefile b/target/toolchain/Makefile
index ef2dc68..da1a6d2 100644
--- a/target/toolchain/Makefile
+++ b/target/toolchain/Makefile
@@ -26,7 +26,7 @@  all: compile
 
 TOOLCHAIN_PREFIX:=$(TOOLCHAIN_BUILD_DIR)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
 
-$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
+$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz: clean
 	mkdir -p $(TOOLCHAIN_BUILD_DIR)
 	$(TAR) -cf - -C $(TOPDIR)/staging_dir/  \
 	       $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
@@ -59,13 +59,13 @@  $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
 	find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
 	mkdir -p $(BIN_DIR)
 	(cd $(BUILD_DIR); \
-		tar cfj $@ $(TOOLCHAIN_NAME); \
+		tar cfJ $@ $(TOOLCHAIN_NAME); \
 	)
 
 download:
 prepare:
-compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
+compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
 install: compile
 
 clean:
-	rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
+	rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz