MKINITRD_COMMAND_GEN(8)

NAME
mkinitrd_command_generator - mkinitrd the easy way

SYNOPSIS

mkinitrd_command_generator.sh [ options ] [ kernel_filename ]

OPTIONS

-a additional params
    Additional parameters to pass to mkinitrd.

-c | --conf
    Show a suitable mkinitrd configuration file.

-h | --help
    Show this help.

-i | --interactive
    Navigate through menus instead of using commandline arguments.

--longhelp
    Show more detailed information/examples.

-k kernelversion
    Use specific kernel version. This may also be a colon-delimited list of kernel versions to use.

-m additional mods
    Additional modules to pass to mkinitrd, separated by colons (:).

-l | --lilo
    Only show lilo.conf section (requires a kernel_filename).

-r | --run
    Only show mkinitrd command.

DESCRIPTION

This script is useful in situations where you require an initrd image to boot your computer.

For instance, when booting a kernel that does not have support for your storage or root filesystem built in (such as the Slackware generic kernels).

When you run the script without parameters, it will examine your running system, your current kernel version and will output an example of a mkinitrd commandline that you can use to generate an initrd image containing enough driver support to boot the computer.

You can make it more specific: when you add the filename of a kernel as parameter to the script, it will determine the kernel version from that kernel, and also give an example of the lines that you should add to your /etc/lilo.conf file.

If you want your initrd image to have a custom name instead of the default /boot/initrd.gz you can add it as another parameter to the script, as follows:

mkinitrd_command_generator.sh -a "-o /boot/custom.gz"

The arguments to the -a parameter will be used as additional arguments to the mkinitrd command.

If you need additional modules in the initrd image, apart from what the script determines, you can pass then to the script using the -m parameter as follows:

mkinitrd_command_generator.sh -m "uhci-hcd:usbhid:hid:hid-generic"

The above example adds support for USB keyboards to the initrd - you may need that if you have encrypted your root partition and need to enter a passphrase using a USB keyboard.

Instead of copying and pasting the script’s output, you can create an initrd by directly executing the output, like in this example:

    $(mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-4.4.1)

That used the -r or --run switch to make the script only write the mkinitrd commandline to the terminal.

When you want to add a section for a specific kernel to /etc/lilo.conf directly, use the -l or --lilo switch and use a command like in this example:

mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-smp-4.4.1 >>/etc/lilo.conf

That command will result in the following lines being added to your /etc/lilo.conf file (example for my hardware):

    # Linux bootable partition config begins
    # initrd created with 'mkinitrd -c -k 4.4.1 -m mbcache:jbd2:ext4 -f ext4 -r /dev/sda7 -u -o /boot/initrd.gz'
    image = /boot/vmlinuz-generic-4.4.1
    initrd = /boot/initrd.gz
    root = /dev/sda7
    label = 4.4.1
    read-only
    # Linux bootable partition config ends

The last two examples show how easy it is to configure your computer for the use of an initrd if you need one. The only thing left to do afterwards is running lilo.

EXIT STATUS

    0 Success
    1 Failure

FILES

    /usr/share/mkinitrd/mkinitrd_command_generator.sh

BUGS

Report bugs to Eric Hameleers <alien@slackware.com>

SEE ALSO

    mkinitrd(1), lilo.conf(1)

AUTHOR

Eric Hameleers
    Author.