diff options
author | jt1134 <jt1134@gmail.com> | 2011-07-17 18:19:43 -0500 |
---|---|---|
committer | jt1134 <jt1134@gmail.com> | 2011-07-17 18:19:43 -0500 |
commit | 7fbbe6cb07422e3a6d10f3d93618d223044edab3 (patch) | |
tree | a24879d35bb975186ff11035809df3d98ed7b71e /updater.sh | |
parent | 0ee95e50c37419b6d3186b37608536462734346b (diff) | |
download | device_samsung_aries-common-7fbbe6cb07422e3a6d10f3d93618d223044edab3.zip device_samsung_aries-common-7fbbe6cb07422e3a6d10f3d93618d223044edab3.tar.gz device_samsung_aries-common-7fbbe6cb07422e3a6d10f3d93618d223044edab3.tar.bz2 |
device detection using getprop is not reliable; split changes into separate script
must copy correct updater*.sh script in each device's makefile
Change-Id: I13d5e6cefc7f6f7827a4d9b3666eea004f9d0516
Diffstat (limited to 'updater.sh')
-rwxr-xr-x[-rw-r--r--] | updater.sh | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/updater.sh b/updater.sh index 05b3840..48f6513 100644..100755 --- a/updater.sh +++ b/updater.sh @@ -2,24 +2,12 @@ # # Universal Updater Script for Samsung Galaxy S Phones # (c) 2011 by Teamhacksung +# GSM version # set -x export PATH=/:/sbin:/system/xbin:/system/bin:/tmp:$PATH -# check device model -if /tmp/busybox test "`getprop ro.product.model`" = "SCH-I500" ; then - # we're on fascinate/mesmerize/showcase - sdcard_device="/dev/block/mmcblk1p1" - data_device="/dev/block/mmcblk0p1" - use_radio_files="false" -else - # gsm sgs devices - sdcard_device="/dev/block/mmcblk0p1" - data_device="/dev/block/mmcblk0p2" - use_radio_files="true" -fi - # check if we're running on a bml or mtd device if /tmp/busybox test -e /dev/block/bml7 ; then # we're running on a bml device @@ -27,8 +15,8 @@ if /tmp/busybox test -e /dev/block/bml7 ; then # make sure sdcard is mounted if ! /tmp/busybox grep -q /mnt/sdcard /proc/mounts ; then /tmp/busybox mkdir -p /mnt/sdcard - /tmp/busybox umount -l $sdcard_device - if ! /tmp/busybox mount -t vfat $sdcard_device /mnt/sdcard ; then + /tmp/busybox umount -l /dev/block/mmcblk0p1 + if ! /tmp/busybox mount -t vfat /dev/block/mmcblk0p1 /mnt/sdcard ; then /tmp/busybox echo "Cannot mount sdcard." exit 1 fi @@ -40,9 +28,6 @@ if /tmp/busybox test -e /dev/block/bml7 ; then # everything is logged into /sdcard/cyanogenmod.log exec >> /mnt/sdcard/cyanogenmod_bml.log 2>&1 -# gsm -if $use_radio_files ; then - # make sure efs is mounted if ! /tmp/busybox grep -q /efs /proc/mounts ; then /tmp/busybox mkdir -p /efs @@ -62,8 +47,6 @@ if $use_radio_files ; then /tmp/busybox mkdir -p /mnt/sdcard/backup/efs /tmp/busybox cp -R /efs/ /mnt/sdcard/backup -fi - # write the package path to sdcard cyanogenmod.cfg if /tmp/busybox test -n "$UPDATE_PACKAGE" ; then PACKAGE_LOCATION=${UPDATE_PACKAGE#/mnt} @@ -90,8 +73,8 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then /tmp/busybox mkdir -p /sdcard if ! /tmp/busybox grep -q /sdcard /proc/mounts ; then - /tmp/busybox umount -l $sdcard_device - if ! /tmp/busybox mount -t vfat $sdcard_device /sdcard ; then + /tmp/busybox umount -l /dev/block/mmcblk0p1 + if ! /tmp/busybox mount -t vfat /dev/block/mmcblk0p1 /sdcard ; then /tmp/busybox echo "Cannot mount sdcard." exit 4 fi @@ -103,9 +86,6 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then # everything is logged into /sdcard/cyanogenmod.log exec >> /sdcard/cyanogenmod_mtd.log 2>&1 -# gsm -if $use_radio_files ; then - # create mountpoint for radio partition /tmp/busybox mkdir -p /radio @@ -133,8 +113,6 @@ if $use_radio_files ; then # unmount radio partition /tmp/busybox umount -l /dev/block/mtdblock5 -fi - # if a cyanogenmod.cfg exists, then this is a first time install # let's format the volumes and restore radio and efs if ! /tmp/busybox test -e /sdcard/cyanogenmod.cfg ; then @@ -155,15 +133,12 @@ fi # unmount and format data /tmp/busybox umount /data - /tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data $data_device + /tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/block/mmcblk0p2 # unmount and format datadata /tmp/busybox umount -l /datadata /tmp/erase_image datadata -# gsm -if $use_radio_files ; then - # restore efs backup if /tmp/busybox test -e /sdcard/backup/efs/nv_data.bin ; then /tmp/busybox umount -l /efs @@ -184,12 +159,6 @@ if $use_radio_files ; then exit 7 fi -else -# erase partitions anyways - /tmp/erase_image radio - /tmp/erase_image efs -fi - # flash boot image /tmp/bml_over_mtd.sh boot 72 reservoir 2004 /tmp/boot.img |