Ubuntu 12.04 에서 tftp 서버 설정

 

1. Install

$ sudo apt-get install tftp tftpd xinetd

 

2. xinetd 셋업

 

 $ sudo vi /etc/xinetd.d/tftp

# default: off
# description: The tftp server serves files using the Trivial File Transfer \
#    Protocol.  The tftp protocol is often used to boot diskless \
#    workstations, download configuration files to network-aware printers, \
#    and to start the installation process for some operating systems.
service tftp
{
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot
    disable         = no
}

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R root /tftpboot/
$ sudo service xinetd restart

 

3. test

 

$ echo "Hello, embedded world" > /tftpboot/hello.txt"
$ cd /tmp
$ tftp localhost
tftp> get hello.txt
Received 7 bytes in 0.1 seconds
tftp> quit
$ cmp /tftpboot/hello.txt /tmp/hello.txt

4. u-boot 에서 동작

 

> setenv ipaddr 192.168.1.162
> setenv serverip 192.168.1.110
> tftpboot uImage; bootm