/mnt/nand
mmc0: new high speed SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.68 GiB
mmcblk0: p1
/mnt/nand
crw-rw---- 1 root root 1, 1 Jan 2 23:39 /dev/mem
brw-rw---- 1 root root 179, 0 Jan 2 23:40 /dev/mmcblk0
brw-rw---- 1 root root 179, 1 Jan 2 23:40 /dev/mmcblk0p1
crw-rw---- 1 root root 90, 0 Jan 2 23:39 /dev/mtd0
crw-rw---- 1 root root 90, 1 Jan 2 23:39 /dev/mtd0ro
crw-rw---- 1 root root 90, 2 Jan 2 23:39 /dev/mtd1
crw-rw---- 1 root root 90, 3 Jan 2 23:39 /dev/mtd1ro
crw-rw---- 1 root root 90, 4 Jan 2 23:39 /dev/mtd2
crw-rw---- 1 root root 90, 5 Jan 2 23:39 /dev/mtd2ro
crw-rw---- 1 root root 90, 6 Jan 2 23:39 /dev/mtd3
crw-rw---- 1 root root 90, 7 Jan 2 23:39 /dev/mtd3ro
crw-rw---- 1 root root 90, 8 Jan 2 23:39 /dev/mtd4
crw-rw---- 1 root root 90, 9 Jan 2 23:39 /dev/mtd4ro
brw-rw---- 1 root root 31, 0 Jan 2 23:39 /dev/mtdblock0
brw-rw---- 1 root root 31, 1 Jan 2 23:39 /dev/mtdblock1
brw-rw---- 1 root root 31, 2 Jan 2 23:39 /dev/mtdblock2
brw-rw---- 1 root root 31, 3 Jan 2 23:39 /dev/mtdblock3
brw-rw---- 1 root root 31, 4 Jan 2 23:39 /dev/mtdblock4
/mnt/nand
·增加script “mdev.conf”(/etc/mdev.conf)
sd[a-z][0-9] 0:6 660 */path/automount.sh /tmp/vrecord/videoclips/
mmcblk[0-9]p[0-9] 0:6 660 */path/automount.sh /tmp/vrecord/videoclips/
·增加script “automount.sh”(/path/automount.sh)
destdir=$1
my_umount()
{
if grep -qs "^/dev/$1 " /proc/mounts ; then
umount "${destdir}";
fi
[ -d "${destdir}/$1" ] && rmdir "${destdir}"
}
my_mount()
{
mkdir -p "${destdir}" || exit 1
usleep(20)
if [ -e /dev/${1}p1 ]; then
devname=${1}p1
else
devname=${1}
fi
if ! mount -t auto -o sync "/dev/$1" "${destdir}"; then
rmdir "${destdir}"
exit 1
fi
}
case "${ACTION}" in
add|"")
my_umount ${MDEV}
my_mount ${MDEV}
;;
remove)
my_umount ${MDEV}
;;
esac
|