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
This commit is contained in:
Giulio Cervera 2011-01-20 16:09:46 +01:00
parent dcfb1a0a16
commit a843bbde3c

View File

@ -1,6 +1,6 @@
#!/system/bin/sh #!/system/bin/sh
# #
# mount ext4 partition from sd card # mount ext partition from sd card
BB="logwrapper busybox"; BB="logwrapper busybox";
@ -15,21 +15,8 @@ do
MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type` MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type`
if [ "$MMC_TYPE" = "SD" ]; if [ "$MMC_TYPE" = "SD" ];
then then
SDCARD=/dev/block/mmcblk$MMC_NUM # 2nd partition of sdcard should be the sd-ext if exist
break SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2
fi
done
if [ -b "$SDCARD" ];
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 break
fi fi
done done
@ -41,17 +28,19 @@ then
# fsck the sdcard filesystem first # fsck the sdcard filesystem first
if [ -x `which e2fsck` ]; if [ -x `which e2fsck` ];
then then
e2fsck -y $SD_EXT_PART;e2fsk_exitcode=$? e2fsck -y $SD_EXT_PART
e2fsk_exitcode=$?
else else
echo "executable e2fsck not found, assuming no filesystem errors" echo "executable e2fsck not found, assuming no filesystem errors"
e2fsk_exitcode=0 e2fsk_exitcode=0
fi fi
# set property with exit code in case an error occurs # set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsk_exitcode; setprop cm.e2fsck.errors $e2fsk_exitcode;
if [ "$e2fsk_exitcode" -lt 2 ]; if [ "$e2fsk_exitcode" -lt 2 ];
then then
# mount and set perms # mount and set perms
$BB mount -o noatime,barrier=1,data=ordered,noauto_da_alloc -t ext4 $SD_EXT_PART $SD_EXT_DIRECTORY; $BB mount -o noatime,nodiratime,barrier=1 -t ext3 $SD_EXT_PART $SD_EXT_DIRECTORY;
if [ "$?" = 0 ]; if [ "$?" = 0 ];
then then
$BB chown 1000:1000 $SD_EXT_DIRECTORY; $BB chown 1000:1000 $SD_EXT_DIRECTORY;
@ -64,4 +53,3 @@ then
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd"; log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
fi fi
fi fi
fi