236
236
echo ubuntu-device-flash $SERVER $REVARGS touch --channel=$CHANNEL --device $MODEL $DEVMODE $RECOVERY --wipe $DEVTAR $EXTRA
237
237
ubuntu-device-flash $SERVER $REVARGS touch --channel=$CHANNEL --device $MODEL $DEVMODE $RECOVERY --wipe $DEVTAR $EXTRA
239
# Try to ensure adb is going to work
240
# (create the access file during the "magic window"
241
# when recovery.img is still running)
242
# (add it repeatedly to make sure it happens *after* /userdata gets formatted)
244
if [ x$ADB = xyes ]; then
245
COUNT=10 # try this many times
247
while [ "$COUNT" -gt 0 ]; do
248
# display progress if we haven't succeeded yet
249
if [ -z "$ADB_ENABLED" ]; then
250
echo "Trying to add .adb_onlock ($COUNT tries remaining)"
252
# create and verify the file
253
if adb shell echo success | grep success > /dev/null ; then
254
# no rootcmd is needed since recovery mode is already root
255
adb shell touch /data/.adb_onlock
256
if adb shell ls /data/.adb_onlock | grep adb_onlock > /dev/null ; then
260
COUNT=$(expr "$COUNT" - 1)
264
if [ x"$ADB_ENABLED" = x"yes" ]; then
265
echo 'Added .adb_onlock successfully.'
267
echo 'Failed to add .adb_onlock.'
239
271
echo 'waiting for device to boot'
240
272
adb wait-for-device
241
echo 'waiting a few seconds for boot'
273
echo 'waiting a few more seconds for boot'
244
# Try to ensure adb is going to work
276
# Try again to ensure adb is going to work
245
277
# (may require a human to help)
246
if [ x$ADB = xyes ]; then
278
if [ x"$ADB" = x"yes" -a x"$ADB_ENABLED" != x"yes" ]; then
247
279
# make sure adb shell works
249
281
while ! adb shell echo success | grep success > /dev/null ; do
254
# FIXME: also should copy ~/.android/adb_key.pub to /data/misc/adb/adb_keys
286
# FIXME?: also should copy ~/.android/adb_key.pub to /data/misc/adb/adb_keys
255
287
rootcmd touch /userdata/.adb_onlock
256
289
# alternate method: (if $FAILED)
257
290
# - adb reboot bootloader
258
291
# - fastboot boot device/recovery.img
259
292
# - make sure /data is mounted
260
293
# - touch /data/.adb_onlock
296
if [ x"$ADB_ENABLED" != x"yes" ]; then
263
297
# No ADB means we can't do anything else, so exit.
298
echo 'Adb not enabled or not requested; exiting.'
264
299
if [ x"$BEEP" = x"yes" ]; then beep ; fi
301
336
pushd media/photos
302
337
for f in * ; do adb push $f /home/phablet/Pictures ; done
304
adb shell 'cd /home/phablet/Photos && chown phablet.phablet *'
339
adb shell 'cd /home/phablet/Pictures && chown phablet.phablet *'
307
342
# Maybe push some extra scripts?