Merge branch 'Teaman-ND' into Teaman-RT
[tomato.git] / release / src / router / hotplug2 / docs / Usage
blob421bb15205bee5d7a72759b7d8fbeca71422785c
2   2.6 Kernels
4 The following examples demonstrate usage for one-time hardware detection.
6 Recommended usage for InitRD, if you do not have any modules you want to
7 load manually:
8 ---
9 hotplug2 --no-persistent --coldplug
10 ------
12 Recommended usage for InitRD, if you have modules you want to load manually:
13 ---
14 #!/bin/sh
16 echo "Starting detection"
18 hotplug2 --persistent --coldplug &
19 modprobe module1
20 modprobe module2
21 modprobe module3
22 killall -USR1 hotplug2
23 wait
25 echo "Detection over"
26 ------
28 Please note that if you run hotplug2 and udevd simultaneously, both will
29 suffer significant slowdown.
31 To have hotplug2 running permanently and perform coldplug, run:
32 hotplug2 --persistent --coldplug
34 (note that hotplug2 will not daemonize itself, you have to use an equivalent
35 to Debian's start-stop-daemon, or otherwise ensure it daemonizes)
37 The suggested base rules are in /examples.
40   2.4 Kernels
42 Since 0.8, hotplug2 provides a trivial binary "hotplug2-dnode" that forwards 
43 events taken from  the obsolete /proc/sys/kernel/hotplug interface into netlink
44 formatted as uevents, so that hotplug2 (or possibly also udev) can read them
45 and work with them.
47 The hotplug2-dnode application also creates MODALIAS variable if missing and
48 if it can be created.
50 You enable the support by:
51  echo /sbin/hotplug2-dnode > /proc/sys/kernel/hotplug
53 Please note that udevtrigger will not work for 2.4 kernels. For this reason,
54 "hotplug2-coldplug-2.4" application is provided; it handles coldplugging of
55 PCI and USB devices. It works on 2.6 kernels as well, but "udevtrigger" does
56 the job far better.
58 Therefore, run hotplug2 using this command:
59  hotplug2 [your usual params] --set-coldplug-cmd /path/to/hotplug2-coldplug-2.4
61 To simplify loading of modules, using the MODALIAS variable, you have to
62 generate module aliases for your modules out of the busmaps. To do this, the
63 application "generate_alias" has been written.
65 Usage of generate_alias:
66  generate_alias --prefix /lib/modules/`uname -r` \
67         --output /lib/modules/`uname -r`/modules.alias
69 Now, you can use hotplug2 with MODALIAS like on 2.6. See the base rules in 
70 the /examples directory.
73 To revise the steps, shortly:
75  * After a new installation of a 2.4 kernel, run generate_alias:
76  generate_alias --prefix /lib/modules/`uname -r` \
77         --output /lib/modules/`uname -r`/modules.alias
78         
79  * In your init script, run:
80  echo /sbin/hotplug2-dnode > /proc/sys/kernel/hotplug
81  hotplug2 --persistent --set-coldplug-cmd /sbin/hotplug2-coldplug-2.4
83  (note that hotplug2 will not daemonize itself, you have to use an equivalent
84  to Debian's start-stop-daemon, or otherwise ensure it daemonizes)
86  * That's it, you're done!
88 Please note that 2.4 support has not been thoroughly tested. Report bugs,
89 send patches.