From: Denys Dmytriyenko <[email protected]>

xz provides much better compression ratio (~40% smaller) and supports
multi-threading when compressing.

Signed-off-by: Denys Dmytriyenko <[email protected]>
---
 .../recipes-core/meta/meta-toolchain-arago.bb              | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb 
b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb
index 014bc76..8457d6d 100644
--- a/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb
+++ b/meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb
@@ -10,7 +10,11 @@ inherit toolchain-scripts
 
 require recipes-core/meta/meta-toolchain.bb
 
-PR = "r32"
+PR = "r33"
+
+XZ_COMPRESSION_LEVEL ?= "-e -6"
+XZ_INTEGRITY_CHECK ?= "crc32"
+XZ_THREADS ?= "-T 0"
 
 # This function creates an environment-setup-script for use in a deployable SDK
 toolchain_create_sdk_env_script () {
@@ -142,7 +146,7 @@ fakeroot tar_sdk() {
        # Package it up
        mkdir -p ${SDK_DEPLOY}
        cd ${SDK_OUTPUT}/${SDKPATH}
-       tar --owner=root --group=root -cj 
--file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+       tar --owner=root --group=root -c . | xz -f -k -c 
${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} - > 
${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
 }
 
 fakeroot create_shar() {
@@ -269,7 +273,7 @@ fi
 payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
 
 printf "Extracting SDK..."
-tail -n +$payload_offset $0| $SUDO_EXEC tar xj -C $target_sdk_dir
+tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir
 echo "done"
 
 printf "Setting it up..."
@@ -335,8 +339,8 @@ exit 0
 MARKER:
 EOF
        # append the SDK tarball
-       cat ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 >> 
${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+       cat ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz >> 
${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
 
        # delete the old tarball, we don't need it anymore
-       rm ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2
+       rm ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
 }
-- 
2.7.4

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to