Matthew Burgess wrote:
Andrew Benton wrote:
so do we need the hotplug scripts? Will they ever be used for
anything? Is it ever called?
I don't think all device subsystems are udev-compatible at the moment
(the 'input' subsystem rings a bell here). Additionally, I don't think
we handle 'coldplug' events correctly, somewhat ironically, without the
'hotplug' scripts around. Alexander will no doubt correct me on the
above though :)
Well, the main two reasons for including hotplug were:
1) Coldplugging (this includes not only loading modules, but also
setting permissions on /proc/bus/usb/xxx/yyy by e.g. SANE and gPhoto2 --
but BLFS uses the "usb" group hack instead of those hotplug handlers)
2) Hotplugging.
Hotplugging can be done by Udev now, and it calls
/etc/hotplug.d/whatever just as good old /sbin/hotplug did. But in
/etc/hotplug.d are scripts from the Hotplug package (they calll agents
in /etc/hotplug). Of course they can be replaced with udev rules from
hotplug-light, http://www.bofh.it/~md/debian/ (requires linux >= 2.6.12,
for installation instructions view debian/rules)
Coldplugging is a bit more problematic. hotplug-light does load modules,
but does not recreate USB hotplug events correctly. This breaks
chmodding pseudofiles in /proc/bus/usb/xxx/yyy when USB host controller
is compiled as a non-module, and thus it will make my scanner
inaccessible for non-root when BLFS finally moves from the obsolete
"usb" group hack to the proper hotplug handlers.
There are two solutions discussed not long ago upstream. One is to make
an initramfs that captures all early hotplug events, starting from the
event with SEQNUM=0, and then replays those events when the root fs is
mounted (basically, a better reimplementation of
http://bugs.linuxfromscratch.org/show_bug.cgi?id=868 ). This is already
available with recent udev releases. In this approach, there's no
concept of coldplugging at all. The downside is that races are almost
unavoidable.
Another solution is to put event replaying logic into udevstart. The
downside is that approach is fragile WRT changes in the correspondence
between hotplug variable names and sysfs attributes. Also, there were
some objections on the list, like "this is not the task of udevstart,
please at least put it into a separate binary". Noe that there's no
implementation of this in the existing udev versions.
As for the input susbystem calling /sbin/hotplug directly and not
duplicating events on the netlink socket, that's OK if you don't rely
upon input module autoloading (e.g. for psmouse).
Back to the original question: Hotplug is not needed for a minimal
system. Its use in LFS is limited to hardware detection facilities
(compare /etc/sysconfig/modules in LFS-6.1 with LFS-6.0), and BLFS
doesn't use hotplug yet. But it is useful.
--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page