1
2  Introduction
3
4The Linux 2.4 hotplug interface works by executing binary whose path is written
5in /proc/sys/kernel/hotplug. This design has been abandoned for obvious 
6reason: if one gets too many events simultaneously, running out of resources
7is a significant risk.
8
9For this reason, udev and hotplug2 use netlink socket to read the events from
10kernel serially, and handle distribution of resources.
11
12However, this design has never been adopted by 2.4 Linux kernel series, and the
13obsolete method is still used. Since the hotplug subsystem of 2.4 is not as 
14advanced as the one of 2.6, it is not too much of an issue.
15
16For hotplug2, I have decided that 2.4 support would be reasonable. The 2.4 
17kernels support PF_NETLINK, however, kernel doesn't support sending of events
18through the netlink socket.
19
20The solution to this problem is a trivial application, hotplug2-dnode, which 
21is executed as the /proc/sys/kernel/hotplug application, processes the 
22environmental variables and arguments passed to it and sends it through 
23netlink so that the application on the other end (in this case, hotplug2) can 
24read it.
25
26
27  Why would we want serialization of events on 2.4, where hotplug is not as 
28  developed as on 2.6?
29
30Multiple scenarios come up in my mind:
31 * It may be desirable to be able to process events using rules, eg. skipping
32   some, executing an application for others.
33 * Serialization would help keeping resource demands low in resource constrained
34   environments.
35
36
37  What good does this do, while 2.4 doesn't have modalias?
38
39Although 2.4 does not have modalias internally, we can fake it. We can create
40modalias file (modules.alias) out of various bus maps (eg. modules.pcimap or 
41modules.isapnpmap). This will give us modaliases against which we can match 
42events. Since modutils do not use fnmatch, a trivial wrapping application
43has been written (hotplug2-modwrap) to allow matching against modalias.
44
45However, 2.4 hotplug interface doesn't export modaliases. Nevertheless, we can
46work this problem around as well. The hotplug2-dnode creates the correct
47modalias for the given event out of the informations provided.
48
49This allows us to use MODALIAS even on 2.4 series kernels.
50
51
52  Why do you create modalias with one hotplug2 application to match it with
53  another? Isn't this approach too indirect?
54
55Yes and no. Truth is, this approach is a bit indirect; on the other hand, it
56allows a way to identify hardware that is rather standardised within Linux and
57that is widely understood. Therefore, the benefits outweight the nearly
58negligible performance drawbacks.
59