1 #!/system/bin/sh 2 3 set -e 4 5 # Script to do unpack of rootfs, ensures proper tear down 6 # of existing environment. Expects debian rootfs in 7 # /data/deb.tar.gz which it will delete after successful 8 # unpack of rootfs. 9 10 spath=$( cd "$(dirname "$0")" ; pwd -P ) 11 12 if [ ! -f /data/androdeb/deb.tar.gz ]; then 13 echo "Debian rootfs tar doesn't existing at /data/deb.tar.gz" 14 echo "Run androdeb with device connected first" 15 exit 1 16 fi 17 18 if [ -d /data/androdeb/debian ]; then 19 echo "androdeb environment already exists, doing a tear down" 20 /data/androdeb/device-umount-all 21 rm -rf /data/androdeb/debian 22 fi 23 24 25 tar -zxf /data/androdeb/deb.tar.gz -C /data/androdeb/ || die 2 "Couldn't unpack due to tar -x errors" 26 rm /data/androdeb/deb.tar.gz 27 28 echo "Unpack of rootfs successful!" 29