4 The Linux 2.4 hotplug interface works by executing binary whose path is written
5 in /proc/sys/kernel/hotplug. This design has been abandoned for obvious
6 reason: if one gets too many events simultaneously, running out of resources
9 For this reason, udev and hotplug2 use netlink socket to read the events from
10 kernel serially, and handle distribution of resources.
12 However, this design has never been adopted by 2.4 Linux kernel series, and the
13 obsolete method is still used. Since the hotplug subsystem of 2.4 is not as
14 advanced as the one of 2.6, it is not too much of an issue.
16 For hotplug2, I have decided that 2.4 support would be reasonable. The 2.4
17 kernels support PF_NETLINK, however, kernel doesn't support sending of events
18 through the netlink socket.
20 The solution to this problem is a trivial application, hotplug2-dnode, which
21 is executed as the /proc/sys/kernel/hotplug application, processes the
22 environmental variables and arguments passed to it and sends it through
23 netlink so that the application on the other end (in this case, hotplug2) can
27 Why would we want serialization of events on 2.4, where hotplug is not as
30 Multiple 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
37 What good does this do, while 2.4 doesn't have modalias?
39 Although 2.4 does not have modalias internally, we can fake it. We can create
40 modalias file (modules.alias) out of various bus maps (eg. modules.pcimap or
41 modules.isapnpmap). This will give us modaliases against which we can match
42 events. Since modutils do not use fnmatch, a trivial wrapping application
43 has been written (hotplug2-modwrap) to allow matching against modalias.
45 However, 2.4 hotplug interface doesn't export modaliases. Nevertheless, we can
46 work this problem around as well. The hotplug2-dnode creates the correct
47 modalias for the given event out of the informations provided.
49 This allows us to use MODALIAS even on 2.4 series kernels.
52 Why do you create modalias with one hotplug2 application to match it with
53 another? Isn't this approach too indirect?
55 Yes and no. Truth is, this approach is a bit indirect; on the other hand, it
56 allows a way to identify hardware that is rather standardised within Linux and
57 that is widely understood. Therefore, the benefits outweight the nearly
58 negligible performance drawbacks.