6、更新内核后,插好网线,输入如下指令:
ifconfig eth0 192.168.1.5 up
注意,IP地址一定要设置在自己的局域网内。
这时应该就能PING通路由了。
/ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.494 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.236 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.242 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.217 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.217/0.297/0.494/0.114 ms
/ #
但是这时还无法PING外网,输入如下指令:
busybox ip route add default via 192.168.1.1
setprop net.dns1 192.168.1.1
PING新浪网址:
/ # ping www.sina.com
PING gacrux.sina.com.cn (58.63.236.236) 56(84) bytes of data.
64 bytes from 58.63.236.236: icmp_seq=1 ttl=56 time=22.1 ms
64 bytes from 58.63.236.236: icmp_seq=2 ttl=56 time=21.2 ms
64 bytes from 58.63.236.236: icmp_seq=3 ttl=56 time=21.7 ms
^C
--- gacrux.sina.com.cn ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 21.213/21.698/22.173/0.410 ms
/ #
可见,已经能够正常PING通。点击浏览器,会弹出没有连接网络的提示,不用管它,应该能浏览网页了。
7、以上虽然能正常上网,但是每次都需手动设置IP和网关,比较麻烦,修改
android_gingerbread_v10/android/device/samsung/smdkv210目录下的init.smdkv210.rc
文件,修改dns为自己通用的DNS,我这里为192.168.1.1
on boot
mount debugfs /sys/kernel/debug /sys/kernel/debug
setprop ro.build.product smdkv210
setprop ro.product.device smdkv210
setprop ro.radio.noril no
setprop net.dns1 192.168.1.1
setprop net.dns2 192.168.1.1
修改android_gingerbread_v10/android/device/samsung/init.rc文件,在最末添加如下内容:
service eth_ifconfig /system/bin/ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
oneshot
service eth_route /system/bin/route add default gw 192.168.1.1 dev eth0
oneshot
再./mk -s,生成新的x210-uramdisk.img文件,使用fastboot更新,重启开发板,就能上网了。