自从上次捣鼓了SD卡烧录系统后,就继续按照手册进行下一步——TFTP方式烧录,本人使用的Ubuntu 12.04 系统,基本上是按照手册操作,遇到了一些问题,索性有万能的google,这里列出一些跟手册有出入的地方:
首先是TFTP的搭建,因为我用的不是fedora系统,所有有些不同:
sudo apt-get install tftp-hpa tftpd-hpa xinetd
在根目录下创建文件夹/tftpboot/
修改目录权限chmod -R 777 /tftpboot/
修改tftp配置文件,如果没有就创建
#vim /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/
source = 11
cps = 100 2
flags =IPv4
}
修改inetd.conf文件
# vim /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd
/usr/sbin/in.tftpd /tftpboot/
其中/tftpboot/root为 tftp共享目录
修改tftpd-hpa文件
# vim /etc/default/tftpd-hpa
#RUN_DAEMON="no"
#OPTIONS="-s /tftpboot/root -c -p -U tftpd"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot/root"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
这样就算装好了,对了,不要忘了重新启动tftp服务。service tftpd-hpa restart
在/tftp目录下创建任意文件:123.txt
tftp localhost 进入tftp命令行
get 123.txt
看是否下载成功
下面贴一下打印的信息:
……………………………………………………………………
Helper2416 # tftp c0000000 zImage
smc911x: initializing
smc911x: detected LAN9220 controller
smc911x: phy initialized
smc911x: MAC 00:40:5c:26:0a:5b
TFTP from server 192.168.0.3; our IP address is 192.168.0.20
Filename 'zImage'.
Load address: 0xc0000000
Loading: ################################################################# ………………
done
Bytes transferred = 1923264 (0x1d58c0)
Helper2416 # nand erase 40000 3c0000
NAND erase: device 0 offset 0x40000, size 0x3c0000
Erasing at 0x3e0000 -- 100% complete.
OK
Helper2416 # nand write.i c0000000 40000 3c0000
NAND write: device 0 offset 0x40000, size 0x3c0000
Writing data at 0x3ff800 -- 100% complete.
3932160 bytes written: OK
Helper2416 # set bootcmd 'nand read.i c0008000 0x40000 0x400000;bootm c0008000'
Helper2416 # save
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x20000 -- 100% complete.
Writing to Nand... done
Helper2416 # tftp c0000000 root-qtopia.img
smc911x: initializing
smc911x: detected LAN9220 controller
smc911x: phy initialized
smc911x: MAC 00:40:5c:26:0a:5b
TFTP from server 192.168.0.3; our IP address is 192.168.0.20
Filename 'root-qtopia.img'.
Load address: 0xc0000000
Loading:
#################################################################
#################################################################
………………………………
done
Bytes transferred = 60386304 (0x3996c00)
Helper2416 # nand erase 400000
NAND erase: device 0 offset 0x400000, size 0xfc00000
Skipping bad block at 0x03c00000
Skipping bad block at 0x04920000
Skipping bad block at 0x04a40000
Erasing at 0xffe0000 -- 100% complete.
OK
Helper2416 # nand write.yaffs c0000000 400000
NAND write: device 0 offset 0x400000, size 0xfc00000
Input block length is not page aligned
Data did not fit into device, due to bad blocks
264241152 bytes written: ERROR
Helper2416 # $filesize
Unknown command '3996C00' - try 'help'
Helper2416 # nand write.yaffs c0000000 400000
NAND write: device 0 offset 0x400000, size 0xfc00000
Input block length is not page aligned
Data did not fit into device, due to bad blocks
264241152 bytes written: ERROR
Helper2416 # $filesize
Unknown command '3996C00' - try 'help'
Helper2416 # nand write.yaffs c0000000 400000 $filesize
NAND write: device 0 offset 0x400000, size 0x3996c00
Writing data at 0x3bd7800 -- 100% complete.
60386304 bytes written: OK
Helper2416 # set bootargs
Helper2416 # root=/dev/mtdblock2 console=ttySAC0,115200
Helper2416 # set bootargs root=/dev/mtdblock2 console=ttySAC0,115200
Helper2416 # save
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x20000 -- 100% complete.
Writing to Nand... done
Helper2416 # boot
文章评论(0条评论)
登录后参与讨论