[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

An initrd proposal

On Mon, Oct 18, 1999 at 11:02:42PM +0200, Goswin Brederlow wrote:
> Now the bad bits:
> Its all to big and wont fit onto one disk. The 2.2.12 kernel is a
> little bigger than the 2.0.36 on the slink rescue disk (namely 433003
> Byte) and a 4 Mb ramdisk containing the common modules takes more than 
> 1 MB as gzip file.
You also lose a noticeable amount of space by compiling the drivers as a
module. A driver compiled into the kernel is (wild guess) 80% smaller
than the necessary file on the ramdisk (both compressed of course)

Using a modular kernel and initrd does not per se solve our problems with
space constraints, in the contrary: it will enlarge the boot disk.

Trying to be systematic, there are 4 stages in the installation process:
1) boot by BIOS or other firmware
   - loads the kernel and an initial ramdisk
   - boots the kernel
   - the kernel mounts /dev/ram as root, containing the initial ramdisk
2) get the installation binaries
   - load necessary modules
   - configure userspace programs if necessary
   - access the medium
   - get a single archive from the medium and unpack it to the ramdisk
3) run the installation process
   - partition harddisk
   - configure access to the medium where the base system can be installed
   - install the base system
   - reboot
4) - configure access to the medium where the rest of the system will be
     installed from
   - install the rest of debian

This means there are 4 media involved, one for bootimage, installation
binaries, base system and the whole instllation archive. These may all be
different but don't need to be of course.

AFAIK (and please correct me someone if I'm wrong here) these are all boot
media currently available
1.1) floppy
1.2) cdrom
1.3) network
1.4) harddisk
1.5) other removeable media such as LS-120 floppys, ZIP floppys, ..
Of these only 1), 2) and maybe 5) have noticeable constraints on the
the size of the bootimage, which needs to contain the kernel and the
initial ramdisk, i.e. it's 1440k for 1) and maybe 5) and 2880k for 2)

To do something useful in 2), we will need at least a shell, an init
program and the c library (unless we use only static binaries which I doubt
would save us something and is too unflexible anyway) We probably want a
user interface at this point so an ncurses library is necessary.
All this together with the modules to access the installation binaries
needs to fit on the bootimage. Let me show how this is possible:

Using the current 2.2.12ac13 kernel I made a completely
modular kernel containing ram disk and initrd only and ext2fs only):

vmlinuz      340705 (this is i386, what about other archs?)
libc6 dll    425126 (gzip -9, current 2.1 version)
ld-linux dll 104465 (gzip -9, current 2.1 version)
ncurses dll   96797 (gzip -9, current 4.2 version)
ash           30222

This leaves about 460k room on a 1440MB floppy (which is the
smallest sized boot media currently available, I think we dropped 5 1/4"
boot floppies already) This is not enough to support all media that might be
needed to complete step 2 but:

- IDE hd and cdrom, floppy, common PCI SCSI adapter and scsi hd and cdrom
  should fit(*), covering 90% of the cases.
  Note that this makes a single floppy or no floppy install possible
  for most cases.
- A completely different initrd for network installs could contain
  all network drivers and network filesystems. It wouldn't need any
  disk modules because it could get them from the network as well
- For old low memory machines we could construct another initrd image
  containing enough to access the harddisk and create a swap partition.

The relevant modules for step 2) are: Filesystems, SCSI and IDE drivers,
network device drivers, network protocol drivers (note that ipv4 is compiled
into above mentioned kernel), ISDN, serial, parallel, infrared and tape
drivers and we will need USB and PCMCIA support too plus necessary drivers.
The only drivers I don't think anyone will get installation binaries from
(now and in the foreseable future) are sound, joystick, Amateur Radio,
and Framegrabber.

Note that we do *not* need to install the base system
at this point, we only need to get access to enough hardware to be able to
start the installation process.

The real savings of this approach consist in delaying all tools to setup
and partition the harddisk or the network until another medium then the boot
medium is available for downloading binaries.

The other part of the savings comes at a price: Different bootdisks for
different methods of bootstrapping the installation. But keep in mind that
most of the common cases could still be accomodated with a single image an
no or one floppy. And it allows us to support even difficult installations
on e.g. a laptop booting from an unsupported USB floppy where the only way
to get further data is using an PCMCIA scsi adapter. 400k (let 60k be fs
overhead) should be enough for all userspace daemons and modules needed in a
specific case.


(*) I included AM53C974, BusLogic, advansys, aic8xxx, initio, ncr53c8xx,
and tmscsim hoping not to upset too many people, and the ide and floppy
stuff. That makes approx. 300k compressed.

Plug-and-Play is really nice, unfortunately it only works 50% of the time.
To be specific the "Plug" almost always works.            --unknown source

Attachment: pgp2SrlpG7oUB.pgp
Description: PGP signature

Reply to: