1#!/system/bin/sh 2 3set -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 10spath=$( cd "$(dirname "$0")" ; pwd -P ) 11 12if [ ! -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 16fi 17 18if [ -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 22fi 23 24 25tar -zxf /data/androdeb/deb.tar.gz -C /data/androdeb/ || die 2 "Couldn't unpack due to tar -x errors" 26rm /data/androdeb/deb.tar.gz 27 28echo "Unpack of rootfs successful!" 29