BUILDROOT ip:找不到设备eth0

时间:2015-10-26 01:18:12

标签: linux-kernel network-programming buildroot

我的VirtualMachine上的buildroot网络有问题。当我输入ifconfig我得到答案:

eth0:获取接口信息时出错:找不到设备

在控制台上加载buildroot时,我看到:

ip:找不到设备eth0

ip:SI0CGIFFALGS:没有这样的设备

我找不到解决这个问题的方法。

4 个答案:

答案 0 :(得分:4)

# make linux-menuconfig

Device drivers —>
Network device support —>
Ethernet driver support—>

选择

<*>     Intel(R) PRO/100+ support                                
<*>     Intel(R) PRO/1000 Gigabit Ethernet support               
<*>     Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support    
<*>     Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support
[*]     Intel(R) PCI-Express Gigabit adapters HWMON support  
<*>     Intel(R) 82576 Virtual Function Ethernet support     

现在应该使用VM。

答案 1 :(得分:1)

您的问题不是Buildroot问题,而是内核配置问题。

答案 2 :(得分:0)

关于如何找到VM真正需要的NIC驱动程序的更有用的解释。

首先,使用lspci查找NIC的关键字。

  

lspci | grep -i ethernet

     

00:03.0以太网控制器:英特尔公司 82540EM 千兆位   以太网控制器(rev 03)

然后,在内核驱动程序源代码目录中grep关键字:

grep -nr'82540EM'driver / net / ethernet /

  

的驱动/净/以太网/英特尔/ E1000 / e1000_hw.h:417:#定义   E1000_DEV_ID_82540EM 0x100E   drivers / net中/以太网/英特尔/ E1000 / e1000_hw.h:418:#定义   E1000_DEV_ID_82540EM_LOM 0x1015   drivers / net / ethernet / intel / e1000 / e1000_main.c:780:case   E1000_DEV_ID_82540EM:   drivers / net / ethernet / intel / e1000 / e1000_main.c:781:case   E1000_DEV_ID_82540EM_LOM:   drivers / net / ethernet / intel / e1000 / e1000_hw.c:276:case   E1000_DEV_ID_82540EM:   drivers / net / ethernet / intel / e1000 / e1000_hw.c:277:case   E1000_DEV_ID_82540EM_LOM:

最后,找到NIC的内核配置: 在相同的目录路径下打开相应的Makefile。

  

vim drivers / net / ethernet / intel / e1000 / Makefile   你会发现:

     

obj - $( CONFIG_E1000 )+ = e1000.o

     

e1000-objs:= e1000_main.o e1000_hw.o e1000_ethtool.o e1000_param.o

结论: CONFIG_E1000是您的NIC需要的。

答案 3 :(得分:0)

在启动日志的最后一行,您可以添加Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support作为@TadejP。

[    0.204512] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    0.205444] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    0.220165] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
[    0.362077] ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100
[    0.362908] ata1.00: 4280320 sectors, multi 16: LBA48
[    0.364110] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
[    0.365246] ata2.00: configured for MWDMA2
[    0.366176] ata1.00: configured for MWDMA2
[    0.366846] scsi 0:0:0:0: Direct-Access     ATA      QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
[    0.368118] sd 0:0:0:0: [sda] 4280320 512-byte logical blocks: (2.19 GB/2.04 GiB)
[    0.369219] sd 0:0:0:0: [sda] Write Protect is off
[    0.369916] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.371218] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    0.372213] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     2.5+ PQ: 0 ANSI: 5
[    0.387384]  sda: sda1 sda2 sda3
[    0.388409] sr 1:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
[    0.389298] cdrom: Uniform CD-ROM driver Revision: 3.20
[    0.390163] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.390976] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    0.548201] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
[    0.549265] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection