[oe-commits] [openembedded-core] 30/34: sstate/bitbake.conf: Use pigz if available

git at git.openembedded.org git at git.openembedded.org
Tue Jul 24 10:54:22 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 2de56aa0792ec93445130d801936a8ea643fad27
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jul 20 10:25:17 2018 +0000

    sstate/bitbake.conf: Use pigz if available
    
    Currently the compression of sstate objects is single threaded. In the case
    of ltp, this takes around 33s. If we add pigz into the list of non-fatal
    HOSTTOOLS and then use if it available when building the sstate object,
    this time drops to around 6s.
    
    Since pigz is now widely available this is an optimisation we should
    utilise.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 11 +++++++++--
 meta/conf/bitbake.conf      |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 5a07225..350d310 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -715,17 +715,24 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
 #
 sstate_create_package () {
 	TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
+
+        # Use pigz if available
+        OPT="-cz"
+        if [ -x "$(command -v pigz)" ]; then
+            OPT="-I pigz -c"
+        fi
+
 	# Need to handle empty directories
 	if [ "$(ls -A)" ]; then
 		set +e
-		tar -czf $TFILE *
+		tar $OPT -f $TFILE *
 		ret=$?
 		if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then
 			exit 1
 		fi
 		set -e
 	else
-		tar -cz --file=$TFILE --files-from=/dev/null
+		tar $OPT --file=$TFILE --files-from=/dev/null
 	fi
 	chmod 0664 $TFILE
 	mv -f $TFILE ${SSTATE_PKG}
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 8f73854..e28f3c7 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -490,7 +490,7 @@ HOSTTOOLS += " \
 HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"])) else ''}"
 
 # Link to these if present
-HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat ssh sudo"
+HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
 
 # Temporary add few more detected in bitbake world
 HOSTTOOLS_NONFATAL += "join nl size yes zcat"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list