2013年9月15日星期日

Ubuntu安装compat-drivers驱动兼容文件

Ubuntu 有线无线网卡驱动安装完后无法读出网卡,
网上搜到需要安装compat-drivers-3.9-rc4-2-su.tar.bz2驱动兼容文件 
1.
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ ./scripts/driver-select alx
Processing new driver-select request...
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: drivers/net/ethernet/broadcom/Makefile.bk
Backup exists: drivers/net/ethernet/atheros/Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: drivers/net/ethernet/broadcom/Makefile.bk
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ make
make -C /lib/modules/3.2.0-51-generic/build M=/home/catchwe/compat-drivers-3.9-rc4-2-su modules
make[1]: 正在进入目录 `/usr/src/linux-headers-3.2.0-51-generic'
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/main.o
In file included from /home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-2.6.h:71:0,
                 from <命令行>:0:
/home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h:49:32: 错误: ‘kref_get_unless_zero’重定义
include/linux/kref.h:47:32: 附注: ‘kref_get_unless_zero’的上一个定义在此
make[3]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat/main.o] 错误 1
make[2]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat] 错误 2
make[1]: *** [_module_/home/catchwe/compat-drivers-3.9-rc4-2-su] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-3.2.0-51-generic'
make: *** [modules] 错误 2
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ sudo gedit/home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h
[sudo] password for catchwe: 
sudo: gedit/home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h:找不到命令
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ sudo gedit /home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ make
make -C /lib/modules/3.2.0-51-generic/build M=/home/catchwe/compat-drivers-3.9-rc4-2-su modules
make[1]: 正在进入目录 `/usr/src/linux-headers-3.2.0-51-generic'
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/main.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat-3.3.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat-3.4.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat-3.5.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/user_namespace.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat-3.7.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat-3.8.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_fq_codel_core.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/flow_dissector.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.o
/bin/sh: 1: cannot create /home/catchwe/compat-drivers-3.9-rc4-2-su/.tmp_versions/compat.mod: Permission denied
make[3]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.o] 错误 2
make[2]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat] 错误 2
make[1]: *** [_module_/home/catchwe/compat-drivers-3.9-rc4-2-su] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-3.2.0-51-generic'
make: *** [modules] 错误 2
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ ./scripts/driver-select alxexit
Processing new driver-select request...
Backup exists: Makefile.bk
Unsupported driver
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ make
make -C /lib/modules/3.2.0-51-generic/build M=/home/catchwe/compat-drivers-3.9-rc4-2-su modules
make[1]: 正在进入目录 `/usr/src/linux-headers-3.2.0-51-generic'
/bin/sh: 1: cannot create /home/catchwe/compat-drivers-3.9-rc4-2-su/.tmp_versions/compat.mod: Permission denied
make[3]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.o] 错误 2
make[2]: *** [/home/catchwe/compat-drivers-3.9-rc4-2-su/compat] 错误 2
make[1]: *** [_module_/home/catchwe/compat-drivers-3.9-rc4-2-su] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-3.2.0-51-generic'
make: *** [modules] 错误 2

catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ sudo make install
Warning:
You may or may not need to update your initramfs, you should if
any of the modules installed are part of your initramfs. To add
support for your distribution to do this automatically send a
patch against ./scripts/update-initramfs. If your distribution does not require this
send a patch against the '/usr/bin/lsb_release -i -s': "Ubuntu"
tag for your distribution to avoid this warning.

make -C /lib/modules/3.2.0-51-generic/build M=/home/catchwe/compat-drivers-3.9-rc4-2-su modules
make[1]: 正在进入目录 `/usr/src/linux-headers-3.2.0-51-generic'
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_codel.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_fq_codel.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_main.o
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_ethtool.o
/home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_ethtool.c: 在函数‘alx_self_test’中:
/home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_ethtool.c:1525:6: 警告: 此函数中的‘err’在使用前可能未初始化 [-Wuninitialized]
/home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_ethtool.c:1450:6: 附注: ‘err’在此声明
  CC [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx_hw.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx.o
  Building modules, stage 2.
  MODPOST 4 modules
  CC      /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.mod.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.ko
  CC      /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_codel.mod.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_codel.ko
  CC      /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_fq_codel.mod.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_fq_codel.ko
  CC      /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx.mod.o
  LD [M]  /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx.ko
make[1]:正在离开目录 `/usr/src/linux-headers-3.2.0-51-generic'
make -C /lib/modules/3.2.0-51-generic/build M=/home/catchwe/compat-drivers-3.9-rc4-2-su "INSTALL_MOD_DIR=updates"  \
modules_install
make[1]: 正在进入目录 `/usr/src/linux-headers-3.2.0-51-generic'
  INSTALL /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/compat.ko
  INSTALL /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_codel.ko
  INSTALL /home/catchwe/compat-drivers-3.9-rc4-2-su/compat/sch_fq_codel.ko
  INSTALL /home/catchwe/compat-drivers-3.9-rc4-2-su/drivers/net/ethernet/atheros/alx/alx.ko
  DEPMOD  3.2.0-51-generic
make[1]:正在离开目录 `/usr/src/linux-headers-3.2.0-51-generic'
Warning:
You may or may not need to update your initramfs, you should if
any of the modules installed are part of your initramfs. To add
support for your distribution to do this automatically send a
patch against ./scripts/update-initramfs. If your distribution does not require this
send a patch against the '/usr/bin/lsb_release -i -s': "Ubuntu"
tag for your distribution to avoid this warning.
depmod will prefer updates/ over kernel/ -- OK!

Now run:

sudo make unload to unload all: wireless, bluetooth and ethernet modules
sudo make wlunload to unload wireless modules
sudo make btunload to unload bluetooth modules

Run sudo modprobe driver-name to load your desired driver.
If unsure reboot.

catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ sudo modprobe alx
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ ^C
catchwe@catchwe-Vostro-5460:~/compat-drivers-3.9-rc4-2-su$ 


能看的出执行make的时候首先报错
kref_get_unless_zero 重定义,猜测可能系统已经定义过这函数,
在报错信息中找到路径
/home/catchwe/compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h
打开文件后,直接注释掉kref_get_unless_zero 函数

然后执行 make  
            sudo make  install
  成功重启reboot


2.重启后 ,网络管理工具找不到了

  sudo service network-manager start



3.发现没法搜到无线网络
catchwe@catchwe-Vostro-5460:~$ iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.
看着好像没装好驱动的样子,可是我装过啦
然后到

菜单-系统设置-附加驱动-激活无线网卡
里面发现无线网卡的驱动没有激活,激活后可用




没有评论:

发表评论