说下在Fedora 18下ASUS N6系列电脑上以太网卡驱动的安装过程。
电脑为ASUS N6系列,以太网卡的型号为Atheros AR8161/8165。
到此网卡的官方网站上未找到Linux下的驱动。
在网上搜索这个网卡驱动的安装,最后得到的结论是安装alx Ethernet driver。
alx Ethernet driver的网址如下:
alx Ethernet driver在网页中的下载地址如下:
https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/04/compat-drivers-2013-03-04-u.tar.bz2
下载下来后,解压并进入到compat-drivers-2013-03-04-u文件夹。
下面是网页中的安装方法:
Install
To only compile and install the alx driver you can do:
./scripts/driver-select alx
make
sudo make install
先执行./scripts/driver-select alx,正常。
然后执行make,出现如下编译错误:
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:118:59: error: redefinition of ‘nla_put_s8’
…
include/net/netlink.h:901:59: note: previous definition of ‘nla_put_s8’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:129:59: error: redefinition of ‘nla_put_s16’
…
include/net/netlink.h:912:59: note: previous definition of ‘nla_put_s16’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:140:59: error: redefinition of ‘nla_put_s32’
…
include/net/netlink.h:923:59: note: previous definition of ‘nla_put_s32’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:151:59: error: redefinition of ‘nla_put_s64’
…
include/net/netlink.h:934:59: note: previous definition of ‘nla_put_s64’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:160:59: error: redefinition of ‘nla_get_s32’
…
include/net/netlink.h:1058:59: note: previous definition of ‘nla_get_s32’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:169:59: error: redefinition of ‘nla_get_s16’
…
include/net/netlink.h:1067:59: note: previous definition of ‘nla_get_s16’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:178:58: error: redefinition of ‘nla_get_s8’
…
include/net/netlink.h:1076:58: note: previous definition of ‘nla_get_s8’ was here
…
…compat-drivers-2013-03-04-u/include/linux/compat-3.7.h:188:59: error: redefinition of ‘nla_get_s64’
…
include/net/netlink.h:1085:59: note: previous definition of ‘nla_get_s64’ was here
…compat-drivers-2013-03-04-u/compat/main.o] Error 1
…
先不急着上网上找解决办法,试着动手解决一下这个编译错误。
在文件夹compat-drivers-2013-03-04-u的include/net下,没有netlink.h这个文件。
在文件夹compat-drivers-2013-03-04-u中搜索netlink.h,未找到。
这时,估计netlink.h就是系统中自带的头文件了。
于是,到/usr下执行如下命令:
find ./ -iname netlink.h
发现了如下文件:
/usr/src/kernels/3.6.10-4.fc18.x86_64/include/net/netlink.h
这个文件的路径与编译错误中“include/net/netlink.h”这个路径一致。
打开并查看/usr/src/kernels/3.6.10-4.fc18.x86_64/include/net/netlink.h和compat-drivers-2013-03-04-u/include/linux/compat-3.7.h这两个文件,
发现编译错误所报的内容,在这两个文件中都有定义,
于是将compat-drivers-2013-03-04-u/include/linux/compat-3.7.h中重复定义的内容注释掉,
即将compat-drivers-2013-03-04-u/include/linux/compat-3.7.h中的112行到198行的内容注释掉。
再次make,编译通过。
执行su,输入root密码。
再执行make install,安装成功。
不重启我不知道怎么让网卡工作起来,于是我重启了。
重启后,网卡工作正常,自动获取到了IP,上网OK!