blob: ae8e0f332333b93aa250deec6b5862e0397438ee [file] [log] [blame]
Joel Fernandes6c1ca312018-03-30 17:13:15 -07001#!/bin/bash -e
Joel Fernandesefe6c4c2018-04-01 21:24:02 -07002#
Joel Fernandes1ed30d72018-05-18 14:08:20 -07003# (c) Joel Fernandes <joel@joelfernandes.org>
Joel Fernandesefe6c4c2018-04-01 21:24:02 -07004
Joel Fernandes5ac823f2018-07-08 14:04:31 -07005VERSION=v0.99e
Joel Fernandesa67be0b2018-04-01 13:40:34 -07006
Joel Fernandes464193e2018-04-02 23:54:49 -07007spath="$(dirname "$(readlink -f "$0")")"
8# spath=$( cd "$(dirname "$0")" ; pwd -P )
Joel Fernandes4fb97ea2018-03-31 11:15:19 -07009curdir=$( pwd -P )
Joel Fernandes4e19ccd2018-07-08 17:23:07 -070010source $spath/utils/support
Joel Fernandesca8fb552018-04-01 13:48:16 -070011source $spath/utils/banners
Joel Fernandes83676b12018-03-30 23:33:47 -070012
Joel Fernandes07529ac2018-07-08 19:24:35 -070013box_out "androdeb: $VERSION"
14
Joel Fernandes6c1ca312018-03-30 17:13:15 -070015# Set default vars
Joel Fernandesf0c54092018-04-01 19:05:10 -070016DISTRO=buster; ARCH=arm64
Joel Fernandes02939a32018-04-02 22:18:10 -070017ADB="adb"
Joel Fernandesfdc52002018-07-08 18:49:20 -070018SKIP_DEVICE=0 # Skip device preparation
Joel Fernandesffcbfe42018-07-08 19:08:02 -070019INSTALL_BCC=0 # Decide if BCC is to be installed
Joel Fernandesf0c54092018-04-01 19:05:10 -070020
21# Default packages
Joel Fernandes (Google)4f711082018-05-29 16:23:15 -070022DEFAULT_PACKAGES+="bash
23ca-certificates"
24
Joel Fernandes (Google)4b216fd2018-05-29 12:33:27 -070025EXTRA_FILES="none"
Joel Fernandes6c1ca312018-03-30 17:13:15 -070026
Joel Fernandesab5f9282018-04-05 22:53:23 -070027config_full_build() {
Joel Fernandes (Google)d7f21f12018-05-27 20:19:51 -070028 for f in $(ls $spath/packages); do source $spath/packages/$f; done;
Joel Fernandesab5f9282018-04-05 22:53:23 -070029}
30
Joel Fernandes6c1ca312018-03-30 17:13:15 -070031# Parse command line parameters
Joel Fernandes5b4be9c2018-03-30 23:58:27 -070032if [ $# -lt 1 ]; then usage; fi; POSITIONAL=()
Joel Fernandes4fb97ea2018-03-31 11:15:19 -070033while [[ $# -gt 0 ]]; do key="$1";
Joel Fernandesccb993f2018-07-02 19:59:04 -070034
35# If its shell mode, any future args become shell's args
36if [ "x$ASHELL" == "x1" ]; then
37 if [ -z "$SHELL_ARGS" ]; then
38 SHELL_ARGS=$key
39 else
40 SHELL_ARGS="$SHELL_ARGS $key"
41 fi
42 shift || true; continue
43fi
44
Joel Fernandes6c1ca312018-03-30 17:13:15 -070045case $key in
Joel Fernandes (Google)448a1742018-05-29 12:23:18 -070046 prepare) PREPARE=1; shift || true; ;;
Joel Fernandese2a04662018-03-31 19:33:23 -070047 shell) ASHELL=1; shift || true; ;;
Joel Fernandesb4c80a62018-04-02 22:37:22 -070048 remove) REMOVE=1; shift || true; ;;
Erick Reyese25caea2018-06-19 15:42:59 -070049 git-pull) GIT_PULL=1; shift || true; ;;
50 pull) PULL=1; shift || true; break ;;
Erick Reyes5104a6c2018-06-27 15:31:58 -070051 push) PUSH=1; shift || true; break ;;
Joel Fernandes (Google)08d1a072018-05-28 13:29:03 -070052 --arch) ARCH=$2; shift || true; shift || true; ;;
Joel Fernandes9f00bf42018-04-01 10:36:33 -070053 --archive) TARF=$2; shift || true; shift || true; ;;
Joel Fernandes4fb97ea2018-03-31 11:15:19 -070054 --tracers) source $spath/packages/tracers; shift || true; ;;
55 --compilers) source $spath/packages/compilers; shift || true; ;;
56 --editors) source $spath/packages/editors; shift || true; ;;
57 --scheduler) source $spath/packages/scheduler; shift || true; ;;
Joel Fernandesab5f9282018-04-05 22:53:23 -070058 --fullbuild) config_full_build; shift || true; ;;
Joel Fernandesa67be0b2018-04-01 13:40:34 -070059 --download) DOWNLOAD=1; shift || true; ;;
Joel Fernandes100c4682018-04-01 20:09:57 -070060 --bcc) source $spath/packages/bcc; shift || true; ;;
Joel Fernandes5b4be9c2018-03-30 23:58:27 -070061 --kernelsrc) KERNELSRC="$2"; shift || true; shift || true; ;;
Joel Fernandes (Google)1171d2d2018-05-30 17:22:09 -070062 --skip-install) SKIP_INSTALL=1; shift || true; ;;
Joel Fernandes1ed30d72018-05-18 14:08:20 -070063 --kernel-headers-targz) KERNELHDRS=$2; shift || true; shift || true; ;;
Joel Fernandese2a04662018-03-31 19:33:23 -070064 --tempdir) TDIR="$2"; shift || true; shift || true; ;;
Joel Fernandes97958e12018-03-31 23:51:44 -070065 --buildtar) TARDIR="$2"; shift || true; shift || true; ;;
Joel Fernandes02939a32018-04-02 22:18:10 -070066 --device|-s) ADB="$ADB -s $2"; shift || true; shift || true; ;;
Joel Fernandesfdc52002018-07-08 18:49:20 -070067 --build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; shift || true; shift || true; ;;
Joel Fernandesca8fb552018-04-01 13:48:16 -070068 --debug) set -x; shift || true; ;;
Joel Fernandes112243b2018-07-08 17:42:48 -070069 *) c_error "Unknown option ($1)"; usage; ;;
Joel Fernandes6c1ca312018-03-30 17:13:15 -070070esac
71done
72
Erick Reyese25caea2018-06-19 15:42:59 -070073if [ ! -z "$GIT_PULL" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -070074 c_info "Updating androdeb by git pull"
Joel Fernandes16371152018-04-05 22:50:36 -070075 cd $spath
76 git pull
Joel Fernandes112243b2018-07-08 17:42:48 -070077 c_info "Done."
Joel Fernandes16371152018-04-05 22:50:36 -070078 exit 0
79fi
80
Erick Reyese25caea2018-06-19 15:42:59 -070081if [ ! -z "$PULL" ]; then
82 if [ $1 == "-a" ]; then
83 PRESERVE="-a"
Joel Fernandes112243b2018-07-08 17:42:48 -070084 c_info "Preserving filestamps and mode"
Erick Reyese25caea2018-06-19 15:42:59 -070085 shift || true
86 fi
Erick Reyes5104a6c2018-06-27 15:31:58 -070087 file_count=`count_sources $@`
Erick Reyese25caea2018-06-19 15:42:59 -070088 i=0
89 while [ $i -lt $file_count ]; do
90 files["$i"]=/data/androdeb/debian/$1
91 shift || true
92 i=$((i + 1))
93 done
94 $ADB pull $PRESERVE "${files[@]}" "$@"
95 exit 0
96fi
97
Erick Reyes5104a6c2018-06-27 15:31:58 -070098if [ ! -z "$PUSH" ]; then
Erick Reyes5104a6c2018-06-27 15:31:58 -070099 file_count=`count_sources $@`
100 i=0
101 while [ $i -lt $file_count ]; do
102 files["$i"]=$1
103 shift || true
104 i=$((i + 1))
105 done
106 dest=/data/androdeb/debian/$1
107 $ADB push $sync "${files[@]}" $dest
108 exit 0
109fi
110
Joel Fernandes9649a262018-07-02 20:49:41 -0700111if [ -z "$ASHELL" ] && [ -z "$REMOVE" ] && [ -z "$PACKAGES" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700112 c_info "No packages specified, so I'm going to build/install all packages (--fullbuild)"
Joel Fernandes (Google)9c3ae932018-05-28 14:34:48 -0700113 config_full_build
114fi
115
Joel Fernandes97958e12018-03-31 23:51:44 -0700116if [[ ! -z ${TARDIR+x} ]] && [[ ! -d $TARDIR ]]; then die 7 "Tar dir specified doesn't exist"; fi
Joel Fernandes92057762018-03-31 23:38:43 -0700117
Joel Fernandesfdc52002018-07-08 18:49:20 -0700118if [ -z $BI ]; then
Joel Fernandesc26696d2018-07-08 18:28:12 -0700119 do_adb_root "$ADB"
Joel Fernandesaf07ec72018-04-02 22:01:19 -0700120
Joel Fernandesc26696d2018-07-08 18:28:12 -0700121 if [ $? -ne 0 ]; then
122 c_error "adb root failed, make sure:"
123 c_error " * If multiple devices connected, provide --device <serialno> (or -s <serialno>)"
124 c_error " * Try to run \"adb root\" manually and see if it works. Typically this needs a userdebug build."
125 c_error ""
126 c_error "Note: adb can be typically obtained using the android-tools-adb or the adb"
127 c_error "packages on your distro, or by installing the Android SDK."
128 die 3 "Exiting."
129 fi
Joel Fernandesfdc52002018-07-08 18:49:20 -0700130else
131 [ ! -z $BUILD_IMAGEF ] || die 8 "--build-image passed but no image file provided"
Joel Fernandes (Google)9c3ae932018-05-28 14:34:48 -0700132fi
Joel Fernandes72656c52018-03-31 20:35:33 -0700133
Joel Fernandesb4c80a62018-04-02 22:37:22 -0700134if [ ! -z "$REMOVE" ]; then
135 die_if_no_androdeb "Nothing to remove."
Joel Fernandes (Google)7c8b1082018-06-25 12:29:10 -0700136 $ADB shell /data/androdeb/device-umount-all || true;
Joel Fernandesb4c80a62018-04-02 22:37:22 -0700137 $ADB shell rm -rf /data/androdeb; exit 0; fi
138
Joel Fernandes83676b12018-03-30 23:33:47 -0700139##########################################################
Joel Fernandese2a04662018-03-31 19:33:23 -0700140# SHELL
Joel Fernandes83676b12018-03-30 23:33:47 -0700141##########################################################
Joel Fernandese381ac72018-03-31 21:46:36 -0700142if [ ! -z ${ASHELL+x} ]; then
Joel Fernandes02939a32018-04-02 22:18:10 -0700143 set +e; $ADB shell ls /data/androdeb/debian/.bashrc > /dev/null 2>&1
Joel Fernandesc9646812018-03-31 19:45:46 -0700144 if [ $? -ne 0 ]; then
145 die 2 "Device doesn't have an androdeb environment, run \"./androdeb prepare\" first";
146 fi; set -e
147
Joel Fernandesccb993f2018-07-02 19:59:04 -0700148 if [ ! -z ${SHELL_ARGS+x} ]; then
149 # Explanation of quotes:
150 # Outer quote is so that androdeb's bash passes the SHELL_ARGS as a single
151 # argument to $ADB shell. Inner quotes is so that run-command can receive all
152 # the args even though they may be separated by spaces. \m/
153 $ADB shell -t /data/androdeb/run-command "\"$SHELL_ARGS\""
154 else
155 $ADB shell -t /data/androdeb/run
156 fi
157
Joel Fernandese2a04662018-03-31 19:33:23 -0700158 exit 0
159fi
160
161##########################################################
162# PREPARE
163##########################################################
Joel Fernandesf0c54092018-04-01 19:05:10 -0700164
165function do_cleanup() {
166 rm -rf $TDIR/*; if [ $MKTEMP -eq 1 ]; then rm -rf $TDIR; fi
167}
168
169function push_unpack_headers() {
Joel Fernandesb4c80a62018-04-02 22:37:22 -0700170 die_if_no_androdeb "Couldn't update headers."
Joel Fernandesf0c54092018-04-01 19:05:10 -0700171
Joel Fernandesf95f2b22018-07-08 17:54:47 -0700172 c_info "Storing kernel headers into androdeb /kernel-headers/"
Joel Fernandes02939a32018-04-02 22:18:10 -0700173 $ADB shell rm -rf /data/androdeb/debian/kernel-headers/
174 $ADB shell mkdir /data/androdeb/debian/kernel-headers/
Joel Fernandesf95f2b22018-07-08 17:54:47 -0700175 run_quiet $ADB push $TDIR_ABS/kh.tgz /data/androdeb/
Joel Fernandes02939a32018-04-02 22:18:10 -0700176 $ADB shell tar -xvf /data/androdeb/kh.tgz -C /data/androdeb/debian/kernel-headers/ > /dev/null
177 $ADB shell rm /data/androdeb/kh.tgz
Joel Fernandesf0c54092018-04-01 19:05:10 -0700178}
179
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700180function push_unpack_tarred_headers() {
181 die_if_no_androdeb "Couldn't update headers."
182
183 $ADB shell rm -rf /data/androdeb/debian/kernel-headers/
184 $ADB shell mkdir /data/androdeb/debian/kernel-headers/
Joel Fernandesf95f2b22018-07-08 17:54:47 -0700185
186 c_info "Pushing headers tar onto device"
187 run_quiet $ADB push $1 /data/androdeb/
188
Joel Fernandes112243b2018-07-08 17:42:48 -0700189 c_info "Storing kernel headers into androdeb root directory"
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700190 $ADB shell tar -xvf /data/androdeb/$(basename $1) -C /data/androdeb/debian/ > /dev/null
191
192 $ADB shell rm /data/androdeb/$(basename $1)
193}
194
Joel Fernandes72065112018-04-01 20:02:53 -0700195function all_done_banner() {
Joel Fernandes112243b2018-07-08 17:42:48 -0700196 c_info "All done! Run \"androdeb shell\" to enter environment"
Joel Fernandes72065112018-04-01 20:02:53 -0700197}
198
Joel Fernandes72656c52018-03-31 20:35:33 -0700199# Prepare is the last command checked
Joel Fernandes9f00bf42018-04-01 10:36:33 -0700200if [ -z "$PREPARE" ]; then usage; fi
Joel Fernandes72656c52018-03-31 20:35:33 -0700201
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700202if [ ! -z "$TARF" ] && [ ! -f $TARF ] && [ -z "$DOWNLOAD" ]; then die 5 "archive provided doesn't exist"; fi
Joel Fernandes9f00bf42018-04-01 10:36:33 -0700203
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700204if [ ! -z "$KERNELSRC" ] && [ ! -d $KERNELSRC ]; then die 6 "Kernel source directory provided doesn't exist"; fi
205
206if [ ! -z "$KERNELHDRS" ] && [ ! -f $KERNELHDRS ]; then die 7 "Kernel headers tar.gz doesn't exist"; fi
Joel Fernandese2a04662018-03-31 19:33:23 -0700207
Joel Fernandesca8fb552018-04-01 13:48:16 -0700208print_prepare_banner
209
Joel Fernandes6c1ca312018-03-30 17:13:15 -0700210# Where do we want to store temporary files
Joel Fernandese2a04662018-03-31 19:33:23 -0700211MKTEMP=0; if [[ -z ${TDIR+x} ]] || [[ ! -d "${TDIR}" ]]; then
212 TDIR=`mktemp -d`; MKTEMP=1; fi
Joel Fernandese381ac72018-03-31 21:46:36 -0700213rm -rf $TDIR/*
214TDIR_ABS=$( cd "$TDIR" ; pwd -P )
Joel Fernandes6c1ca312018-03-30 17:13:15 -0700215
Joel Fernandesa67be0b2018-04-01 13:40:34 -0700216if [ ! -z "$DOWNLOAD" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700217 c_info "Downloading Androdeb from the web..."; c_info ""
Joel Fernandes (Google)9e670aa2018-06-25 13:39:34 -0700218 # Github dropped tar gz support! ##?#??#! Now we've to zip everything.
219 curl -L https://github.com/joelagnel/androdeb/releases/download/$VERSION/androdeb-fs.tgz.zip --output $TDIR_ABS/androdeb-fs.tgz.zip;
220 unzip -e $TDIR_ABS/androdeb-fs.tgz.zip -d $TDIR_ABS/
Joel Fernandesa67be0b2018-04-01 13:40:34 -0700221 TARF=$TDIR_ABS/androdeb-fs.tgz; fi
222
Joel Fernandese2a04662018-03-31 19:33:23 -0700223OUT_TMP=$TDIR/debian; rm -rf $OUT_TMP; mkdir -p $OUT_TMP
Joel Fernandesf0c54092018-04-01 19:05:10 -0700224
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700225# Unpack the supplied kernel headers tar.gz directly into androdeb root
226if [ ! -z "$KERNELHDRS" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700227 c_info "Building updating kernel headers from supplied tar.gz ($KERNELHDRS)"
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700228
229 # Is header tar gz update the only thing left to do?
Joel Fernandes (Google)1171d2d2018-05-30 17:22:09 -0700230 if [[ ! -z "$SKIP_INSTALL" ]]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700231 c_info "Skipping install"
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700232 push_unpack_tarred_headers $KERNELHDRS; do_cleanup; all_done_banner; exit 0; fi
233
234 tar -xvf $KERNELHDRS -C $OUT_TMP/ > /dev/null
235fi
236
Joel Fernandesf0c54092018-04-01 19:05:10 -0700237# Package kernel headers
238if [ ! -z "$KERNELSRC" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700239 c_info "Building and updating kernel headers from kernel source dir ($KERNELSRC)"
Joel Fernandes72065112018-04-01 20:02:53 -0700240 $spath/bcc/build-kheaders-targz.sh ${KERNELSRC} $TDIR_ABS/kh.tgz > /dev/null
241
Joel Fernandesf0c54092018-04-01 19:05:10 -0700242 # Is header update the only thing left to do?
Joel Fernandes (Google)1171d2d2018-05-30 17:22:09 -0700243 if [[ ! -z "$SKIP_INSTALL" ]]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700244 c_info "Skipping install"
Joel Fernandes72065112018-04-01 20:02:53 -0700245 push_unpack_headers; do_cleanup; all_done_banner; exit 0; fi
Joel Fernandesf0c54092018-04-01 19:05:10 -0700246
Joel Fernandese381ac72018-03-31 21:46:36 -0700247 mkdir $OUT_TMP/kernel-headers
Joel Fernandes72065112018-04-01 20:02:53 -0700248 tar -xvf $TDIR_ABS/kh.tgz -C $OUT_TMP/kernel-headers/ > /dev/null
Joel Fernandese381ac72018-03-31 21:46:36 -0700249fi
Joel Fernandes4fb97ea2018-03-31 11:15:19 -0700250
Joel Fernandesf0c54092018-04-01 19:05:10 -0700251# Build FS from existing tar, very simple.
Joel Fernandes9f00bf42018-04-01 10:36:33 -0700252if [ ! -z "$TARF" ]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700253 c_info "Using archive at $TARF for filesystem preparation"
Joel Fernandes02939a32018-04-02 22:18:10 -0700254 $ADB shell mkdir -p /data/androdeb/
Joel Fernandesf95f2b22018-07-08 17:54:47 -0700255
256 c_info "Pushing filesystem to device.."
257 run_quiet $ADB push $TARF /data/androdeb/deb.tar.gz
258
259 c_info "Pushing addons to device.."
260 run_quiet $ADB push $spath/addons/* /data/androdeb/
261
262 c_info "Unpacking filesystem in device.."
263 run_quiet $ADB shell /data/androdeb/device-unpack
Joel Fernandes9f00bf42018-04-01 10:36:33 -0700264
Joel Fernandes1ed30d72018-05-18 14:08:20 -0700265 if [ ! -z "$KERNELHDRS" ]; then push_unpack_tarred_headers $KERNELHDRS; fi
Joel Fernandesf0c54092018-04-01 19:05:10 -0700266 if [ ! -z "$KERNELSRC" ]; then push_unpack_headers; fi
267
Joel Fernandes72065112018-04-01 20:02:53 -0700268 do_cleanup; all_done_banner; exit 0
Joel Fernandesf0c54092018-04-01 19:05:10 -0700269fi
270
271PACKAGES+="$DEFAULT_PACKAGES"
Joel Fernandes112243b2018-07-08 17:42:48 -0700272c_info "Using temporary directory: $TDIR"
Joel Fernandes4fb97ea2018-03-31 11:15:19 -0700273
Joel Fernandes112243b2018-07-08 17:42:48 -0700274if [[ $EUID -ne 0 ]]; then c_info "The next stage runs as sudo, please enter password if asked."; fi
Joel Fernandes4fb97ea2018-03-31 11:15:19 -0700275
Joel Fernandes (Google)57b3fd22018-05-29 16:27:03 -0700276ex_files=$(mktemp); echo $EXTRA_FILES > $ex_files
277
Joel Fernandes (Google)4f711082018-05-29 16:23:15 -0700278sudo $spath/buildstrap $ARCH $DISTRO $TDIR $OUT_TMP \
279 "$(make_csv "$PACKAGES")"\
Joel Fernandesfdc52002018-07-08 18:49:20 -0700280 $ex_files $INSTALL_BCC $SKIP_DEVICE
Joel Fernandes (Google)57b3fd22018-05-29 16:27:03 -0700281rm $ex_files
Joel Fernandes (Google)9c3ae932018-05-28 14:34:48 -0700282
283# If we only wanted to prepare a rootfs and don't have
284# a device connected, then just echo that and skip cleanup
Joel Fernandesfdc52002018-07-08 18:49:20 -0700285if [ $SKIP_DEVICE -eq 1 ]; then
286 c_info "Device preparation is being skipped for the selected options"
Joel Fernandesba7214e2018-07-08 18:15:49 -0700287 c_info "any builds that need to happen on device may be cloned but not built."
Joel Fernandes47ef2152018-07-08 19:13:51 -0700288
289 if [ ! -z $BI ]; then
290 sudo $spath/buildimage $OUT_TMP $(dirname $BUILD_IMAGEF)/$(basename $BUILD_IMAGEF)
291 sudo chmod a+rw $(dirname $BUILD_IMAGEF)/$(basename $BUILD_IMAGEF)
Joel Fernandes9a38e602018-07-08 19:26:32 -0700292 c_info "Your .img has been built! Enjoy!"
Joel Fernandes47ef2152018-07-08 19:13:51 -0700293 fi
Joel Fernandesba7214e2018-07-08 18:15:49 -0700294
295 do_cleanup
Joel Fernandes9a38e602018-07-08 19:26:32 -0700296 exit 0
Joel Fernandes (Google)9c3ae932018-05-28 14:34:48 -0700297fi
Joel Fernandes4dd60862018-03-31 13:27:16 -0700298
299# Push tar to device and start unpack
Joel Fernandes02939a32018-04-02 22:18:10 -0700300$ADB shell mkdir -p /data/androdeb/
301$ADB push $TDIR/deb.tar.gz /data/androdeb/
302$ADB push $spath/addons/* /data/androdeb/
303$ADB shell /data/androdeb/device-unpack
Joel Fernandesb61d27d2018-03-31 11:59:45 -0700304
Joel Fernandes6f1c70f2018-03-31 20:26:26 -0700305# Build BCC and install bcc on device if needed
Joel Fernandesffcbfe42018-07-08 19:08:02 -0700306if [ $INSTALL_BCC -eq 0 ]; then
307 $ADB shell /data/androdeb/run-command /bcc-master/build-bcc.sh;
308fi
Joel Fernandes4fb97ea2018-03-31 11:15:19 -0700309
Joel Fernandesf0c54092018-04-01 19:05:10 -0700310do_cleanup
Joel Fernandese381ac72018-03-31 21:46:36 -0700311
Joel Fernandes97958e12018-03-31 23:51:44 -0700312# Extract a tar of the built, compiled and installed androdeb env
313if [[ ! -z ${TARDIR+x} ]]; then
Joel Fernandes112243b2018-07-08 17:42:48 -0700314 c_info "Creating and pulling tarball of androdeb env from device"
Joel Fernandes02939a32018-04-02 22:18:10 -0700315 $ADB shell /data/androdeb/build-debian-tar
316 $ADB pull /data/androdeb/androdeb-fs.tgz $TARDIR/
317 $ADB shell rm /data/androdeb/androdeb-fs.tgz; fi
Joel Fernandes97958e12018-03-31 23:51:44 -0700318
Joel Fernandes72065112018-04-01 20:02:53 -0700319all_done_banner