summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-20 10:25:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-24 11:52:07 +0100
commit2de56aa0792ec93445130d801936a8ea643fad27 (patch)
tree439e80e8056f132f7ffd6e311bcfdfcf1a1a531f /meta/classes/sstate.bbclass
parentbbe0d3e26484f3f347262d40a8a9d415ce21fb43 (diff)
downloadopenembedded-core-contrib-2de56aa0792ec93445130d801936a8ea643fad27.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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass11
1 files changed, 9 insertions, 2 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}"
#
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}