release 0.1
[u-tools.git] / installer.sh
blob248c17bf47571a0bd5ad27476b480a113de5dc23
1 #./installer.sh installer.conf /home/liu/samsung/test2.1r2_ext3/out/target/product/shrek/system.img
2 echo "installer config file:$1"
3 echo "installer image file:$2"
4 echo "start usb installer ?"
5 read SAYYES
6 if [ "$SAYYES" = "y" ] || [ "$SAYYES" = "Y" ]; then
7 if [ -e $1 ]; then
8 if [ -e $2 ]; then
9 echo "start usb install..."
10 #./adb kill-server
11 #sleep 1
12 ./adb start-server
13 sleep 2
14 ./adb devices > mydevices.txt
15 cat mydevices.txt | sed '/^$/d' | sed -n '2p' > device1.txt
16 device1=`cat device1.txt`
18 echo "$device1"
19 rm mydevices.txt
21 if [ -z "$device1" ] || [ "$device1" = "" ] ; then
22 echo "not find devices!"
23 else
24 echo "start push file!"
25 ./adb push "$1" /sdcard
26 ./adb push "$2" /sdcard
27 ./adb reboot
29 else
30 echo "not find image file!"
32 else
33 echo "not find config file!"
35 else
36 echo "user cancel !"