diff mbox series

[isar-cip-core,3/2] swupdate-img: Use pigz where available

Message ID 145c6730-0b18-5e97-42b3-4dde925d7598@siemens.com (mailing list archive)
State New
Headers show
Series SWUpdate-related cleanups | expand

Commit Message

Jan Kiszka March 10, 2022, 7:25 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Accelerates the compression by using multiple cores.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 classes/swupdate-img.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/classes/swupdate-img.bbclass b/classes/swupdate-img.bbclass
index 97e833e..1437c07 100644
--- a/classes/swupdate-img.bbclass
+++ b/classes/swupdate-img.bbclass
@@ -33,7 +33,11 @@  do_swupdate_image() {
         for uncompressed in "${WORKDIR}/$basefile" "${DEPLOY_DIR_IMAGE}/$basefile"; do
             if [ -e "$uncompressed" ]; then
                 rm  -f "$uncompressed.gz"
-                gzip "$uncompressed"
+                if [ -x "$(command -v pigz)" ]; then
+                    pigz "$uncompressed"
+                else
+                    gzip "$uncompressed"
+                fi
                 break
             fi
         done