While playing around with initrd images a few weeks back, I came across the mkinitrd “–with” option. This option allows you to add additional modules to an initrd image, which is useful when you have a new storage or Ethernet driver that isn’t supported by the base operating system. To use this option, you can place the names of the modules to add to the initrd image in quotes, and pass them to the “–with” option:
$ mkinitrd -v –with=”aoe virtio” /tmp/initrd/initrd-18.104.22.168-213.fc11.x86_64.img 22.214.171.124-213.fc11.x86_64
To verify the image contains the modules you specified, you can extract the initrd image and poke around the lib/modules directory:
$ gunzip < initrd-126.96.36.199-213.fc11.x86_64.img | cpio -i
$ cd lib/modules/
$ find . -name \*aoe\*
$ find . -name \*virtio\*
If you want the modules included in all future mkinitrd runs, you can add the modules to the modules variable in the/etc/sysconfig/initrd file. Nice!