tftp搭建安装 & uboot使用tftp下载内核

来源:互联网 发布:手机扫描照片软件 编辑:程序博客网 时间:2024/05/02 01:56
一、Linux下搭建tftp
1、
sudo apt-get install tftp-hpa tftpd-hpa

2、
sudo apt-getinstall xinetd

3、

ls /etc/xinetd.conf  如果没有这个文件就在/etc目录下面新建一个,修改内容如下:

# Simple configuration file for xinetd#  # Some defaults, and include /etc/xinetd.d/ defaults   {    # Please note that you need a log_type line to be able to use log_on_success # and log_on_failure. The default is the following : # log_type = SYSLOG daemon info }    includedir /etc/xinetd.d


4、
cd /etc/xinetd.d   没错,xinetd.d就是一个文件夹,在该目录下面新建tftp文件,修改内容如下:

service tftp   {       disable         = nosocket_type     = dgram      protocol        = udp      wait            = yes      user            = root       server          = /usr/sbin/in.tftpd       server_args     = -s //home/clbiao/work/tftpboot -c    source          = 11      cps             = 100 2   gs =IPv4   }
关键是修改server_args项:进行tftp传输文件时就是在这个目录里面搜索的

5、
修改配置文件/etc/default/tftpd-hpa:tftp目录和该目录的属性

TFTP_DIRECTORY="/home/clbiao/work/tftpboot"
TFTP_OPTIONS="-l -c -s"


6、

chmod -R 777 /home/clbiao/work/tftpboot

7、

重启tftp服务:

sudo service tftpd-hpa restart

重加载tftp脚本并将其重启

sudo /etc/init.d/xinetd reload
sudo /etc/init.d/xinetd restart


8、
查看安装结果命令:netstat -a | grep tftp

显示:

udp        0      0 *:tftp                  *:*

二、若在windows下搭建tftp:只需安装tftpd32

三、uboot使用tftp下载内核到SDRAM
:(可以任选ping主机还是虚拟机)
1、ping win_ip(or:linux_ip)
2、将内核文件放到tftp的目录下面
3、tftpboot 0x3xxxxxxx file_name(eg:zImage.bin)


四、将SDRAM上的内核写到nand Flash上面
1、nand erase [clean] [off size]
[clean]:是分区的起始地址地址
[offsize]:是偏移地址,即擦除的大小
eg:nand erase 200000 300000

2、nand write [src_addr] [target_addr] [size]
eg:nand write 31000000 200000 300000  从SDRAM上0x31000000处开始的0x300000大小的区域内容写到nand的0x200000处开始的地方

3、从nand启动内核
boot_zImage







0 0
原创粉丝点击