That is fascinating.
The installer’s initrd.img does indeed have the module (as it probably has all of them in order to function on all supported hardware).
[AL9 installer]$ lsinitrd initrd.img | grep mega
drwxr-xr-x 2 root root 0 May 18 08:05 usr/lib/modules/5.14.0-70.13.1.el9_0.x86_64/kernel/drivers/scsi/megaraid
-rw-r--r-- 1 root root 72336 May 17 23:02 usr/lib/modules/5.14.0-70.13.1.el9_0.x86_64/kernel/drivers/scsi/megaraid/megaraid_sas.ko.xz
The installer (kernel-5.14.0-70.13.1) should load the necessary modules and thus be able to use devices.
If we supply additional drivers, then the kernel can load them too.
How it prefers megaraid_sas from DUD, when it already has one in initrd.img? I don’t know.
In addition to use of driver during install, the kmod-* RPM from DUD should also install into the system automagickally.
I don’t have that hardware, so the initramfs*.img of installed kernel (5.14.0-70.17.1) on my machines does not have it, but system has it as it is provided by kernel-modules
package:
[AL9]$ ls -l /lib/modules/5.14.0-70.17.1.el9_0.x86_64/kernel/drivers/scsi/megaraid/megaraid_sas.ko.xz
-rw-r--r--. 1 root root 72464 Jun 28 22:07 /lib/modules/5.14.0-70.17.1.el9_0.x86_64/kernel/drivers/scsi/megaraid/megaraid_sas.ko.xz
What is interesting in your “modprobe -c” output is that it finds nothing for [1000:0016], while on my Alma 9 the ‘megaraid_sas’ is listed both by default and if I install the kmod-megaraid_sas from ELRepo.
The real question related to future installs is why the included driver fails. Is the issue only in 5.14.0-70.13.1’s module and fixed in future kernels – in which case future installers (e.g. for Alma 9.1) would behave – or will it persist. Red Hat’s bugzilla does not show any entries for “megaraid”.
I tend to (re)install with PXEboot, which allows setting custom boot options on a server for multiple machines, although latest CentOS 7 installs had to use removable media as those machines had NIC that does need driver from ELRepo.
One thing to test (but might break the system) is to remove the kmod-megaraid_sas from already installed system. If the 5.14.0-70.17.1
can boot with its own megaraid_sas module (which obviously has to be injected into initramfs after removal of kmod-package and before reboot), then the issue is only in 5.14.0-70.13.1.