Accepted debian-installer 20041118ubuntu2 (source)

Kristof Vansant de_lupus at pandora.be
Tue Nov 23 15:19:16 CST 2004


Aren't there plans to replace /sbin/hotplug by udevd??

I saw this on the hotplug mailinglist and it looks nice :) :

Date: Thu, 18 Nov 2004 01:27:26 +0100
From: Kay Sievers <kay.sievers at vrfy.org>
To: hotplug <linux-hotplug-devel at lists.sourceforge.net>
Cc: Greg KH <greg at kroah.com>
Subject: [adventure] replace /sbin/hotplug by udevd


--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

!!! Please, don't try this if you don't know how to bring your      !!!
!!! system back if it does not boot anymore cause of a broken udev. !!!

This experimental patch changes udevd/udev to handle the _whole_ hotplug
event from the kernel up to the multiplexing of /etc/hotplug.d/. It
should solve most of the current shortcomings of the hotplug event
handling:
  - sysfs if not fully populated at event time
  - at device disconnect/reconnect, the "remove" may beat the "add"
  - an event may already work on the same DEVPATH
  - the hotplug scripts don't know the device node name
  - the total count of event processes can't be controlled

The architecture is very similar to udevd today, only that we wait for
_all_ sysfs devices internally and then also calls /etc/hotplug/* from
the forked udev process.

/sbin/hotplug is replaced by /sbin/udevsend. The kernel just calls this
small binary to place the event into the udevd daemon. We may also use
the netlink uevent in the future, so no fork at all is done from the
kernel for a hotplug event.

The daemon listens, reorders events and forks an instance for every
event,
which:
   -waits for sysfs (also for /sys/devices/*)
   -creates/removes the device node
   -exports interesting values to its environment
   -calls/multiplexes /etc/hotplug.d/*
   -calls/multiplexes /etc/dev.d/* (we don't really need that anymore)
   -exits

This way get all what todays hotplug events can dream of:
   -fully populated sysfs
   -events in the right order (SEQNUM)
   -delayed events for the _same_ DEVPATH, all others run in parallel
   -all interesting values to the environment
   -device node ready and its name available
   -possibly limit the total count of events processes (not implemented
now)

One single hotplug event for the creation of a partition now looks like
this:
  ACTION=add
  SUBSYSTEM=block
  DEVPATH=/block/sda/sda1
  SEQNUM=1027
  DEVNAME=/dev/sda1

PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host0/target0:0:0/0:0:0:0
  PHYSDEVBUS=scsi
  PHYSDEVDRIVER=sd


This patch applies on top of udev v045. /proc/sys/kernel/hotplug should
be
set to /sbin/udevsend.

Any thoughts,
Kay


On Tue, 2004-11-23 at 20:40 +0000, Colin Watson wrote:
> On Tue, Nov 23, 2004 at 08:25:02PM +0000, Colin Watson wrote:
> >  debian-installer (20041118ubuntu2) hoary; urgency=low
> >  .
> >    * Remove discover from the initrds and rely entirely on hotplug. Let's see
> >      how much this breaks ...
> 
> I expect this to make the installer extremely unstable and possibly
> unusable for a while on a variety of hardware. We may well need a number
> of kernel patches to make sure that hotplug detects everything that
> discover did, and almost certainly further code changes in the vicinity
> of ddetect. Framebuffer problems at boot time are a distinct
> possibility, and annoyingly hard to reproduce. Also, I believe that the
> d-i feature of allowing you to supply module parameters in expert mode
> no longer works, since hotplug loads modules directly and it's
> fundamentally very difficult to hook into this; ideas welcome.
> 
> Still, better to get the breakage in early ...
> 
> Cheers,
> 
> -- 
> Colin Watson                                    [cjwatson at canonical.com]
> 

PS: there also is a patch against udevd 046 on the mailing list maybe
interresting to try out :)

-- 
lupusBE (Kristof Vansant Belgium)




More information about the ubuntu-devel mailing list