Permalink
Browse files

Make flash.sh and build.sh smarter

  • Loading branch information...
1 parent ded711b commit 32a25c6ccd770d4537ab3993f7419481509fd7e4 @michaelwu michaelwu committed May 22, 2012
Showing with 60 additions and 6 deletions.
  1. +25 −0 build.sh
  2. +35 −6 flash.sh
View
@@ -2,3 +2,28 @@
. setup.sh &&
time nice -n19 make $MAKE_FLAGS $@
+
+ret=$?
+echo -ne \\a
+if [ $ret -ne 0 ]; then
+ echo
+ echo \> Build failed\! \<
+ echo
+ echo If all else fails, use \|rm -rf objdir-gecko\| to clobber gecko and \|rm -rf out\| to clobber everything else.
+else
+ if echo $DEVICE | grep generic > /dev/null ; then
+ Run \|./run-emulator.sh\| to start the emulator
+ exit 0
+ fi
+ case "$1" in
+ "gecko")
+ echo Run \|./flash.sh gecko\| to update gecko
+ ;;
+ *)
+ echo Run \|./flash.sh\| to flash all partitions of your device
+ ;;
+ esac
+ exit 0
+fi
+
+exit $ret
View
@@ -53,17 +53,21 @@ flash_fastboot()
update_time
;;
esac
+ echo -ne \\a
}
flash_heimdall()
{
if [ ! -f "`which \"$HEIMDALL\"`" ]; then
echo Couldn\'t find heimdall.
+ echo Install Heimdall v1.3.1 from http://www.glassechidna.com.au/products/heimdall/
exit -1
fi
- $ADB reboot download || echo Couldn\'t reboot into download mode. Hope you\'re already in download mode
- sleep 8
+ $ADB reboot download && sleep 8
+ if [ $? -ne 0 ]; then
+ echo Couldn\'t reboot into download mode. Hope you\'re already in download mode
+ fi
case $1 in
"system")
@@ -79,19 +83,44 @@ flash_heimdall()
update_time
;;
esac
+
+ ret=$?
+ echo -ne \\a
+ if [ $ret -ne 0 ]; then
+ echo Heimdall flashing failed.
+ case "`uname`" in
+ "Darwin")
+ if kextstat | grep com.devguru.driver.Samsung > /dev/null ; then
+ echo Kies drivers found.
+ echo Uninstall kies completely and restart your system.
+ else
+ echo Restart your system if you\'ve just installed heimdall.
+ fi
+ ;;
+ "Linux")
+ echo Make sure you have a line like
+ echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"04e8\", MODE=\"0666\"
+ echo in /etc/udev/rules.d/android.rules
+ ;;
+ esac
+ exit -1
+ fi
+
+ echo Run \|./flash.sh gaia\| if you wish to install or update gaia.
}
case "$1" in
"gecko")
$ADB remount &&
- $ADB push $GECKO_OBJDIR/dist/b2g /system/b2g
- $ADB shell stop b2g
- $ADB shell start b2g
+ $ADB push $GECKO_OBJDIR/dist/b2g /system/b2g &&
+ echo Restarting B2G &&
+ $ADB shell stop b2g &&
+ $ADB shell start b2g &&
exit $?
;;
"gaia")
- make -C gaia install-gaia
+ make -C gaia install-gaia ADB="$ADB"
exit $?
;;

0 comments on commit 32a25c6

Please sign in to comment.