summaryrefslogtreecommitdiffstats
path: root/updater.sh
diff options
context:
space:
mode:
authorjt1134 <jt1134@gmail.com>2011-06-28 00:16:37 -0500
committerjt1134 <jt1134@gmail.com>2011-07-06 14:22:48 -0500
commit013047868fab22f21e7b42719a5b717e9226e2e0 (patch)
tree1fd004226b47b7e6dc042e724269fee2eb84b77c /updater.sh
parentc87ce694a82dc26b42c5cbde48fa2a675945c4aa (diff)
downloaddevice_samsung_aries-common-013047868fab22f21e7b42719a5b717e9226e2e0.zip
device_samsung_aries-common-013047868fab22f21e7b42719a5b717e9226e2e0.tar.gz
device_samsung_aries-common-013047868fab22f21e7b42719a5b717e9226e2e0.tar.bz2
fascinate: fix mountpoints and ignore radio stuff
Diffstat (limited to 'updater.sh')
-rw-r--r--updater.sh42
1 files changed, 37 insertions, 5 deletions
diff --git a/updater.sh b/updater.sh
index a9dfa5e..6c1208b 100644
--- a/updater.sh
+++ b/updater.sh
@@ -7,6 +7,19 @@
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
@@ -14,8 +27,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 /dev/block/mmcblk0p1
- if ! /tmp/busybox mount -t vfat /dev/block/mmcblk0p1 /mnt/sdcard ; then
+ /tmp/busybox umount -l $sdcard_device
+ if ! /tmp/busybox mount -t vfat $sdcard_device /mnt/sdcard ; then
/tmp/busybox echo "Cannot mount sdcard."
exit 1
fi
@@ -27,6 +40,9 @@ 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
@@ -46,6 +62,8 @@ if /tmp/busybox test -e /dev/block/bml7 ; 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}
@@ -72,8 +90,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 /dev/block/mmcblk0p1
- if ! /tmp/busybox mount -t vfat /dev/block/mmcblk0p1 /sdcard ; then
+ /tmp/busybox umount -l $sdcard_device
+ if ! /tmp/busybox mount -t vfat $sdcard_device /sdcard ; then
/tmp/busybox echo "Cannot mount sdcard."
exit 4
fi
@@ -85,6 +103,9 @@ 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
@@ -111,6 +132,8 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; 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
@@ -132,12 +155,15 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then
# unmount and format data
/tmp/busybox umount /data
- /tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/block/mmcblk0p2
+ /tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data $data_device
# 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
@@ -158,6 +184,12 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; 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