2008年(17)
分类: LINUX
2008-07-25 14:29:41
在FC5中,没有对RTL8168/8111网卡的支持,安装步骤如下:
一、下载FC5内核源码包:
下载RTL8168/8111驱动(r8168-8.006.00.tar.bz2):
(
4&DownTypeID=3&GetDown=false#RTL8111B/RTL8168B/RTL8111/RTL8168/RTL8111C)
内核开发工具kernel-devel-2.6.15-1.2054-FC5.i686.rpm 在FC5安装光盘有直接安装
二、 编译内核
#rpm -uch kernel-2.6.15-1.2054_FC5.src.rpm
#cd /usr/src/redhat/SPECS
#rpmbuild -bp --target=i686 kernel-2.6.spec
#cd /usr/src
#mkdir kernels
#cd kernels/
#ls -l /lib/modules/2.6.15-1.2054_FC5/
在显示结果中有两个符号链接文件是无效的
build->../../../usr/src/kernels/2.6.15-1.2054_FC5-smp-i686
source->build
下面就要构造这两个指向内核源码树的连接
#ln -s ../redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686 2.6.15-1.2054-FC5-smp-i686
#cd 2.6.15-1.2054_FC5-smp-i686
#cp configs/kernel-2.6.15-i686.config .config
#cd /usr/src/kernels/2.6.15-1.2054_FC5-i686
#vi Makefile //将Makefile中的EXTRAVERSION = -prep换成EXTRAVERSION = -1.2054_FC5
#make mrproper //创建新的.o文件及依赖关系
#make oldconfig
#make modules_install
三、 安装驱动
按照readme安装即可:
Unpack the tarball :
# tar vjxf r8168-8.aaa.bb.tar.bz2
Change to the directory:
# cd r8168-8.aaa.bb
If you are running the target kernel, then you should be able to do :
# make clean modules (as root or with sudo)
# make install
# depmod -a
# insmod ./src/r8168.ko (or r8168.o in linux kernel 2.4.x)
You can check whether the driver is loaded by using following commands.
# lsmod | grep r8168
# ifconfig -a
If there is a device name, ethX, shown on the monitor, the linux
driver is loaded. Then, you can use the following command to activate
the ethX.
# ifconfig ethX up
,where X=0,1,2,...