Mail: bookworepeng@Hotmail.com
Qq: 196568501
Author: Driver Monkey
Phone: 13410905075
1. Compile the mdev function into busybox
Linux System Utilities --->
[*] Mdev
[*] Support/etc/mdev. conf
[*] Support command execution at device addition/removal
2. Create a busybox connection file/sbin/mdev
3. Create the mdev. conf file
Sd [a-z] [0-9] 0: 0 0660 @/etc/hotplug/usb/udisk_insert
SD [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. Write insert and unplugging script insert script:/etc/hotplug/usb/udisk_insert
#! /Bin/sh
Echo "mdev is $ {mdev }"
If [-D/sys/block/*/$ mdev]; then
Mkdir-P/Media/udisk
Mount/dev/$ mdev/Media/udisk-T vfat-O utf8 = 1
If [-F/Media/udisk]; then
Echo "Mount udisk usccessfully"
Fi
Fi
Unplugging Script:/etc/hotplug/USB/udisk_remove
#! /Bin/sh
Umount-LTF/Media/udisk
Rm-RF/Media/udisk
Echo "remove you udisk safely! "