linuxlinux-kernellinux-device-driverinitrddkms

When is it necessary to rebuild the initrd (Linux initial ramdisk)?


Background: I'm developing a DKMS package for my kernel module. The DKMS manpage contains the following sentence:

REMAKE_INITRD = This directive specifies whether your initrd should be remade after the module is installed onto the kernel.

Question: When is it necessary to remake the initrd? How do I find out if it is necessary to remake the initrd after installing my module onto the kernel?


Solution

  • In general, it is only necessary to remake the initrd if you need to add or update a module necessary to mount the root filesystem. Once the root filesystem is mounted, the kernel can load other modules dynamically using the normal mechanism.

    Things typically included in the initrd are disk device drivers (scsi, sata, fibre channel, etc), filesystem drivers (like ext4, xfs, btrfs, etc), and higher level block device drivers like LUKS (for encrypted devices), LVM, and so forth.

    If your module doesn't fall into this category of drivers then it doesn't need to be on the initrd and you don't need to rebuild the initrd.