diff options
author | Yoann Congal <yoann.congal@smile.fr> | 2025-08-06 17:55:48 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-07 12:11:16 +0100 |
commit | b4eacbf7c17f1691db6c44b9af4620a085d5394b (patch) | |
tree | 2a574355ca99d1a5eaaa603c312b9dfff8424233 /scripts/runqemu | |
parent | 5de44144cfe551845f66b460733f3328890614da (diff) | |
download | poky-b4eacbf7c17f1691db6c44b9af4620a085d5394b.tar.gz |
runqemu: use "zstd -o" to preserve sparse images
wic images can be sparse. Using "zstd -o" preserves the sparse state of
the image and should decrease decompression time.
Suggested-by: Adrian Freihofer <adrian.freihofer@gmail.com>
(From OE-Core rev: 27d156d85f13131ea4c5d766ddaa2d18b88d7577)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 827300080a..4fb85177e3 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -448,8 +448,7 @@ class BaseConfig(object): | |||
448 | if not shutil.which('zstd'): | 448 | if not shutil.which('zstd'): |
449 | raise RunQemuError(f"'zstd' is required to decompress {self.rootfs} but was not found in PATH") | 449 | raise RunQemuError(f"'zstd' is required to decompress {self.rootfs} but was not found in PATH") |
450 | try: | 450 | try: |
451 | with open(uncompressed_path, 'wb') as out_file: | 451 | subprocess.check_call(['zstd', '-d', image_path, '-o', uncompressed_path]) |
452 | subprocess.check_call(['zstd', '-d', '-c', image_path], stdout=out_file) | ||
453 | except subprocess.CalledProcessError as e: | 452 | except subprocess.CalledProcessError as e: |
454 | self.cleanup_files.append(uncompressed_path) | 453 | self.cleanup_files.append(uncompressed_path) |
455 | raise RunQemuError(f"Failed to decompress {self.rootfs}: {e}") | 454 | raise RunQemuError(f"Failed to decompress {self.rootfs}: {e}") |