Skip to content

Commit 9e15887

Browse files
committed
make_image: Use pigz to speed up compression
1 parent b9faed4 commit 9e15887

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dependencies/penguin.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ wget
2424
clang-11
2525
lld-11
2626
zlib1g
27+
pigz

src/penguin/gen_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def make_image(fs, out, artifacts, proj_dir, config_path):
535535
MODIFIED_TARBALL = Path(ARTIFACTS, f"fs_out_{suffix}.tar")
536536
config = load_config(proj_dir, config_path)
537537
with tempfile.TemporaryDirectory() as TMP_DIR:
538-
contents = check_output(["tar", "xvpsf", IN_TARBALL, "-C", TMP_DIR]).splitlines()
538+
contents = check_output(["tar", "-x", "--use-compress-program=pigz", "-vpf", IN_TARBALL, "-C", TMP_DIR]).splitlines()
539539
# Gracefully handle emptyfs
540540
if contents and contents[0] != b"./":
541541
logger.warning("Filesystem tar does not have a leading ./")
@@ -545,7 +545,7 @@ def make_image(fs, out, artifacts, proj_dir, config_path):
545545

546546
prep_config(config)
547547
fs_make_config_changes(TMP_DIR, config, project_dir)
548-
check_output(["tar", "czpf", MODIFIED_TARBALL, "-C", TMP_DIR, "."])
548+
check_output(["tar", "-c", "--use-compress-program=pigz", "-pf", MODIFIED_TARBALL, "-C", TMP_DIR, "."])
549549
TARBALL = MODIFIED_TARBALL
550550
else:
551551
delete_tar = False

0 commit comments

Comments
 (0)