Rechercher une page de manuel
mkinitrd
Langue: en
Version: 6 August 2007 (openSuse - 09/10/07)
Section: 5 (Format de fichier)
Sommaire
NAME
mkinitrd - description of modular scripts layoutDESCRIPTION
mkinitrd creates initial ramdisk images for booting Linux. It is designed to be modular, so that functionality required by other programs can be maintained in separate scripts.DIRECTORY LAYOUT
All files are located in the directory /lib/mkinitrd The directory has the following layout:- bin
- External program required during boot
- dev
- Additional devices nodes to be copied into the mkinitrd.
- scripts
- Repository for mkinitrd scripts
- setup
- Resolved links for scripts to be executed during creation of the initrd
- boot
- Resolved links for scripts to be executed during boot.
SCRIPT REPOSITORY
The directory /lib/mkinitrd/scripts is the repository for all mkinitrd scripts. They follow the naming convention-
<type>-<name>.sh
<type> can be either setup for scripts to be called during initrd creation or boot for scripts to be called during boot. The <name> for a script serves as an identification for the implemented feature; it is assumed that scripts named boot-foo.sh and setup-foo.sh both refer to the feature foo
SCRIPT SYMLINK RESOLUTION
The directories /lib/mkinitrd/setup and /lib/mkinitrd/boot hold the resolved symlinks to the scripts in the mkinitrd repository. The symlinks have the naming convention-
<number>-<name>.sh
where <number> determines the execution order (lower numbers will be executed earlier) and <name> is the names of the script as mentioned in the previous section. The symlinks are maintained by the program /sbin/mkinitrd_setup which evaluates the tags in the scripts and creates symlinks with the correct name. Manual maintenance in the /lib/mkinitrd/setup or /lib/mkinitrd/boot directories are strongly discouraged, as any call to /sbin/mkinitrd_setup will remove the manually created links.
SCRIPT KEYWORDS
The execution order of the mkinitrd scripts is determined by keywords. The following keywords are recognized:- #%stage: <name>
- The execution stage for this script
- #%depends: <list
- Space-separated list of features or scripts names this script depends upon.
- #%provides: <list>
- Space-separated list of additional features provided by this script.
Each script provides per default a feature with the script name, so that setup-foo.sh automatically provides a feature foo.
All dependend scripts (i.e. any feature listed in the #%depends: list) will be executed prior to this script.
EXECUTION STAGES
Script execution is gouverned by stages. The stages define the overall execution order as each stage is executed sequentially. The defined stages are:- setup
- General preparation
- filesystem
- Filesystem detection and maintenance
- crypto
- Handling of cryptographic volumes
- volumemanager
- Handling of LVM2 and EVMS volumes
- softraid
- Detection and setup of MD devices
- partitions
- Detection and setup of partitions.
- devicemapper
- Device-mapper devices presenting full disks, e.g. multipath and dmraid
- block
- Detection and setup of block devices.
- device
- Detection and setup of hardware devices
- boot
- Final cleanups / preparation
During setup the stages are executed from setup to boot ; during boot the stages are executed in reversed order. The stages itself are defined corresponding to the Novell Storage Foundation Layout. This induces some restrictions to the possible device setups, as e.g. MD over LVM is not supported.
The stages are executed sequentially. All scripts for a stage have to be executed before those for the next stage are evaluated. Within a stage scripts can run parallel where possible.
As each stage serves as a checkpoint it is not possible to have dependencies across stages. So script foo in stage filesystem cannot depend on script bar in stage block
SCRIPT INSTALLATION
New scripts should be copied to /lib/mkinitrd/scripts and the appropriate keywords should be inserted. Afterwards /sbin/mkinitrd_setup should be executed to update the symlinks in boot and setupFor removal the scripts should be deleted and /sbin/mkinitrd_setup should be called to update the symlinks.
AUTHORS
Steffen Winterfeldt <snwint@suse.de>, Susanne Oberhauser <froh@suse.de>, Andreas Gruenbacher <agruen@suse.de>, Hannes Reinecke <hare@suse.de>, Alexander Graf <agraf@suse.de>FILES
/lib/mkinitrd /sbin/mkinitrd /sbin/mkinitrd_setup
SEE ALSO
mkinitrd(8)
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre