免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: zhou2324
打印 上一主题 下一主题

linux下找不到网卡是什么原因? [复制链接]

论坛徽章:
0
11 [报告]
发表于 2009-09-11 15:28 |只看该作者

  1. [root@localhost tg3-3.99k]# make
  2. sh makeflags.sh /lib/modules/2.6.18-53.el5/source > tg3_flags.h
  3. grep: /lib/modules/2.6.18-53.el5/source/include/linux/kernel.h: No such file or directory
  4. grep: /lib/modules/2.6.18-53.el5/source/include/linux/types.h: No such file or directory
  5. grep: /lib/modules/2.6.18-53.el5/source/include/linux/types.h: No such file or directory
  6. grep: /lib/modules/2.6.18-53.el5/source/include/linux/types.h: No such file or directory
  7. grep: /lib/modules/2.6.18-53.el5/source/include/linux/slab.h: No such file or directory
  8. grep: /lib/modules/2.6.18-53.el5/source/include/linux/delay.h: No such file or directory
  9. grep: /lib/modules/2.6.18-53.el5/source/include/linux/delay.h: No such file or directory
  10. grep: /lib/modules/2.6.18-53.el5/source/include/linux/skbuff.h: No such file or directory
  11. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  12. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  13. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  14. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  15. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  16. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  17. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  18. grep: /lib/modules/2.6.18-53.el5/source/include/linux/pci.h: No such file or directory
  19. grep: /lib/modules/2.6.18-53.el5/source/include/linux/if_ether.h: No such file or directory
  20. grep: /lib/modules/2.6.18-53.el5/source/include/linux/ethtool.h: No such file or directory
  21. grep: /lib/modules/2.6.18-53.el5/source/include/linux/ethtool.h: No such file or directory
  22. grep: /lib/modules/2.6.18-53.el5/source/include/linux/ethtool.h: No such file or directory
  23. grep: /lib/modules/2.6.18-53.el5/source/include/linux/skbuff.h: No such file or directory
  24. grep: /lib/modules/2.6.18-53.el5/source/include/linux/skbuff.h: No such file or directory
  25. grep: /lib/modules/2.6.18-53.el5/source/include/linux/ip.h: No such file or directory
  26. grep: /lib/modules/2.6.18-53.el5/source/include/net/ip.h: No such file or directory
  27. grep: /lib/modules/2.6.18-53.el5/source/include/linux/tcp.h: No such file or directory
  28. grep: /lib/modules/2.6.18-53.el5/source/include/linux/tcp.h: No such file or directory
  29. grep: /lib/modules/2.6.18-53.el5/source/include/linux/netdevice.h: No such file or directory
  30. awk: cmd. line:1: fatal: cannot open file `/lib/modules/2.6.18-53.el5/source/include/linux/netdevice.h' for reading (No such file or directory)
  31. makeflags.sh: line 154: [: too many arguments
  32. grep: /lib/modules/2.6.18-53.el5/source/include/linux/netdevice.h: No such file or directory
  33. grep: /lib/modules/2.6.18-53.el5/source/include/linux/netdevice.h: No such file or directory
  34. grep: /lib/modules/2.6.18-53.el5/source/include/linux/if_vlan.h: No such file or directory
  35. make -C /lib/modules/2.6.18-53.el5/build SUBDIRS=/root/Server/Linux/Driver/tg3-3.99k modules
  36. make[1]: Entering directory `/usr/src/kernels/2.6.18-53.el5-i686'
  37. make[1]: *** No rule to make target `modules'.  Stop.
  38. make[1]: Leaving directory `/usr/src/kernels/2.6.18-53.el5-i686'
  39. make: *** [default] Error 2
复制代码

论坛徽章:
0
12 [报告]
发表于 2009-09-11 15:29 |只看该作者

  1. #!/usr/bin/make
  2. #
  3. # Makefile for building Linux Broadcom Gigabit ethernet driver as a module.
  4. #

  5. KVER=
  6. ifeq ($(KVER),)
  7.         KVER=$(shell uname -r)
  8. endif

  9. #e
  10. BCMCFGDIR=
  11. BCMSRCDIR=

  12. ifeq ($(BCMCFGDIR),)
  13.         ifeq ($(shell ls /lib/modules/$(KVER)/build > /dev/null 2>&1 && echo build),)
  14.                 ifneq ($(shell ls /usr/src/linux > /dev/null 2>&1 && echo linux),)
  15.                         BCMCFGDIR=/usr/src/linux
  16.                 endif
  17.         else
  18.                 BCMCFGDIR=/lib/modules/$(KVER)/build
  19.                 ifneq ($(shell ls /lib/modules/$(KVER)/source > /dev/null 2>&1 && echo source),)
  20.                         BCMSRCDIR=/lib/modules/$(KVER)/source
  21.                 endif
  22.         endif
  23. endif

  24. ifeq ($(BCMSRCDIR),)
  25.         BCMSRCDIR=$(BCMCFGDIR)
  26. endif

  27. ifeq ($(BCMCFGDIR),)
  28.         $(error Linux kernel config directory not found)
  29. endif

  30. # PREFIX may be set by the RPM build to set the effective root.
  31. PREFIX=

  32. ifeq ($(BCMMODDIR),)
  33.         ifeq ($(shell ls /lib/modules/$(KVER)/updates > /dev/null 2>&1 && echo 1),1)
  34.                 BCMMODDIR=/lib/modules/$(KVER)/updates
  35.         else
  36.                 ifeq ($(shell grep -q "search.*[[:space:]]updates" /etc/depmod.conf > /dev/null 2>&1 && echo 1),1)
  37.                         BCMMODDIR=/lib/modules/$(KVER)/updates
  38.                 else
  39.                         ifeq ($(shell grep -q "search.*[[:space:]]updates" /etc/depmod.d/* > /dev/null 2>&1 && echo 1),1)
  40.                                 BCMMODDIR=/lib/modules/$(KVER)/updates
  41.                         else
  42.                                 BCMMODDIR=/lib/modules/$(KVER)/kernel/drivers/net
  43.                         endif
  44.                 endif
  45.         endif
  46. endif

  47. ifeq ($(shell [ -e /etc/SuSE-release ] && echo 1),1)
  48.         SUSEVERS = $(shell grep VERSION /etc/SuSE-release | sed -e 's/.*= //')
  49. else
  50.         SUSEVERS = 0
  51. endif

  52. # check if 2.4 kernel or 2.5+ kernel
  53. BCM_KVER := $(shell echo $(KVER) | cut -c1-3 | sed 's/2\.[56]/2\.6/')

  54. ifeq ($(BCM_KVER), 2.6)
  55. # Makefile for 2.5+ kernel

  56. BCM_DRV = tg3.ko

  57. ifneq ($(KERNELRELEASE),)

  58. obj-m += tg3.o

  59. else

  60. default: tg3_flags.h supported_file
  61.         make -C $(BCMCFGDIR) SUBDIRS=$(shell pwd) modules

  62. endif

  63. else # ifeq ($(BCM_KVER),2.6)
  64. # Makefile for 2.4 kernel

  65. BCM_DRV = tg3.o

  66. CC = gcc

  67. CFLAGS=-DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -I$(BCMCFGDIR)/include -fno-strict-aliasing

  68. ifeq ($(shell grep netif_poll_disable $(BCMSRCDIR)/include/linux/netdevice.h > /dev/null 2>&1 && echo newnetif),)
  69.   CFLAGS+=-DOLD_NETIF
  70. endif

  71. ARCH:=$(shell uname -m)

  72. ifeq ($(ARCH),x86_64)
  73.   CFLAGS+=-mno-red-zone -mcmodel=kernel -pipe -finline-limit=2000
  74. endif

  75. ifeq ($(ARCH),ia64)
  76.   CFLAGS+=-pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32
  77. endif

  78. ifeq ($(ARCH),ppc64)
  79.   ifneq ($(shell ls /opt/cross/bin/powerpc64-linux-gcc > /dev/null 2>&1 && echo ppcgcc),)
  80.     CC=/opt/cross/bin/powerpc64-linux-gcc
  81.   endif

  82.   CFLAGS+=-fno-common -fomit-frame-pointer -msoft-float -pipe -mminimal-toc -fno-builtin
  83. endif

  84. CFLAGS += -O2

  85. all: tg3_flags.h supported_file tg3.o

  86. endif # ifeq ($(BCM_KVER),2.6)

  87. tg3_flags.h:
  88.         sh makeflags.sh $(BCMSRCDIR) > tg3_flags.h

  89. tg3.4.gz:
  90.         gzip -c tg3.4 > tg3.4.gz


  91. ifeq ($(BCM_KVER), 2.6)
  92. install: default tg3.4.gz
  93. else
  94. install: $(BCM_DRV) tg3.4.gz
  95. endif
  96.         mkdir -p $(PREFIX)/$(BCMMODDIR);
  97.         install -m 444 $(BCM_DRV) $(PREFIX)/$(BCMMODDIR);
  98.         @if [ "$(PREFIX)" = "" ]; then /sbin/depmod -a ;\
  99.         else echo " *** Run '/sbin/depmod -a' to update the module database.";\
  100.         fi
  101.         install -m 444 tg3.4.gz $(PREFIX)/usr/share/man/man4;\

  102. .PHONEY: all supported_file clean install

  103. supported_file:
  104.         @if [ $(SUSEVERS) -ge 11 ]; then \
  105.                 echo "tg3.ko external" > Module.supported; \
  106.         fi

  107. clean:
  108.         -rm -f tg3.o tg3.ko tg3.mod.c tg3.mod.o tg3.4.gz tg3_flags.h .tg3* Module.symvers modules.order
  109.         -rm -rf .tmp_versions Module.supported


复制代码

论坛徽章:
0
13 [报告]
发表于 2009-09-11 15:30 |只看该作者
上面这是Makefile的内容,麻烦各位帮忙看下

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
14 [报告]
发表于 2009-09-11 21:35 |只看该作者

回复 #10 zhou2324 的帖子

Linux没有configure命令,编译安装时候configure调用的是一个脚本.
安装readme的提示直接make就行了

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
15 [报告]
发表于 2009-09-11 21:36 |只看该作者

回复 #11 zhou2324 的帖子

内核源码包安装了?

论坛徽章:
0
16 [报告]
发表于 2009-09-12 09:03 |只看该作者
原帖由 chenyx 于 2009-9-11 21:36 发表
内核源码包安装了?


还是chenyx牛,一眼就看出来了

论坛徽章:
0
17 [报告]
发表于 2009-09-16 18:27 |只看该作者
看一看环境变量PATH什么的

论坛徽章:
1
天秤座
日期:2013-10-23 13:20:42
18 [报告]
发表于 2009-09-16 19:24 |只看该作者
. ./configre

论坛徽章:
0
19 [报告]
发表于 2009-09-25 15:30 |只看该作者

回复 #1 zhou2324 的帖子

1、现在新的linux的内核 将对应的网卡选择为模块
2、下载对应的源码驱动编译
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP