make_chroot: support pixz for decompression
For a speed up on decompression, use pixz when available. We need to
tweak the decompression command slightly to workaround misbehavior --
it will try to decompress the file in place instead of stdout.
BUG=chromium:906289
TEST=creating new chroot still works
Change-Id: I25b1a867f4663dd6faea97ab849dc19906eecf12
Reviewed-on: https://chromium-review.googlesource.com/1387714
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh
index 22f8608..0239273 100755
--- a/sdk_lib/make_chroot.sh
+++ b/sdk_lib/make_chroot.sh
@@ -344,10 +344,10 @@
local decompress
case "${tarball_path}" in
*.tbz2|*.tar.bz2) decompress=$(type -p pbzip2 || echo bzip2) ;;
- *.tar.xz) decompress="xz" ;;
+ *.tar.xz) decompress=$(type -p pixz || echo xz) ;;
*) die "Unknown tarball compression: ${tarball_path}" ;;
esac
- ${decompress} -dc "${tarball_path}" | tar -xp -C "${dest_dir}"
+ ${decompress} -dc <"${tarball_path}" | tar -xp -C "${dest_dir}"
}
# Find a usable VG name for a given path and device. If there is an existing