NAME
update-initrd - (re-)generate initialization ramdisk for use with discover
SYNOPSIS
update-initrd kernel-version
DESCRIPTION
update-initrd is used to generate an initialization ramdisk image (initrd for short) for use with the discover(8) utility, to perform boot-time hardware detection. When a boot loader capable of loading an initrd as well as a kernel image is used, device drivers used to access the root filesystem may be built as modules and placed in the initrd instead of compiled into the kernel itself. update-initrd handles the creation of just such an initrd, using the currently installed modules corresponding to kernel-version.
Note that the filesystem driver for the initrd filesystem (currently ext2) cannot be thus modularized, because the booting kernel needs to be able to comprehend the initrd.
OPERANDS
update-initrd takes a single argument - the version number of the (installed) kernel for which to generate an initrd image.
EXTENDED DESCRIPTION
update-initrd expects to find the following files, corresponding to an installed Linux kernel-image package, for the Debian GNU/Linux system:
/boot/vmlinuz-kernel-version
/boot/System.map-kernel-version
/lib/modules/kernel-version/modules.dep
A check for actual kernel modules in the modules directory is also made.
The only kernel versions currently supported by update-initrd are the 2.2 series and the 2.4 series; if some other kernel version is specified, a warning is issued and the program exits without doing anything further.
Next, a temporary directory is created (see ENVIRONMENT below); if it cannot be, update-initrd exits with an error. This temporary directory is used to create the initrd with mke2fs(8), and then mounted as a loop device (thus, the environment in which update-initrd is run needs to support the loop device type).
The initrd is populated with a linuxrc file, found in /usr/share/discover/linuxrc, the ash(1) shell (installed as "/bin/sh"), mount(8), umount(8), discover(8), insmod(8), and modprobe(8). The C and C math libraries are also installed, as is the discover library and several data files used by discover to identify hardware. Some other essentials for an (extremely) minimal root filesystem are also prepared.
Finally, the modules.dep file and any modules present in the kernel-version module directory identified as SCSI drivers by discover, as well as the "sd_mod" (SCSI disk layer) and "ide-scsi" (SCSI emulation layer for IDE CD-ROM drives) modules, and any modules they depend on, are installed into the initrd.
The initrd loop filesystem is then unmounted, compressed, and placed in /boot/initrd-kernel-version.gz; any existing file of this name is backed up to /boot/initrd-kernel-version.gz.old.
ENVIRONMENT
- TMPDIR
-
If defined, update-initrd uses the contents of this variable as the parent of its temporary work directory. Otherwise, /tmp is used.
FUTURE DIRECTIONS
It would be nice to be able to arbitrarily specify the modules placed on the initrd, and to use any filesystem type desired for the initrd (in which case it would be a good idea to check for the corresponding kernel module and error out).
SEE ALSO
AUTHORS
Ian Murdock and Branden Robinson for Progeny Linux Systems, Inc. and Debian GNU/Linux.