What will the initrd image do when it is run during bootup ?

First of all, the kernel will load the /linuxrc file on the initrd image 
which controls the whole pre-boot procedure. The /linuxrc file is a simple
shell script that will start by displaying a message containing the contents
of the file /id.txt on the initrd image. Then it will mount the proc filesystem
and prepares a simple environment for the next steps (e.g. starting the syslogd
and klogd daemons so that expected error message won't get displayed on the
main system console, but insted be written to a file).
After that, there are two possible ways depending on the existance of the 
"boot=/dev/XXXX" parameter on the kernel command line:
- If this parameter was given to the kernel, the initrd image acts like a 
  rescue disk and tries to load all modules that are needed to access exactly 
  this partition. Currently, it can distinguish between IDE and SCSI devices 
  and loads the appropriate modules if the kernel does not support the devices 
  natively. It also tries to load the reiser filesystem module if the partition 
  can not be mounted with the ext2 filesystem (and possible ext3, xfs or other
  filesystem modules if configured to do so).
- If there is no such parameter, the CD-ROM boot sequence starts. That is, it
  tries to find a CD-ROM drive in the system that contains a mountable CD-ROM
  with an file /id.txt on it that has exactly the same contents as its own
  /id.txt file.
  It starts with loading the IDE modules and searching for IDE CD-ROM drives in
  the system. If there are none or there has been no matching CD-ROM found in
  the IDE drives, it proceeds to load the general SCSI modules and starts
  probing the PCI bus for SCSI host adapters. After that, it searches again if
  a matching CD-ROM can be found. If it has not been found until now, all
  available SCSI host adapter modules are tried out if they can be loaded (this
  is for adding support for SCSI host adapters that are not connected to the
  PCI bus).
  If all that has been done and there is still no CD-ROM drive known to the
  kernel, then the script gives up because there is nothing more that it can
  do.
  If at least one CD-ROM drive has been found, but no matching CD-ROM was
  inserted in it, then it prompts the user to insert the CD-ROM and waits until
  a key is pressed. It loops there until a matching CD-ROM is inserted into
  one of the located drives (all CD-ROM drives are searched for it).
  Since version 0.29, it will also look for USB mass storage devices and try 
  to mount the CD from there (if it is a USB CD-ROM) or an ISO image file (if
  it is a normal USB mass storge device like e.g. a USB stick).

In the current version, both possible ways end in the root file system being
mounted (either harddisk partition or CD-ROM). Then the pivot_root call offered
by newer Linux kernels will be used to switch from the old root file system 
(the initrd image, automatically mounted on a ramdisk) to the new one. After
switching the root file system and some cleanup, linuxrc now starts /sbin/init
to start the normal boot procedure.

In previous versions, when pivot_root was not available or not working correctly,
linuxrc did the following:
Both of the possible ways end with the calculation of the root device number
for /proc/sys/kernel/real-root-dev which is set at this point, telling the
kernel where to find its root filesystem. The last steps are cleaning up
(e.g. killing the syslogd and klogd daemons) and printing a message that the
initrd procedure is now complete. At last, the /linuxrc simply terminates and
the kernel get the control again. It umounts the initrd image and mounts its
real root filesystem (as specified in /proc/sys/kernel/real-root-dev).

