How to add kernel modules to the initrd to be loaded on boot
This document (000019945) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
Situation
Resolution
cat << EOF > /etc/dracut.conf.d/00-custom.conf add_drivers+=" qla2xxx " EOF
Note: please add space before and after the kernel module. And also, kernel module should be written without .ko extension.
Running following command will regenerate the initrd:
mkinitrd
To verify the module was added:
lsinitrd |grep ko|grep qla2xxx
... lib/modules/<version>/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
Additional Information
For more information please check the dracut.conf man pages.
add_drivers+=" <kernel modules> " Specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix.
Note that mkinitrd has been deprecated for some time and has for many years functioned as a compatibility wrapper that calls dracut. In some of the more recent versions of SUSE product releases (such as SUSE Linux Enterprise Server 15 Service Pack 5 and 6), mkinitrd is no longer installed by default. Depending on the product version used, mkinitrd may still be available in an optional package called 'dracut-mkinitrd-deprecated'. However, dracut replaces mkinitrd and unless there is some specific reason that mkinitrd is required (such as scripting needs or legacy applications), dracut should be called directly.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000019945
- Creation Date: 20-Apr-2021
- Modified Date:20-Dec-2024
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com