--- trunk/mkinitrd-magellan/busybox/docs/mdev.txt 2010/04/29 20:38:48 983 +++ trunk/mkinitrd-magellan/busybox/docs/mdev.txt 2010/05/30 11:32:42 984 @@ -17,12 +17,12 @@ Here's a typical code snippet from the init script: [0] mount -t proc proc /proc [1] mount -t sysfs sysfs /sys -[2] echo /bin/mdev > /proc/sys/kernel/hotplug +[2] echo /sbin/mdev > /proc/sys/kernel/hotplug [3] mdev -s Alternatively, without procfs the above becomes: [1] mount -t sysfs sysfs /sys -[2] sysctl -w kernel.hotplug=/bin/mdev +[2] sysctl -w kernel.hotplug=/sbin/mdev [3] mdev -s @@ -33,7 +33,7 @@ [6] mount -t devpts devpts /dev/pts The simple explanation here is that [1] you need to have /sys mounted before -executing mdev. Then you [2] instruct the kernel to execute /bin/mdev whenever +executing mdev. Then you [2] instruct the kernel to execute /sbin/mdev whenever a device is added or removed so that the device node can be created or destroyed. Then you [3] seed /dev with all the device nodes that were created while the system was booting. @@ -79,6 +79,18 @@ : [=path] [@|$|*] or : [>path] [@|$|*] + +For example: +---8<--- +# block devices +([hs]d[a-z]) root:disk 660 >disk/%1/0 +([hs]d[a-z])([0-9]+) root:disk 660 >disk/%1/%2 +mmcblk([0-9]+) root:disk 660 >disk/mmc/%1/0 +mmcblk([0-9]+)p([0-9]+) root:disk 660 >disk/mmc/%1/%2 +# network devices +(tun|tap) root:network 660 >net/%1 +---8<--- + The special characters have the meaning: @ Run after creating the device. $ Run before removing the device. @@ -122,6 +134,6 @@ If you want to activate this feature, execute "echo >/dev/mdev.seq" prior to setting mdev to be the hotplug handler. This writes single '\n' to the file. -NB: mdev recognizes /dev/mdev.seq consisting of single '\n' characher +NB: mdev recognizes /dev/mdev.seq consisting of single '\n' character as a special case. IOW: this will not make your first hotplug event to stall for two seconds.