尝试安装网卡驱动并出现错误:
[root@london r8169-6.023.02]# make clean modules
make -C src/ clean
make[1]: Entering directory `/home/av/r8169-6.023.02/src'
make -C /lib/modules/3.10.0-327.36.3.el7.x86_64/build SUBDIRS=/home/av/r8169-6.023.02/src clean
make[2]: Entering directory `/usr/src/kernels/3.10.0-327.36.3.el7.x86_64'
make[2]: *** No rule to make target `clean'. Stop.
make[2]: Leaving directory `/usr/src/kernels/3.10.0-327.36.3.el7.x86_64'
make[1]: *** [clean] Error 2
make[1]: Leaving directory `/home/av/r8169-6.023.02/src'
make: *** [clean] Error 2
[root@london r8169-6.023.02]#
所以Realtek提供的手册说:
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
# modprobe r8169
还尝试执行(从堆栈溢出):
[root@london r8169-6.023.02]# make -f Makefile clean
make -C src/ clean
make[1]: Entering directory `/home/av/r8169-6.023.02/src'
make -C /lib/modules/3.10.0-327.36.3.el7.x86_64/build SUBDIRS=/home/av/r8169-6.023.02/src clean
make[2]: Entering directory `/usr/src/kernels/3.10.0-327.36.3.el7.x86_64'
make[2]: *** No rule to make target `clean'. Stop.
make[2]: Leaving directory `/usr/src/kernels/3.10.0-327.36.3.el7.x86_64'
make[1]: *** [clean] Error 2
make[1]: Leaving directory `/home/av/r8169-6.023.02/src'
make: *** [clean] Error 2
[root@london r8169-6.023.02]#
生成文件是:
KFLAG := 2$(shell uname -r | sed -ne 's/^2\.[4]\..*/4/p')x
all: clean modules install
modules:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x modules
else
$(MAKE) -C src/ modules
endif
clean:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x clean
else
$(MAKE) -C src/ clean
endif
install:
ifeq ($(KFLAG),24x)
$(MAKE) -C src/ -f Makefile_linux24x install
else
$(MAKE) -C src/ install
endif
有人可以解释一下错误在哪里吗?谢谢
UPD1
[root@london r8169-6.023.02]# ls /lib/modules/3.10.0-327.36.3.el7.x86_64/kerneldrivers/net/ethernet/realtek
8139cp.ko 8139too.ko r8169.ko
[root@london r8169-6.023.02]# ls /lib/modules/*/kernel/drivers/net/ethernet/reatek
/lib/modules/3.10.0-327.22.2.el7.x86_64/kernel/drivers/net/ethernet/realtek:
8139cp.ko 8139too.ko r8169.ko
/lib/modules/3.10.0-327.28.2.el7.x86_64/kernel/drivers/net/ethernet/realtek:
8139cp.ko 8139too.ko r8169.ko
/lib/modules/3.10.0-327.28.3.el7.x86_64/kernel/drivers/net/ethernet/realtek:
8139cp.ko 8139too.ko r8169.ko
/lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/net/ethernet/realtek:
8139cp.ko 8139too.ko r8169.ko
/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/net/ethernet/realtek:
8139cp.ko 8139too.ko r8169.ko
[root@london r8169-6.023.02]#
[root@london r8169-6.023.02]# lsmod | grep r8169
[root@london r8169-6.023.02]#