test lab session. It puts a device into bootloader mode, reboots into bootloader mode, determines device type, erases user cache, flashes a generic userdata image, updates the boot image, updates the radio image, updates the system image and reboots, sets up for a monkey run and finally runs a random monkey test. It will repeat this based on an optional parameter(-i) or default to 100 times. It will detect if it is in a low battery situation and wait for it to charge again. Adding custom flash files for use with nexusone and sholes. Updating files with review changes Removing some trailing spaces and fixing a few typos. Fixed some additional items and changed some of the naming Fixed a comparison that wasn't correct removed a default bootpart name, now needs to be added custom_flash.sh missing exit added edited README for typos and wordage. Change-Id: Ie7dc2139823304ce11b10b6fd65997cf311a2e9c
53 lines
1.5 KiB
Bash
53 lines
1.5 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Copyright 2010 Google Inc. All Rights Reserved.
|
|
# Author: bgay@google.com (Bruce Gay)
|
|
#
|
|
# used for flashing bootloader image on sholes
|
|
|
|
BOOTPART='motoboot'
|
|
|
|
################################################
|
|
# sets the name of the boot partition and
|
|
# bootfile, then flashes device
|
|
#
|
|
# Globals:
|
|
# product
|
|
# ROOT
|
|
# BOOTPART
|
|
# bootloaderfile
|
|
# device
|
|
# Arguments:
|
|
# None
|
|
# Returns:
|
|
# None
|
|
################################################
|
|
flash_bootloader_image()
|
|
{
|
|
if [ $product != "sholes" ]; then
|
|
log_print "Wrong device type, expected sholes!"
|
|
exit
|
|
fi
|
|
if [ "$bootloaderfile" == '' ]; then
|
|
log_print "getting bootloader file for $product"
|
|
secure=`$fastboot -s $device getvar secure 2>&1 | sed -n 's/secure: \([a-z]*\)\n*/\1/ p'`
|
|
if [ "$secure" = "no" ]; then
|
|
bootloaderfile=`ls -1 sholes/ | sed -n 's/^\(motoboot_unsecure.[0-9A-Z]*.img\)\n*/\1/ p'`
|
|
else
|
|
bootloaderfile=`ls -1 sholes/ | sed -n 's/^\(motoboot_secure.[0-9A-Z]*.img\)\n*/\1/ p'`
|
|
fi
|
|
if [ "$bootloaderfile" == '' ]; then
|
|
log_print "bootloader file empty: $bootloaderfile"
|
|
exit
|
|
fi
|
|
if [ ! -e "$ROOT/$product/$bootloaderfile" ]; then
|
|
log_print "bootloader file not found: ./$product/$bootloaderfile"
|
|
exit
|
|
fi
|
|
log_print "using $ROOT/$product/$bootloaderfile as the bootloader image file"
|
|
fi
|
|
log_print "downloading bootloader image to $device"
|
|
flash_partition $BOOTPART $ROOT/$product/$bootloaderfile
|
|
reboot_into_fastboot_from_fastboot
|
|
}
|