Author: DriverMonkey
Mail: bookworepeng@hotmail.com
Qq: 196568501
Phone: 13410905075
-Welcome to the discussion
Testing hardware platform-am335x (linux 3.2)
Prerequisites: 1. busybox supports mdev
2. the kernel has reached the USB flash drive.
1) Ship-to-ship rcS script in the etc/init. d/directory
#! /bin/sh/bin/mount -a/bin/SDG800/etc/init.d/sysfs.sh
2) run the sysfs. sh script on the ship under the etc/init. d/directory.
#!/bin/shif [ -e /proc ] && ! [ -e /proc/mounts ]; then mount -t proc proc /procfiif [ -e /sys ] && ! [ -e /sys/kernel ] && grep -q sysfs /proc/filesystems; then mount sysfs /sys -t sysfsfimount -t tmpfs mdev /devmkdir /dev/ptsmount -t devpts devpts /dev/ptsecho /sbin/mdev>/proc/sys/kernel/hotplugmdev -sexit 0
3) Create the mdev configuration file under etc
sd[a-z][0-9] 0:0 0660 @/etc/hotplug/usb/udisk_insertsd[a-z] 0:0 0660 $/etc/hotplug/usb/udisk_remove#mmcblk[0-9]p[0-9] 0:0 0660 @/etc/hotplug/sd/sd_insert#mmcblk[0-9] 0:0 0660 $/etc/hotplug/sd/sd_remove
4) create a udisk_insert script file under/etc/hotplug/usb
#!/bin/shecho "MDEV is ${MDEV}"if [ -d /sys/block/*/$MDEV ] ; then mkdir -p /media/udisk mount /dev/$MDEV /media/udisk -t vfat -o utf8=1if [ -f /media/udisk ];thenecho "mount udisk usccessfully"fifi
Create a udisk_remove script file under/etc/hotplug/usb
#!/bin/shumount -ltf /media/udiskrm -rf /media/udiskecho "remove you udisk safely!"