网络配置
启动时如果看到下面的log,说明网络没有准备好
_ _ _ _ _ _ _ _ _ _ _ _
\ _ _ _ _ _ ___
/ /__/ \ |_/
/ __ / - _ ___
/ / / / / /
_ _ _ _/ / / \_/ \_ ______
___________\___\__________________
[RCS]: /etc/init.d/S00devs
mknod: /dev/console: File exists
mknod: /dev/ttyAMA0: File exists
mknod: /dev/null: File exists
[RCS]: /etc/init.d/S01udev
udev[67]: starting version 167
[RCS]: /etc/init.d/S80network
[RCS]: /etc/init.d/S90hibernate
Auto login as root ...
login[94]: root login on 'ttyS000'
Welcome to HiLinux.
None of nfsroot found in cmdline.
vi /etc/init.d/S80network
配置网络参数,参考下面参数进行配置:
#!/bin/sh
ipaddr=192.168.1.10
bootp=
gateway=192.168.1.1
netmask=255.255.255.0
hostname=
netdev=eth0
autoconf=
要注意的是 netdev=eth0
中的 eth0
不是随便起的!!。 执行ifconfig -a
得到下面的输出,eth0
便是要填入到netdev
的参数。不对的话会提示 ifconfig: SIOCSIFADDR: No such device
。
eth0 Link encap:Ethernet HWaddr E6:BF:13:2D:95:B6
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::e4bf:13ff:fe2d:95b6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:834 errors:0 dropped:1 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70986 (69.3 KiB) TX bytes:648 (648.0 B)
Interrupt:57
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 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)
reboot
重启看到下面这样就是可以了,也可以通过ping进行验证
_ _ _ _ _ _ _ _ _ _ _ _
\ _ _ _ _ _ ___
/ /__/ \ |_/
/ __ / - _ ___
/ / / / / /
_ _ _ _/ / / \_/ \_ ______
___________\___\__________________
[RCS]: /etc/init.d/S00devs
mknod: /dev/console: File exists
mknod: /dev/ttyAMA0: File exists
mknod: /dev/null: File exists
[RCS]: /etc/init.d/S01udev
udev[67]: starting version 167
[RCS]: /etc/init.d/S80network
IP: 192.168.1.10
BOOTP:
GATEWAY: 192.168.1.1
NETMASK: 255.255.255.0
HOSTNAME:
NETDEV: etIPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
h0
AUTOCONF:
[RCS]: /etc/init.d/S90hibernate
Auto login as root ...
login[122]: root login on 'ttyS000'
Welcome to HiLinux.
None of nfsroot found in cmdline.
~ # hi_gmac_v200 10050000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
开启telnet服务
执行telnetd &
即可。如果需要开机启动该复位,需要把命令添加到/etc/profile
中。
访问开发板
我这使用的工具是MobaXtern,如下图配置工具
连击到telnet后,访问用户名为
root
,密码为空(busybox的默认配置),直接敲回车