sudo apt-get install build-essential linux-headers-generic linux-headers-`uname -r` wget https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/04/compat-drivers-2013-03-04-u.tar.bz2 tar -xj compat-drivers-* ./scripts/driver-select alx make sudo make install sudo modprobe -r alx && sudo modprobe alx
中间在执行make时会提示/home/phithon/compat-drivers-2013-03-04-u/include/linux/compat-3.8.h:49:32: 错误: ‘kref_get_unless_zero’重定义
因为给出了重定义的具体位置,所以我们直接进去看看:
nano /home/phithon/compat-drivers-2013-03-04-u/include/linux/compat-3.8.h按ctrl + w查找“kref_get_unless_zero”,发现了一个函数
static inline int __must_check kref_get_unless_zero(struct kref *kref) { return atomic_add_unless(&kref->refcount, 1, 0); }就是这里重定义了,简单地将其注释掉即可。再次make即可通过编译,并最后连上有线网络。