| #!/bin/sh /etc/rc.common |
| # Marvell sd card detect & mount script |
| |
| START=50 |
| STOP=91 |
| |
| WEBDAV_SD=/www/webdav/sdcard |
| start() { |
| /sbin/block detect > /etc/config/fstab |
| |
| uci show fstab.@mount[0] |
| if [ $? -eq 0 ]; then |
| fstype=`uci get fstab.@mount[0].fstype` |
| [ "$fstype" == "vfat" ] && { |
| uci set fstab.@mount[0].options='utf8=1' |
| uci_commit fstab |
| } |
| fi |
| |
| /sbin/block mount |
| |
| . /sbin/mrvl_detect_sdcard |
| |
| touch /tmp/sdcard_mount |
| |
| uci show fstab.@mount[0] |
| |
| if [ $? -eq 0 ]; then |
| mkdir -p $WEBDAV_SD |
| mount --bind /sdcard $WEBDAV_SD |
| else |
| rm -rf /www/webdav/sdcard/ 2>/dev/null |
| fi |
| if [ -e "/NVM/sulog_auto_enable" ]; then |
| /bin/sulog & |
| sleep 1 |
| /bin/serial_atcmd "AT*IMLCONFIG=5,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" |
| fi |
| } |
| |
| stop() { |
| /sbin/block umount |
| /sbin/block detect > /etc/config/fstab |
| uci delete fstab.@mount[0] |
| uci commit fstab |
| umount $WEBDAV_SD 2>/dev/null |
| } |