Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/docs/mdev.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 17  updates, you also need to have hotpluggi Line 17  updates, you also need to have hotpluggi
17  Here's a typical code snippet from the init script:  Here's a typical code snippet from the init script:
18  [0] mount -t proc proc /proc  [0] mount -t proc proc /proc
19  [1] mount -t sysfs sysfs /sys  [1] mount -t sysfs sysfs /sys
20  [2] echo /bin/mdev > /proc/sys/kernel/hotplug  [2] echo /sbin/mdev > /proc/sys/kernel/hotplug
21  [3] mdev -s  [3] mdev -s
22    
23  Alternatively, without procfs the above becomes:  Alternatively, without procfs the above becomes:
24  [1] mount -t sysfs sysfs /sys  [1] mount -t sysfs sysfs /sys
25  [2] sysctl -w kernel.hotplug=/bin/mdev  [2] sysctl -w kernel.hotplug=/sbin/mdev
26  [3] mdev -s  [3] mdev -s
27    
28    
# Line 33  code snippet: Line 33  code snippet:
33  [6] mount -t devpts devpts /dev/pts  [6] mount -t devpts devpts /dev/pts
34    
35  The simple explanation here is that [1] you need to have /sys mounted before  The simple explanation here is that [1] you need to have /sys mounted before
36  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
37  a device is added or removed so that the device node can be created or  a device is added or removed so that the device node can be created or
38  destroyed.  Then you [3] seed /dev with all the device nodes that were created  destroyed.  Then you [3] seed /dev with all the device nodes that were created
39  while the system was booting.  while the system was booting.
# Line 79  the format: Line 79  the format:
79   <device regex> <uid>:<gid> <octal permissions> [=path] [@|$|*<command>]   <device regex> <uid>:<gid> <octal permissions> [=path] [@|$|*<command>]
80      or      or
81   <device regex> <uid>:<gid> <octal permissions> [>path] [@|$|*<command>]   <device regex> <uid>:<gid> <octal permissions> [>path] [@|$|*<command>]
82    
83    For example:
84    ---8<---
85    # block devices
86    ([hs]d[a-z]) root:disk 660 >disk/%1/0
87    ([hs]d[a-z])([0-9]+) root:disk 660 >disk/%1/%2
88    mmcblk([0-9]+) root:disk 660 >disk/mmc/%1/0
89    mmcblk([0-9]+)p([0-9]+) root:disk 660 >disk/mmc/%1/%2
90    # network devices
91    (tun|tap) root:network 660 >net/%1
92    ---8<---
93    
94  The special characters have the meaning:  The special characters have the meaning:
95   @ Run after creating the device.   @ Run after creating the device.
96   $ Run before removing the device.   $ Run before removing the device.
# Line 122  IOW: this will serialize concurrent mdev Line 134  IOW: this will serialize concurrent mdev
134    
135  If you want to activate this feature, execute "echo >/dev/mdev.seq" prior to  If you want to activate this feature, execute "echo >/dev/mdev.seq" prior to
136  setting mdev to be the hotplug handler. This writes single '\n' to the file.  setting mdev to be the hotplug handler. This writes single '\n' to the file.
137  NB: mdev recognizes /dev/mdev.seq consisting of single '\n' characher  NB: mdev recognizes /dev/mdev.seq consisting of single '\n' character
138  as a special case. IOW: this will not make your first hotplug event  as a special case. IOW: this will not make your first hotplug event
139  to stall for two seconds.  to stall for two seconds.

Legend:
Removed from v.983  
changed lines
  Added in v.984