1 2 2.6 Kernels 3 4The following examples demonstrate usage for one-time hardware detection. 5 6Recommended usage for InitRD, if you do not have any modules you want to 7load manually: 8--- 9hotplug2 --no-persistent --coldplug 10------ 11 12Recommended usage for InitRD, if you have modules you want to load manually: 13--- 14#!/bin/sh 15 16echo "Starting detection" 17 18hotplug2 --persistent --coldplug & 19modprobe module1 20modprobe module2 21modprobe module3 22killall -USR1 hotplug2 23wait 24 25echo "Detection over" 26------ 27 28Please note that if you run hotplug2 and udevd simultaneously, both will 29suffer significant slowdown. 30 31To have hotplug2 running permanently and perform coldplug, run: 32hotplug2 --persistent --coldplug 33 34(note that hotplug2 will not daemonize itself, you have to use an equivalent 35to Debian's start-stop-daemon, or otherwise ensure it daemonizes) 36 37The suggested base rules are in /examples. 38 39 40 2.4 Kernels 41 42Since 0.8, hotplug2 provides a trivial binary "hotplug2-dnode" that forwards 43events taken from the obsolete /proc/sys/kernel/hotplug interface into netlink 44formatted as uevents, so that hotplug2 (or possibly also udev) can read them 45and work with them. 46 47The hotplug2-dnode application also creates MODALIAS variable if missing and 48if it can be created. 49 50You enable the support by: 51 echo /sbin/hotplug2-dnode > /proc/sys/kernel/hotplug 52 53Please 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 55PCI and USB devices. It works on 2.6 kernels as well, but "udevtrigger" does 56the job far better. 57 58Therefore, run hotplug2 using this command: 59 hotplug2 [your usual params] --set-coldplug-cmd /path/to/hotplug2-coldplug-2.4 60 61To simplify loading of modules, using the MODALIAS variable, you have to 62generate module aliases for your modules out of the busmaps. To do this, the 63application "generate_alias" has been written. 64 65Usage of generate_alias: 66 generate_alias --prefix /lib/modules/`uname -r` \ 67 --output /lib/modules/`uname -r`/modules.alias 68 69Now, you can use hotplug2 with MODALIAS like on 2.6. See the base rules in 70the /examples directory. 71 72 73To revise the steps, shortly: 74 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 82 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) 85 86 * That's it, you're done! 87 88Please note that 2.4 support has not been thoroughly tested. Report bugs, 89send patches. 90