终端下首先要用minicom连接开发板,然后可见如下内容,ls列目录:
[/mnt/yaffs]ls
485 da ide lost+found serial_8250 web Qtopia exp init.sh motor sound wireless ad fpga irda mplayer touchscreen bluetooth gps_gprs kbd_gpm pcmcia-mod ucos can iccard lib sdcard video 红色的这个就是我们要修改的文件:init.sh
然后,我们使用vi工具对其进行修改:如下(
如何使用vi?)
[/mnt/yaffs]vi init.sh
#!/bin/shifconfig eth0 192.168.1.100#ifconfig eth1 192.168.1.117route add default gw 192.168.1.1 netmask 255.255.255.0inetd#if [ -f /mnt/yaffs/iccard/i2c-tops2.o ]; then#insmod /mnt/yaffs/iccard/i2c-tops2.o#filn -s /dev/tts/2 /dev/ttyS2#test pcmcia and sd card#cd /mnt/yaffs/sdcard; ./inssd.sh#cd /mnt/yaffs/pcmcia-mod; ./inspcm.sh#/mnt/yaffs/pcmcia-mod/cardmgrinsmod ./iccard/i2c-tomega8.o#version 2410s 1.6其中,我标识出来的三处红色字依次为:eth0设备的IP地址、网关及子网掩码。
编辑好后“:x”保存并退出,重启开发板后,ifconfig,可见如下:
[/mnt/yaffs]ifconfig
eth0 Link encap:Ethernet HWaddr 00:D0:CF:00:00:02 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 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:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:2 Base address:0x200 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)
可见,更改成功!希望本文能够帮助你。
阅读(1450) | 评论(0) | 转发(0) |