背景:我正在为我的内核模块开发一个 DKMS 包。 DKMS manpage包含以下句子:
REMAKE_INITRD = This directive specifies whether your initrd should be remade after the module is installed onto the kernel.
问题:什么时候需要重新制作initrd?在将我的模块安装到内核后,如何确定是否需要重新制作 initrd?
最佳答案
一般来说,只有在需要添加或更新挂载根文件系统所需的模块时,才需要重新制作 initrd。一旦挂载了根文件系统,内核就可以使用正常机制动态加载其他模块。
initrd 中通常包含磁盘设备驱动程序(scsi、sata、光纤 channel 等)、文件系统驱动程序(如 ext4、xfs、btrfs 等)和更高级别的 block 设备驱动程序,如 LUKS(用于加密设备) 、LVM 等。
如果您的模块不属于此类驱动程序,那么它就不需要在 initrd 上,您也不需要重建 initrd。
关于linux - 什么时候需要重建 initrd(Linux 初始 ramdisk)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39068008/