UdevRoadmap

Differences between revisions 13 and 15 (spanning 2 versions)
Revision 13 as of 2005-11-05 16:51:22
Size: 3975
Editor: 209
Comment: Review, minor wording fixes
Revision 15 as of 2005-11-05 20:43:02
Size: 4166
Editor: 209
Comment: redraft
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 * '''Packages affected''': initramfs-tools, hotplug, udev, klibc, linux-image-*, modutils  * '''Packages affected''': initramfs-tools, hotplug, grepmap, udev, klibc, linux-image-*, modutils
Line 10: Line 10:
Upgrading from udev 060 to 071 is a major change that affects initramfs, udev, hotplug, hal, and many other pieces. The 2.6.15 kernel will require udev 071. Because these changes are invasive, this spec is split out from HardwareDetection to make sure that it can be reviewed and implemented independantly. As discussed in HardwareDetection there are many compelling reasons to select both the 2.6.15 kernel and the required udev 071 for our hardware-detection needs. The upgrade from the current udev 060 is a major change that affects many packages currently in the archive, some requiring changes and some become deprecated.
Line 12: Line 12:
== Rationale ==

 * Many components of the Linux system will require a newer udev. These include ProbeForRootFilesystem, LinuxKernelRoadmap, and HardwareDetection.

== Scope ==

This is an implementation for Dapper.

Newer versions of udev affect the following packages:

 * initramfs-tools

 * hotplug

 * klibc

 * hal

 * linux-image-*

 * modutils
This spec outlines a roadmap of changes required.
Line 36: Line 16:
=== initramfs === === klibc ===
Line 38: Line 18:
Update the initramfs startup sequence to reflect the following:

 * Create base device nodes
 * Start udevd
 * Load modules from /etc/mkinitramfs/modules (and other force_load calls)

''' Note: without udevstart, something needs to correct permissions, or we need to provide the rules. '''

 * Walk the pci sysfs tree for harddrive devices and tickle uevents for those.

   Code to do this is mapped out in HardwareActivation.

 * Walk the ide, scsi, and i2o busses

 * Attempt hibernate recovery

''' Note: The Ubuntu kernel doesn't reliably support resuming from hibernate with removable devices. '''

 * Walk the pci sysfs tree for usb and ieee1394 controllers

 * Walk the ide, scsi, and i2o busses again for root devices on removable busses.

 * Chain to full userspace.
 * Update to most recent version and use to compile tools (like udev) that will be placed in the initramfs.
Line 64: Line 22:
 * Upgrade to udev-071 plus current git patches.  * Update or repackage udev to the latest version from upstream (071).
 * There are some more recent changes in the git repository that provide caching of the udev rules and further volume UUID support (that would be nice for ProbeForRootFilesystem); so we'll pull these and add them to the package.
Line 66: Line 25:
''' Git patches after 071 cause the rules to be cached. It's best to just accomodate this now. Current git patches also add more man pages, and some extra needed UUID support. ''' As discussed in HardwareActivation:
 * Implement udevd scoreboard
 * Implement udevplug
Line 68: Line 29:
 * Implement scroreboard from HardwareActivation
 * Implement udevplug from HardwareActivation
 * Mark udev as Provides, Conflicts, Replaces for hotplug
 * The new udev package will Provide, Conflict and Replace the old hotplug package.
 * Ensure that during upgrade hotplug configuration is cleaned away, and the init script disabled.
 * As discussed in NetworkMagic, move the network agent from hotplug to ifupdown.
 * Move blacklists and isapnp alias map from hotplug package to udev. These will continue to be maintained with new entries added as necessary.
Line 72: Line 34:
 * Add udev rules to put USB Devices in /dev/bus/usb.
 
 * Move the existing isapnp maps from hotplug and put them in udev. Continue to update them as we discover more devices that need to go in.
 * Add new udev rules to replace `usbfs` with `/dev/bus/usb`.
Line 79: Line 38:
 * Ask the ftpmasters to remove from the archive.  * Ask the ftpmasters to eject it from the archive like the bitch it is.
Line 83: Line 42:
 * Upgrade modutils to recent version to get blacklisting support.  * Upgrade to most recent version to ensure we have the best alias and blacklist support.
Line 85: Line 44:
=== klibc === === grepmap ===
Line 87: Line 46:
 * udev should be compiled against a recent version of klibc for tiny initramfs images  * Ask the ftpmasters to gently lay it to rest in the morgue, and plant a flower on its chest.
Line 89: Line 48:
=== full userspace init scripts === === initramfs ===
Line 91: Line 50:
 * As soon as full userspace has started, need to tell udev to reread all of the rulesets. Update the initramfs to take advantage of the new cold-plugging system described in HardwareDetection:
Line 93: Line 52:
 * Where udevstart and coldplugging routines are currently started, ensure that udevd is running (in case of custom kernels), and pass over entire sysfs tree to cause events to be rerun. This will ensure that device nodes are created with correct permissions and according to the rules of the running system.  * Mount virtual filesystems.
 * Start udevd to handle device node creation, etc.
 * Create base device nodes by tickling the parts of `/sys` that reflect the platform.
 * Load essential modules from `/etc/mkinitramfs/modules` (and other `force_load` calls).
 * Walk the PCI `/sys` tree for hard-drive devices and tickle those, also tickle the IDE, SCSI and i2o buses. Other buses aren't known to contain drives we support for the root filesystem.
 * Attempt hibernate recovery.
 * Walk the PCI, USB and ieee1394 trees to locate controllers and hubs, for both removable devices and keyboards.
 * Mount root filesystem and switch to userspace.

=== User space ===

 * Replace the initial `S02mountvirtfs` and `S04udev` scripts with a single script that checks whether the initramfs was run, and if not mounts virtual filesystems and prepares `/dev`.
 * Start udevd if not running, or instruct the running udevd to reload the rules and add a new inotify watch on the real filesystem.
 * Walk the entire `/sys` tree and tickle all events; this will not only cold-plug all of the hardware, but adjust the permissions of anything created in the initramfs.

Summary

As discussed in HardwareDetection there are many compelling reasons to select both the 2.6.15 kernel and the required udev 071 for our hardware-detection needs. The upgrade from the current udev 060 is a major change that affects many packages currently in the archive, some requiring changes and some become deprecated.

This spec outlines a roadmap of changes required.

Implementation

klibc

  • Update to most recent version and use to compile tools (like udev) that will be placed in the initramfs.

udev

  • Update or repackage udev to the latest version from upstream (071).
  • There are some more recent changes in the git repository that provide caching of the udev rules and further volume UUID support (that would be nice for ProbeForRootFilesystem); so we'll pull these and add them to the package.

As discussed in HardwareActivation:

  • Implement udevd scoreboard
  • Implement udevplug
  • The new udev package will Provide, Conflict and Replace the old hotplug package.
  • Ensure that during upgrade hotplug configuration is cleaned away, and the init script disabled.
  • As discussed in NetworkMagic, move the network agent from hotplug to ifupdown.

  • Move blacklists and isapnp alias map from hotplug package to udev. These will continue to be maintained with new entries added as necessary.
  • Add new udev rules to replace usbfs with /dev/bus/usb.

hotplug

  • Ask the ftpmasters to eject it from the archive like the bitch it is.

modutils

  • Upgrade to most recent version to ensure we have the best alias and blacklist support.

grepmap

  • Ask the ftpmasters to gently lay it to rest in the morgue, and plant a flower on its chest.

initramfs

Update the initramfs to take advantage of the new cold-plugging system described in HardwareDetection:

  • Mount virtual filesystems.
  • Start udevd to handle device node creation, etc.
  • Create base device nodes by tickling the parts of /sys that reflect the platform.

  • Load essential modules from /etc/mkinitramfs/modules (and other force_load calls).

  • Walk the PCI /sys tree for hard-drive devices and tickle those, also tickle the IDE, SCSI and i2o buses. Other buses aren't known to contain drives we support for the root filesystem.

  • Attempt hibernate recovery.
  • Walk the PCI, USB and ieee1394 trees to locate controllers and hubs, for both removable devices and keyboards.
  • Mount root filesystem and switch to userspace.

User space

  • Replace the initial S02mountvirtfs and S04udev scripts with a single script that checks whether the initramfs was run, and if not mounts virtual filesystems and prepares /dev.

  • Start udevd if not running, or instruct the running udevd to reload the rules and add a new inotify watch on the real filesystem.
  • Walk the entire /sys tree and tickle all events; this will not only cold-plug all of the hardware, but adjust the permissions of anything created in the initramfs.

Data preservation and migration

Custom-written hotplug rules will need to be migrated to be udev rules. There is no way to do this in an automated fashion.

Outstanding issues

Rebooting the system shortly after the upgrade is critical. It is quite likely that hal will stop working, and the rules that are on the harddrive may then be completely incompatible. The cute little lightbulb "Please click on me for a message" in the corner is probably insufficiently invasive to make sure this happens. That notification applet should be refered to mpt for a case of the mean-and-ugly treatment. This is out of scope for this spec.

This spec has been created as https://launchpad.net/distros/ubuntu/+spec/urgent-reboot-notification

UdevRoadmap (last edited 2008-08-06 16:16:48 by localhost)