summaryrefslogtreecommitdiffstats
path: root/updater.sh
diff options
context:
space:
mode:
authorKolja Dummann <k.dummann@gmail.com>2011-05-26 23:13:57 +0200
committerKolja Dummann <k.dummann@gmail.com>2011-05-28 18:23:34 +0200
commit163c7a28554f63d61f26391f223adcbbe0cdb2e3 (patch)
tree6b9c361dbbe7a0c3f8ab43ba3362274e16115772 /updater.sh
parent32f1062d6f60bf4a38c17413660ae1b4634d740c (diff)
downloaddevice_samsung_aries-common-163c7a28554f63d61f26391f223adcbbe0cdb2e3.zip
device_samsung_aries-common-163c7a28554f63d61f26391f223adcbbe0cdb2e3.tar.gz
device_samsung_aries-common-163c7a28554f63d61f26391f223adcbbe0cdb2e3.tar.bz2
overlay: code dedup, move overlay to aries-common
new update script for radio image fix tethering interface Change-Id: I19583cce1aac14cef01f5ba05b85fb1bfbedb507
Diffstat (limited to 'updater.sh')
-rw-r--r--updater.sh43
1 files changed, 30 insertions, 13 deletions
diff --git a/updater.sh b/updater.sh
index fc3d694..a9dfa5e 100644
--- a/updater.sh
+++ b/updater.sh
@@ -85,11 +85,39 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then
# everything is logged into /sdcard/cyanogenmod.log
exec >> /sdcard/cyanogenmod_mtd.log 2>&1
+ # create mountpoint for radio partition
+ /tmp/busybox mkdir -p /radio
+
+ # make sure radio partition is mounted
+ if ! /tmp/busybox grep -q /radio /proc/mounts ; then
+ /tmp/busybox umount -l /dev/block/mtdblock5
+ if ! /tmp/busybox mount -t yaffs2 /dev/block/mtdblock5 /radio ; then
+ /tmp/busybox echo "Cannot mount radio partition."
+ exit 5
+ fi
+ fi
+
+ # if modem.bin doesn't exist on radio partition, format the partition and copy it
+ if ! /tmp/busybox test -e /radio/modem.bin ; then
+ /tmp/busybox umount -l /dev/block/mtdblock5
+ /tmp/erase_image radio
+ if ! /tmp/busybox mount -t yaffs2 /dev/block/mtdblock5 /radio ; then
+ /tmp/busybox echo "Cannot copy modem.bin to radio partition."
+ exit 5
+ else
+ /tmp/busybox cp /tmp/modem.bin /radio/modem.bin
+ fi
+ fi
+
+ # unmount radio partition
+ /tmp/busybox umount -l /dev/block/mtdblock5
+
# 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
exit 0
fi
+
# remove the cyanogenmod.cfg to prevent this from looping
/tmp/busybox rm -f /sdcard/cyanogenmod.cfg
@@ -110,10 +138,6 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then
/tmp/busybox umount -l /datadata
/tmp/erase_image datadata
- # flash radio image
- /tmp/erase_image radio
- /tmp/flash_image radio /tmp/modem.bin
-
# restore efs backup
if /tmp/busybox test -e /sdcard/backup/efs/nv_data.bin ; then
/tmp/busybox umount -l /efs
@@ -126,16 +150,8 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then
exit 6
fi
fi
-
- # copy efsbackup from sdcard to new efs partition
- /tmp/busybox cp -R /sdcard/backup/efs /
- # set permissions on /efs
- /tmp/busybox chown -R radio:radio /efs
- /tmp/busybox chown -R bluetooth:bluetooth /efs/bluetooth
- /tmp/busybox chmod -R 660 /efs
-
- # unmount /efs
+ /tmp/busybox cp -R /sdcard/backup/efs /
/tmp/busybox umount -l /efs
else
/tmp/busybox echo "Cannot restore efs."
@@ -147,3 +163,4 @@ elif /tmp/busybox test -e /dev/block/mtdblock0 ; then
exit 0
fi
+