cancel
Showing results for 
Search instead for 
Did you mean: 

Installing kernel modules

 
Daryl Rose
Advisor

Installing kernel modules

A vendor is telling us that we need to upgrade the NIC driver on our servers.  We have Proliant DL360 G7 servers with NC382i Dual Port Multifunction Gigabit Server Adapters.  The version of the currently installed drivers is1.9.3.  The latest release from H.P. is 2.0.23b.  We are locked down to RHEL 5.4 x86.

The current drivers are compiled into the kernel and installed in /lib/modules/2.6.18-164.38.1.el5PAE/kernel/drivers/net.  The new drivers will be installed in /lib/modules/2.6.18-164.38.1.el5PAE/extra/. 

 

Since the current drivers are compiled into the kernel, and the new drivers are not installed over the top of the original drivers, wont the original drivers supersede the upgraded drivers? 

 

If I do an lsmod, I see the current drivers

# lsmod |grep bnx
bnx2                  173389  0

 

The current /etc/modprobe.conf shows:

alias eth0 bnx2
alias eth1 bnx2
alias eth2 bnx2
alias eth3 bnx2

Sure, I can uninstall the current drivers

# modprobe -r bnx2

 

I can install new drivers

# modprobe bnx2

 

What tells the kernel to use the newly installed drivers instead of the drivers compiled into the kernel?

 

Thanks.

 

Daryl

6 REPLIES
Goran Koruga
Honored Contributor

Re: Installing kernel modules

Hello.

 

As far as I know module-init-tools don't have an option to specify PATH (as opposed to modutils previously).

 

But you should be able to achieve what you want using the 'install' command in modprobe config files:

 

install foo insmod /lib/modules/<ver>/<bar>baz.ko

 

Regards,

Goran

Matti_Kurkela
Honored Contributor

Re: Installing kernel modules

> The current drivers are compiled into the kernel and installed in /lib/modules/2.6.18-164.38.1.el5PAE/kernel/drivers/net.

 

Er... that's not quite correct. If the driver was compiled into the kernel, you would not see any module file at all. The driver would "just work" as soon as the kernel was loaded. The standard modules are packaged into the kernel RPM, but that does not mean they are compiled into the kernel - and this distinction can be very important if you find that a buggy driver is causing your system to hang as soon as the driver is loaded.

 

With modern Linux systems, very few drivers are actually compiled into the kernel - basically, only the bare minimum required to read the initrd and to achieve a basic console display. Anything else can be read as modules from the initrd if they are required in early phases of the boot, or from the regular /lib/modules directory hierarchy if they are not necessary for accessing the root filesystem.

 

The depmod command prepares a list of modules for the modprobe command, which does the actual job of loading the modules. In RHEL 5 and later, depmod is configured to look into /lib/modules/<kernel-version>/extra directory first if it exists. This way, any modules placed in that directory will automatically override any similarly-named standard modules included into the kernel package.

 

You can find more details from RedHat Driver Update Program webpage. Please look at the chapter titled "Overriding a RedHat supplied driver":

http://dup.et.redhat.com/

MK
Goran Koruga
Honored Contributor

Re: Installing kernel modules

Nice document - if only man pages were somewhat close to this...

 

Regards,

Goran

Jimmy Vance
HPE Pro

Re: Installing kernel modules

As others have mentioned, the driver is probably not compiled into the kernel, but the problem you might be running into is the initrd image file still has the old driver. Now that you have the new driver installed you need to create a new initrd image

 

 




__________________________________________________
No support by private messages. Please ask the forum!      I work for HPE

If you feel this was helpful please click the KUDOS! thumb below!   
Daryl Rose
Advisor

Re: Installing kernel modules


Jimmy Vance wrote:

As others have mentioned, the driver is probably not compiled into the kernel, but the problem you might be running into is the initrd image file still has the old driver. Now that you have the new driver installed you need to create a new initrd image

 

 


Thank you to all who replied.

 

Perhaps my thoughts are wrong, but here is how I arrived at my conclusion. 

 

The driver in question is bnx2.ko.  If I do an rpm -qf on that file to see what package owns it, I get back the kernel.

rpm -qf bnx2.ko
kernel-PAE-2.6.18-164.38.1.el5

 

Perhaps I am wrong, but this appears to me as if the driver was compiled into the kernel.

 

I'll read over the suggested documentation and see if that will help me resolve my concerns.

 

Thanks.

 

Daryl

Goran Koruga
Honored Contributor

Re: Installing kernel modules

Hello.

 

You're right that it's part of the kernel package, but the term "is compiled in" usually means it's part of the kernel image, or in other words, not compiled as a module - that would require more work from you.

 

Regards,

Goran