Advertisement
Guest User

install-seq

a guest
Feb 6th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.09 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. fail() {
  4.     echo "Failed"
  5.     echo "$1"
  6.     cleanup
  7. }
  8.  
  9. cleanup() {
  10. umount /system
  11. umount /data
  12. exec sleep 3
  13. }
  14.  
  15. doLog() {
  16.  
  17.     /bin/flash_eraseall /dev/mtd/mtd2 > /dev/null
  18.     [ $? -eq 0 ] || fail "Failed to format"
  19.     /bin/mount -t yaffs2 /dev/block/mtdblock2 /system > /dev/null
  20.     [ $? -eq 0 ] || fail "Failed to mount"
  21.  
  22.     /bin/flash_eraseall /dev/mtd/mtd3 > /dev/null
  23.     [ $? -eq 0 ] || fail "Failed to format"
  24.  
  25.     /bin/mount -t yaffs2 /dev/block/mtdblock3 /data > /dev/null
  26.     [ $? -eq 0 ] || fail "Failed to mount"
  27.  
  28. echo "Installing...Android"
  29. if [ -f /sdcard/andboot/androidinstall.tgz ] ; then
  30.     tar -xzf /sdcard/andboot/androidinstall.tgz -C /
  31. else
  32.     tar -xf /sdcard/andboot/androidinstall.tar -C /
  33. fi
  34. [ $? -eq 0 ] || fail "Failed to extract Androidinstall"
  35.  
  36. echo "Installing...Modules"
  37. if [ -f /sdcard/andboot/androidupdate.tgz ] ; then
  38.     tar -xzf /sdcard/andboot/androidupdate.tgz -C /
  39. else
  40.     tar -xf /sdcard/andboot/androidupdate.tar -C /
  41. fi
  42. [ $? -eq 0 ] || fail "Failed to extract AndroidUpdate"
  43.  
  44.  
  45. echo "Android Installed"
  46. cleanup
  47. }
  48. doLog 2>&1 | /bin/tee -a /bootlog.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement