diff options
author | Giulio Cervera <giulio.cervera@gmail.com> | 2011-01-20 16:09:46 +0100 |
---|---|---|
committer | Giulio Cervera <giulio.cervera@gmail.com> | 2011-01-20 16:31:08 +0100 |
commit | a843bbde3cb4058d51d77851de4bfdb803d2868b (patch) | |
tree | 06b79c75dc9f265b95f0cebd07307c491cd24e32 /prebuilt/common/etc/init.d/05mountsd | |
parent | dcfb1a0a16f873bea627f7953f780145ea84b24d (diff) | |
download | vendor_replicant-a843bbde3cb4058d51d77851de4bfdb803d2868b.zip vendor_replicant-a843bbde3cb4058d51d77851de4bfdb803d2868b.tar.gz vendor_replicant-a843bbde3cb4058d51d77851de4bfdb803d2868b.tar.bz2 |
mountsd: Relax partition checks
Removed label requirement, cause too many trouble on user
The 2nd SD Card partition will be mounted as sd-ext with ext3fs
(there are some problem with ext4, we stay on 3 until 4 problem
will be sorted)
Change-Id: I87e53d1714d84fbdafeb80599ebb3e62b3a24b1e
Diffstat (limited to 'prebuilt/common/etc/init.d/05mountsd')
-rw-r--r-- | prebuilt/common/etc/init.d/05mountsd | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/prebuilt/common/etc/init.d/05mountsd b/prebuilt/common/etc/init.d/05mountsd index c519a7e..b34b171 100644 --- a/prebuilt/common/etc/init.d/05mountsd +++ b/prebuilt/common/etc/init.d/05mountsd @@ -1,6 +1,6 @@ #!/system/bin/sh # -# mount ext4 partition from sd card +# mount ext partition from sd card BB="logwrapper busybox"; @@ -15,53 +15,41 @@ do MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type` if [ "$MMC_TYPE" = "SD" ]; then - SDCARD=/dev/block/mmcblk$MMC_NUM + # 2nd partition of sdcard should be the sd-ext if exist + SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2 break fi done -if [ -b "$SDCARD" ]; +if [ -b "$SD_EXT_PART" ]; then - # find sd-ext partition by label - PARTITIONS=`cat /proc/partitions|grep mmcblk$MMC_NUM|grep -v "mmcblk$MMC_NUM$"|awk '{print $4}'` - for PARTITION in $PARTITIONS - do - LABEL=`e2label /dev/block/$PARTITION` - if [ "$LABEL" = "sd-ext" ]; - then - SD_EXT_PART=/dev/block/$PARTITION - break - fi - done + log -p i -t mountsd "Checking filesystems.."; - if [ -b "$SD_EXT_PART" ]; + # fsck the sdcard filesystem first + if [ -x `which e2fsck` ]; then - log -p i -t mountsd "Checking filesystems.."; - - # fsck the sdcard filesystem first - if [ -x `which e2fsck` ]; - then - e2fsck -y $SD_EXT_PART;e2fsk_exitcode=$? - else - echo "executable e2fsck not found, assuming no filesystem errors" - e2fsk_exitcode=0 - fi - # set property with exit code in case an error occurs - setprop cm.e2fsck.errors $e2fsk_exitcode; - if [ "$e2fsk_exitcode" -lt 2 ]; + e2fsck -y $SD_EXT_PART + e2fsk_exitcode=$? + else + echo "executable e2fsck not found, assuming no filesystem errors" + e2fsk_exitcode=0 + fi + + # set property with exit code in case an error occurs + setprop cm.e2fsck.errors $e2fsk_exitcode; + if [ "$e2fsk_exitcode" -lt 2 ]; + then + # mount and set perms + $BB mount -o noatime,nodiratime,barrier=1 -t ext3 $SD_EXT_PART $SD_EXT_DIRECTORY; + if [ "$?" = 0 ]; then - # mount and set perms - $BB mount -o noatime,barrier=1,data=ordered,noauto_da_alloc -t ext4 $SD_EXT_PART $SD_EXT_DIRECTORY; - if [ "$?" = 0 ]; - then - $BB chown 1000:1000 $SD_EXT_DIRECTORY; - $BB chmod 771 $SD_EXT_DIRECTORY; - log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted"; - else - log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!"; - fi + $BB chown 1000:1000 $SD_EXT_DIRECTORY; + $BB chmod 771 $SD_EXT_DIRECTORY; + log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted"; else - log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd"; + log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!"; fi + else + log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd"; fi fi |