Add a script to unpack build .zip files
Change-Id: Icf62c34e2f9b0a99a95496281ce2fd190681f2cf
(cherry picked from commit 4a6e422edb37da5fbd3bf41db10853c9b0c565d4)
diff --git a/deploy/install_zip.sh b/deploy/install_zip.sh
new file mode 100755
index 0000000..bd5e1dd
--- /dev/null
+++ b/deploy/install_zip.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Installs an Android zip file to a directory
+
+usage() {
+ echo cat build.zip \| $0 "\${dir}"
+ echo or
+ echo $0 build-zip "\${dir}"
+}
+
+case $# in
+ 1)
+ mkdir -p "$1"
+ bsdtar -x -C "$1" -f -
+ unpack_boot_image.py --boot_img "$1/boot.img" --dest "$1"
+ ;;
+ 2)
+ mkdir -p "$2"
+ bsdtar -x -C "$2" -f "$1"
+ unpack_boot_image.py --boot_img "$2/boot.img" --dest "$2"
+ ;;
+ *)
+ usage
+ exit 2
+ ;;
+esac