Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 561
sergej Avatar asked Aug 21 '16 19:08

sergej


1 Answers

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.

like image 72
larsks Avatar answered Sep 20 '22 13:09

larsks