|
发表于 2010-11-10 23:04:30
|
显示全部楼层
1.setenv bootargs noinitrd console=ttyS0 mtdparts=physmap-flash.0:64k(Boot),192k(UBoot),1536k(Kernel),2176k(Root),128k(Opt) root=/dev/mtdblock3 rootfstype=cramfs mem=32m
2./opt/run.sh 为初始化脚本,可以根据需要添加命令如下:
run.sh
#init mac address
/sbin/ifconfig eth0 hw ether 00:11:22:33:44:50
#init ip address
/sbin/ifconfig eth0 192.168.1.45
/sbin/ifconfig eth0:0 192.168.0.23
/sbin/ifconfig lo up
#surport for ip forward
echo "1" >/proc/sys/net/ipv4/ip_forward
#set iptables for route
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
#add gateway
route add default gw 192.168.1.1
3.flash分区改动如下:
10000000 ----------->boot
10010000 ----------->uboot
10040000 ----------->kernel
101c0000 ----------->rootfs(cramfs)
最后128k为opt分区,mount为jiffers2文件系统.
4.用户操作:
/tmp/下mount为ramfs,可以读写,掉电丢失
/opt/下为jiffers2,可读可写,掉电保存,但仅有128k
5.主机和目标版传输数据
tftp -g -r filename serverip
推荐在/tmp/下下载
6.交叉编译器采用的是eldk工具链:
arm-2006-01-16.iso为一个镜像文件。先把他mount到一个文件夹下,然后执行install
相关命令:mount -o loop arm-2006-01-16 /mnt |
|