mkinitrd - make an ext2 file system in a container file, for use as a ramdisk
mkinitrd [-h] [-v] [-t template_dir] [-s N] product
mkinitrd makes a container file containing an ext2 filesystem. It populates this fileystem with the contents of the template directory, and creates a few device special files in /dev (null, console, ttyS0, ptmx). mkinitrd creates and manipulates the filesystem by scripting the mke2fs and debugfs utilities, which must be installed.
As the name suggests, mkinitrd is intended to produce initial ramdisk images as part of the build process for ISOS Linux support. As such it contains a number of assumptions about what files will be in the image, and how to find where to build the container file and where the template directory structure is (if not specified on the command-line).
The image file always ends up in ./build/$HWTYPE-product_name/initrd
If the template directory is not specified on the command-line, mkinitrd starts with the environment variable QUANTUM_BIN_DIR (which specifies the directory to which the ISOS kernel modules are copied) and walks up the directory structure until it finds what looks like a 'plausible' root (i.e. one containing at least /dev /bin and /lib ). If it reaches the root of the actual host filesystem it fails.
If the parent directory of the template contains a file called links.template_name, this should contain a list of symlinks to create, each line being one symlink/file pair, separated by whitespace, with the symlink name first e.g.
/lib/libc.so.0 /lib/libuClibc-0.9.11.so
If this file exists, mkinitrd will read it and create the relevant symlinks in the target filesystem.