mkinitrd − description of modular scripts layout
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.
All files are located in the directory /lib/mkinitrd. The directory has the following layout:
External program required during boot
Additional devices nodes to be copied into the mkinitrd.
Repository for mkinitrd scripts
Resolved links for scripts to be executed during creation of the initrd
Resolved links for scripts to be executed during boot.
The directory /lib/mkinitrd/scripts is the repository for all mkinitrd scripts. They follow the naming convention
<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.
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
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.
The execution order of the mkinitrd scripts is determined by keywords. The following keywords are recognized:
The execution stage for this script
Space−separated list of features or scripts names this script depends upon.
Space−separated list of additional features provided by this script.
Don’t show the script in the list of features displayed to the user.
A (space separated) list of programs, specified by their full path, that should be included in the initrd.
NOTE: The path is the full path in the initrd, not in the system. mkinitrd tries to discover programs automatically, which means that programs in /sbin will be also searched in /usr/sbin and programs in /bin will be also searched in /usr/bin.
List of (space separated) kernel modules (only the name, no path, without suffix) that should be included in the initrd. The modules must be loaded in the corresponding boot script with load_modules.
List of (space separated) kernel modules (only the name, no path, without suffix) that should be included in the initrd but are loaded automatically with either udev or something else (like file system modules with mount).
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.
Script execution is gouverned by stages. The stages define the overall execution order as each stage is executed sequentially. The defined stages are:
Filesystem detection and maintenance
Handling of cryptographic volumes
Handling of LVM2 and EVMS volumes
Detection and setup of MD devices
Detection and setup of partitions.
Device−mapper devices presenting full disks, e.g. multipath and dmraid
Detection and setup of block devices.
Detection and setup of hardware devices
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 pos− sible.
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.
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 setup.
For removal the scripts should be deleted and /sbin/mkinitrd_setup should be called to update the symlinks.
Steffen Winterfeldt <email@example.com>, Susanne Oberhauser <firstname.lastname@example.org>, Andreas GrÃ¼nbacher <email@example.com>, Hannes Reinecke <firstname.lastname@example.org>, Alexander Graf <email@example.com>, Bernhard Walle <firstname.lastname@example.org>
/lib/mkinitrd /sbin/mkinitrd /sbin/mkinitrd_setup
Please report bugs and enhancement requests at https://bugzilla.novell.com.
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.