sdcard Input/output error
Xiangfu Liu
xiangfu at sharism.cc
Fri Mar 5 02:13:19 EST 2010
Hi Richard
I know in openwrt-xburst there is
"openwrt-xburst/target/linux/xburst/base-files/etc/config/fstab"
to manage the automount.
you can find the 10-mount file here:http://projects.qi-hardware.com/index.php/p/openwrt-xburst/source/tree/xburst/package/base-files/files/etc/hotplug.d/block
which image you use? the 10-mount is different with current version.
Richard Sharpe wrote:
> On Thu, Mar 4, 2010 at 9:08 PM, Richard Sharpe
> <realrichardsharpe at gmail.com> wrote:
>> OK, here is the problem:
>>
>> 1. In /etc/fstab the device is listed to mount on /card, so, if the
>> device is plugged in when the system is booted, it will mount on
>> /card.
>>
>> 2. In /etc/hotplug.d/block/10-mount, we find:
>>
>> #!/bin/sh
>>
>> # Copyright (C) 2009 OpenWrt.org
>>
>> blkdev=`dirname $DEVPATH`
>> if [ `basename $blkdev` != "block" ]; then
>>
>> device=`basename $DEVPATH`
>> case "$ACTION" in
>> add)
>> mkdir -p /mnt/$device
>> mount /dev/$device /mnt/$device
>> ;;
>> remove)
>> umount /dev/$device
>> ;;
>> esac
>>
>> fi
>>
>> This code is wrong. It should first try to mount /dev/$device to see
>> if there is an entry in /etc/fstab
>>
>> That is, something like:
>>
>> add)
>> mount /dev/$device
>> if [ $? ]; then
>> mkdir -p /mnt/$device
>> mount /dev/$device /mnt/$device
>> fi
>>
>
> The following now works. Consider it my first contribution to Ben NanoNote:
>
> Where's the SVN tree?
>
> #!/bin/sh
>
> # Copyright (C) 2009 OpenWrt.org
>
> blkdev=`dirname $DEVPATH`
> if [ `basename $blkdev` != "block" ]; then
>
> device=`basename $DEVPATH`
> case "$ACTION" in
> add)
> mount /dev/$device
> if [ $? = 255 ]; then
> mkdir -p /mnt/$device
> mount /dev/$device /mnt/$device
> fi
> ;;
> remove)
> umount /dev/$device
> ;;
> esac
>
> fi
>
>
More information about the discussion
mailing list