Saturday, April 11, 2009

Network Card (RTL8168) installation in RHEL 5

Operating system: RHEL 5
Problem: Network card driver is not getting installed in RHEL 5
Error: If the command # make install is given, it is giving following error,
[root@linux r8168-8.008.00]# make install
make -C src/ install
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
install -m 744 -c r8168.ko /lib/modules/2.6.18-8.el5/kernel/drivers/net/
install: cannot stat `r8168.ko': No such file or directory
make [1]: *** [install] Error 1
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'
make: *** [install] Error 2

Steps to install: Unpack the tarball:
# tar vjxf r8168-8.008.00.tar.bz2
Change to the directory:
# cd r8168-8.008.00
If you are running the target kernel, then you should be able to do before doing the follow command, you need to login as root.
For installing and compiling drivers, package kernel-devel and gcc packages are to be installed.

# rpm =ivh kernel-devel-2.6.18-8.el5
After installing this package, kernel development tools will be installed inside /usr/src/kernels.A link to be created in /usr/src for the kernel tools. For that, execute following command,
# ln -s /usr/src/kernels/2.6.18-8.el5-i686 /usr/src/linux
Now link "linux" is created inside /usr/src.
Now execute # make clean modules
then output will be something similar to following message,
[root@linux r8168-8.008.00]# make clean modules
make -C src/ clean
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'
make -C src/ modules
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
make -C /lib/modules/2.6.18-8.el5/build SUBDIRS=/tmp/r8168-8.008.00/src modules
make[2]: Entering directory `/usr/src/kernels/2.6.18-8.el5-i686'
CC [M] /tmp/r8168-8.008.00/src/r8168_n.o
/tmp/r8168-8.008.00/src/r8168_n.c: In function ârtl8168_tx_clearâ:
/tmp/r8168-8.008.00/src/r8168_n.c:3763: warning: unused variable âdevâ
/tmp/r8168-8.008.00/src/r8168_n.c: At top level:
/tmp/r8168-8.008.00/src/r8168_n.c:2420: warning: ârtl8168_phy_power_downâ defined but not used
LD [M] /tmp/r8168-8.008.00/src/r8168.o
Building modules, stage 2.
MODPOST
CC /tmp/r8168-8.008.00/src/r8168.mod.o
LD [M] /tmp/r8168-8.008.00/src/r8168.ko
make[2]: Leaving directory `/usr/src/kernels/2.6.18-8.el5-i686'
strip --strip-debug r8168.ko
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'

Then execute # make install, result will look like as follows,

[root@linux r8168-8.008.00]# make install
make -C src/ install
make[1]: Entering directory `/tmp/r8168-8.008.00/src'
install -m 744 -c r8168.ko /lib/modules/2.6.18-8.el5/kernel/drivers/net/
make[1]: Leaving directory `/tmp/r8168-8.008.00/src'


[root@linux r8168-8.008.00]# /sbin/depmod -a

[root@linux r8168-8.008.00]# insmod /lib/modules/2.6.18-.el5/kernel/drivers/net/r8168.ko

After successful installation,
[root@linux r8168-8.008.00]# lsmod grep r8168 and check for driver is linked with kernel.
Using ifconfig or system-config-network utility, configure the network parameters.

4 comments:

Unknown said...

Thanks you very much dude! .. I have been fighting with this problem.. hope now it ends with you solution...

Anonymous said...

Entering an unknown directory

*** make /lib/modules/2.6.18-8.el5xen/build: No such file or directory. Stop.
Leaveing an unknwon directory
*** [modules] Error 2
Leaving directory '/tmp/r8168-8.019.00/src'
*** [modules] Error 2

Anonymous said...

help

RV said...

Hello,

Could you please let me know how to upgrade NIC card driver on RHEL 5..

Ansible Playbook to collect uptime of servers

Hi,  This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...