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.

TEST=creating new chroot still works

Change-Id: I25b1a867f4663dd6faea97ab849dc19906eecf12
Commit-Ready: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: LaMont Jones <>
diff --git a/sdk_lib/ b/sdk_lib/
index 22f8608..0239273 100755
--- a/sdk_lib/
+++ b/sdk_lib/
@@ -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}" ;;
-  ${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