diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-20 10:25:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-24 11:52:27 +0100 |
commit | 9928614e9437a49cbff4a36baa1e1cca3becb754 (patch) | |
tree | 4176f685fd719965b9f3e1b3719934e8c5e007a9 | |
parent | e1ba46109ea4be3d3b310abaf7f2da3c84a83930 (diff) | |
download | poky-9928614e9437a49cbff4a36baa1e1cca3becb754.tar.gz |
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.
(From OE-Core rev: 2de56aa0792ec93445130d801936a8ea643fad27)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/sstate.bbclass | 11 | ||||
-rw-r--r-- | 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 5a0722567a..350d3107f5 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -715,17 +715,24 @@ sstate_task_postfunc[dirs] = "${WORKDIR}" | |||
715 | # | 715 | # |
716 | sstate_create_package () { | 716 | sstate_create_package () { |
717 | TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX` | 717 | TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX` |
718 | |||
719 | # Use pigz if available | ||
720 | OPT="-cz" | ||
721 | if [ -x "$(command -v pigz)" ]; then | ||
722 | OPT="-I pigz -c" | ||
723 | fi | ||
724 | |||
718 | # Need to handle empty directories | 725 | # Need to handle empty directories |
719 | if [ "$(ls -A)" ]; then | 726 | if [ "$(ls -A)" ]; then |
720 | set +e | 727 | set +e |
721 | tar -czf $TFILE * | 728 | tar $OPT -f $TFILE * |
722 | ret=$? | 729 | ret=$? |
723 | if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then | 730 | if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then |
724 | exit 1 | 731 | exit 1 |
725 | fi | 732 | fi |
726 | set -e | 733 | set -e |
727 | else | 734 | else |
728 | tar -cz --file=$TFILE --files-from=/dev/null | 735 | tar $OPT --file=$TFILE --files-from=/dev/null |
729 | fi | 736 | fi |
730 | chmod 0664 $TFILE | 737 | chmod 0664 $TFILE |
731 | mv -f $TFILE ${SSTATE_PKG} | 738 | mv -f $TFILE ${SSTATE_PKG} |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 8f73854599..e28f3c7311 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -490,7 +490,7 @@ HOSTTOOLS += " \ | |||
490 | 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 ''}" | 490 | 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 ''}" |
491 | 491 | ||
492 | # Link to these if present | 492 | # Link to these if present |
493 | HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat ssh sudo" | 493 | HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo" |
494 | 494 | ||
495 | # Temporary add few more detected in bitbake world | 495 | # Temporary add few more detected in bitbake world |
496 | HOSTTOOLS_NONFATAL += "join nl size yes zcat" | 496 | HOSTTOOLS_NONFATAL += "join nl size yes zcat" |