新做的一块板子,程序是做到SD卡里面,全部自动烧录的,包括Uboot,Kernel,Filesystem;所以程序是一样的,
现在问题是,网卡启动不了:
查看Uboot的参数发现:ethaddr=00:00:00:00:00:00
然后进入系统后,
ifconfig只有
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
但是我ifconfig -a
却是有:
~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3174 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:201028 (196.3 KiB) TX bytes:1890 (1.8 KiB)
Interrupt:5 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
没有发现eth0网卡,于是手动启动网卡,ifup eth0
提示:
Ignoring unknown interface eth0
解决方法:
在/etc/network/interfaces添加
auto eth0
iface eth0 inet dhcp
然后我重新启动网卡:/etc/init.d/networking restart
结果卡死在:
udhcpc: sendto: Network is down
然后我重启系统,还是卡死在:
udhcpc: sendto: Network is down
仔细一想,这个MAC地址不是自动分配的吗?为什么没有呢,
不管那么多,我在UBOOT里面手动给分配了一个MAC地址,再重启,问题就这么解决了,也可以下载程序了,但是我也不知道为什么MAC没有自动分配;
~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:AA:BB:CC:DD
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23279 (22.7 KiB) TX bytes:1890 (1.8 KiB)
Interrupt:5 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)