All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: <cip-dev@lists.cip-project.org>
Cc: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Subject: [isar-cip-core][PATCH 3/2] swupdate-img: Use pigz where available
Date: Thu, 10 Mar 2022 20:25:53 +0100	[thread overview]
Message-ID: <145c6730-0b18-5e97-42b3-4dde925d7598@siemens.com> (raw)
In-Reply-To: <6e5722e86c9ddf733464c7484158555df707cddc.1646938228.git.jan.kiszka@siemens.com>

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 --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
-- 
2.34.1


  reply	other threads:[~2022-03-10 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 18:50 [isar-cip-core][PATCH 0/2] SWUpdate-related cleanups Jan Kiszka
2022-03-10 18:50 ` [isar-cip-core][PATCH 1/2] Drop redundant SWU_DESCRIPTION_FILE assignment Jan Kiszka
2022-03-10 18:50 ` [isar-cip-core][PATCH 2/2] swupdate-img: Add support for automatically compressing files Jan Kiszka
2022-03-10 19:25   ` Jan Kiszka [this message]
2022-03-11 14:08 ` [isar-cip-core][PATCH 0/2] SWUpdate-related cleanups Gylstorff Quirin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=145c6730-0b18-5e97-42b3-4dde925d7598@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=quirin.gylstorff@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.