EarlyUserspace

Revision 23 as of 2005-04-27 07:48:45

Clear message

UbuntuDevel/EarlyUserspace

Status

Introduction

Early UserSpace is defined as the time from when the kernel hands control over to userspace applications until the time that the full system init is called.

The kernel traditionally has included a lot of functionality that can be easily done in userspace. These include:

  • DHCP
  • NFS Root
  • devfs
  • Partition detection
  • Raid (md) detection
  • root filesystem mounting
  • Device detection.

Many of these items are called using the prepare_namepace() call in the kernel. When using an initramfs solution, the prepare_namespace() call is skipped, and a normal user binary is called to complete the setup which is responsible for chaining to the full system init.

Rationale

Upstream is moving towards this solution. Some features, such as devfs are scheduled for removal in a very short period of time. Writing kernel code is difficult, since each feature causes bloat that is included in every generic Ubuntu kernel and also bugs in each new function can cause a kernel compromise. Debugging these functions is hard because the code is seldomly used, and kgdb is suboptimal.

The current initrd-based solution is problematic because it relies on black magic to migrate kernel threads from the initial root to the new root (pivot_root syscall). The initramfs solves this in a more elegant fashion.

Right now there are three boot cases, two of which are unified: the Live CD and the Installer. Actual system bootup is hardcoded, which occasionally results in a system that is installed but cannot boot.

Hotplug-ng is the hotplug of choice because it is written by the author of udev and klibc for the purposes of early userspace.

Scope and Use Cases

  • NFSRoot (and LTSP)
  • Booting
  • Firewire / USB Rescue System (USB on a stick in general)
  • Rapid development cycle
  • Support hardware reconfiguration
  • Remote rescue

Implementation Plan

Breezy Targets:

  • Update klibc and udev to recent version from current packages (http://people.ubuntu.com/~jbailey/) and upload to Breezy.

  • Create archives of kernel modules for inclusion in initramfs
  • Tweak kernel packaging to help mkinitramfs
  • Add ability to concatenate CPIO files to grub1
  • Package hotplug-ng and add to initramfs
  • Expand initramfs-tools with various hooks for evms and lvm

Post-Breezy Targets:

  • User space partition detection and partition label/UUID handling.

Data Preservation and Migration

This process unifies the boot process with that of the installer. Unfortunately, systems that were customised after mkinitrd was originally installed may find their system no longer bootable due to changes in the boot order.

Packages Affected

  • udev

  • hotplug-ng

  • klibc

  • linux-*

  • evms

  • lvm

  • usplash

  • grub

User Interface Requirements

Should be able to drop into rescue shell on error, or by choice. Must be usplash-friendly.

On catastrophic failure, enough debug information should be provided to allow an adequate bug report to be filed.

Outstanding Issues

  • grub version 1 is no longer actively developed upstream, so updates will be Ubuntu specific (although Debian will likely accept them). There is a version 2 which is a total rewrite and which may be viable in the Breezy+1 timeframe.
  • Coordination with the Debian Kernel Team.
  • Partition Detection is defered until post-Breezy to ensure that the system is stable and generally functional. Because it's not core functionality, it may be a good candidate for a bounty.

UDU BOF Agenda

UDU Pre-Work