This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TFTP on Ubuntu 10.04

Other Parts Discussed in Thread: OMAP-L138

I'm running 64-bit Ubuntu 10.04. I followed http://processors.wiki.ti.com/index.php/Setting_Up_a_TFTP_Server to set up tftpd-hpa, but haven't been able to get it to work.  No tftp process is running ("netstat -a | grep tftp" returns nothing), but when I use the command:  "sudo service tftpd-hpa start", it says tftpd-hpa is already running.   I edited the /etc/default/tftpd-hpa file as instructed, but I can't ftp files using my custom board or my Windows machine (pinging the Linux Host's IP Address works for both).

Any ideas?

  • Hello,

    The TFTP server is managed by xinetd. You need to make sure xinetd is installed and that you have en entry such as this in /etc/xinet.d/tftp:

    service tftp
    {
    protocol = udp
    port = 69
    socket_type = dgram
    wait = yes
    user = nobody
    server = /usr/sbin/in.tftpd
    server_args = /tftproot
    disable = no
    }

    Then run /etc/init.d/xinetd restart

    Note that if you use DVSDK 4.00 (announced at the top of this forum) this is done for you by the setup script. Just make sure you have ia32-libs installed on your 64-bit host before installing.

    Regards, Niclas

  • The behaviour is different on my Windows machine:  it now times out instead saying that the connection was refused.  The timeout is for GET and PUT.  My custom board has the same behaviour as before: still times out when trying to get uImage.  "Netstat -a | grep tftp" does return a tftp process now.

  • Hi Inderjit,

    I had problems using tftpd in a VMware virtual machine. I solved the problem momentarily making a script that configures TFTP server in a Ubuntu 10.04 live session. I just execute it and then I can download images from the board. Maybe it helps you:

    #!/bin/bash

    # ======================================
    # SCRIPT TO INSTALL AND CONFIGURE UBUNTU
    # TFTP SERVER TO WORK WITH OMAP-L138 EVM
    # ======================================
    #                         By cerilet.com

    # Install TFTP client and server and SSH
    sudo apt-get install tftpd-hpa tftp-hpa ssh

    # Changing permissions of directory /var/lib/tftpboot
    sudo chmod 777 /var/lib/tftpboot

    # Change configuration of tftpd-hpa and add this
    # RUN_DAEMON="yes"
    # OPTIONS="-c -l -s /tftpboot"
    sudo mv /etc/default/tftpd-hpa /etc/default/tftpd-hpa_ORIGINAL
    # Downloading the new configuration file from my server
    sudo wget -O /etc/default/tftpd-hpa http://cerilet.com/omap/tftpd-hpa

    # Start the server
    sudo /etc/init.d/tftpd-hpa start

    # Downloading kernel and filesystem images from server
    wget  -O /var/lib/tftpboot/uImage_arago http://cerilet.com/omap/uImage_arago
    wget  -O /var/lib/tftpboot/uImage_dani http://cerilet.com/omap/uImage_dani
    wget  -O /var/lib/tftpboot/uImage_dani2 http://cerilet.com/omap/uImage_dani2
    wget  -O /var/lib/tftpboot/uImage_DaVinci http://cerilet.com/omap/uImage_DaVinci

    wget  -O /var/lib/tftpboot/arago.ext2.gz http://cerilet.com/omap/arago.ext2.gz
    wget  -O /var/lib/tftpboot/arago.jffs2 http://cerilet.com/omap/arago.jffs2
    wget  -O /var/lib/tftpboot/arago.tar.gz http://cerilet.com/omap/arago.tar.gz

    wget  -O /var/lib/tftpboot/evm-demo-img.ext2.gz http://cerilet.com/omap/evm-demo-img.ext2.gz
    # wget -O /var/lib/tftpboot/evm-demo-img.jffs2 http://cerilet.com/omap/evm-demo-img.jffs2
    # wget -O /var/lib/tftpboot/evm-demo-img.tar.gz http://cerilet.com/omap/evm-demo-img.tar.gz

    # Changing password of the live CD user
    sudo passwd ubuntu

    Regards,

    Cerilet.

  • Thanks.  I didn't run the full script, just the following:

    sudo apt-get install tftpd-hpa tftp-hpa ssh

    sudo chmod 777 /var/lib/tftpboot

    sudo mv /etc/default/tftpd-hpa /etc/default/tftpd-hpa_ORIGINAL


    sudo wget -O /etc/default/tftpd-hpa http://cerilet.com/omap/tftpd-hpa

    I then rebooted the machine, and the behaviour is the same:  all attempts to use tftp time out.

  • Had you reviewed the iptables configuration? Or maybe if you are using a router have to open the tftp port (69).

    Take a look to this post:

    http://blog.colovirt.com/2009/03/31/linuxnetworkingsecurity-tftp-deamon-setup-and-cisco-configuration-backup/

  • The settings that work for PC to Linux Box:

    /etc/default/tftpd-hpa:

    #Defaults for tftpd-hpa
    RUN_DAEMON=”yes”
    OPTIONS=”-c -l -s /tftpboot”

    /etc/xinetd.d/tftp

    service tftp
    {
    protocol = udp
    port = 69
    socket_type = dgram
    wait = yes
    user = root
    server = /usr/sbin/in.tftpd
    server_args = -c -s /tftpboot
    disable = no
    per_source = 11
    cps = 100 2
    }

    Commenting out "ftp dgram udp4 wait root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpboot" in  /etc/inetd.conf does not seem to make a difference, and neither does "root" vs. "nobody" as the owner of /tftpboot.  "user = root" in /etc/xinetd.d/tftp vs "nobody" does make a difference:  TFTP does not work on the Window PC to the Linux Host without it.

    For the custom board, I'm getting some results.  Instead of a "*" turning into a series of "T"s (indicating timeouts), I'm now getting some "#"s, but a lot more "T"s.  This may be a hardware or U-Boot issue, but it's odd that the router can assign an IP address to the board (which can be picked up by DCHP on the custom board), and ping works to the Linux Box and Windows PC from the custom board.

  • Not sure why, but it's working on the custom board now.  I set "unsigned int    emac_dbg = 1;" in ether.c (u-boot), and it worked.  Setting it back to 0 also works.  Perhaps I handn't done a full build of u-boot in a while.  One timeout in downloading the root file system - not sure what's causing it.

  • I am having similar issues getting DM355 PSP 3.1 - to TFTP Boot.  I have followed all the items on the wiki, e2e and even some google ubuntu/tftp searches but still stuck.

    Here is my /etc/init.d/xinetd and /etc/default/tftp-hpa files:

    # /etc/default/tftpd-hpa

    RUN_DAEMON="yes"
    USERNAME="tftp"
    # DIRECTORY="/srv/tftp"
    DIRECTORY="/tftpboot"
    ADDRESS="0.0.0.0:69"
    OPTIONS="-c -l -s /tftpboot"

    user@marc-laptop:/etc/xinetd.d$ cat tftp
    service tftp
    {
    protocol = udp
    port = 69
    socket_type = dgram
    wait = yes
    user = root
    server = /usr/sbin/in.tftpd
    server_args = -c -l -s /tftpboot
    per_source = 11
    cps = 100 2
    disable = no
    }

    I keep getting 'Could Not establish Link'


    DM355 EVM > tftp 0x80700000 uImage
    dm9000 i/o: 0x4014000, id: 0x90000a46
    DM9000: running in 16 bit mode
    MAC: 00:0e:99:02:ce:78
    could not establish link
    TFTP from server 192.168.1.2; our IP address is 192.168.1.3
    Filename 'uImage'.
    Load address: 0x80700000
    Loading: T
    Abort
    DM355 EVM >
     CTRL-A Z for help |115200

  • Marc,

     

    Can you share your bootargs as well as your environment settings?  I want to see how DHCP or your static IP is setup as well as all the other network and environment settings. 

  • Jeff,

    DM355 EVM > pri
    bootdelay=4
    baudrate=115200
    bootcmd=dhcp;bootm
    serverip=192.168.1.2
    bootfile=uImage
    nfshost=192.168.1.2
    rootpath=/home/user/workdir/filesystem
    ethaddr=00:0e:99:02:ce:78
    bootargs=console=ttyS0,115200n8 rw noinitrd root=/dev/nfs nfsroot=192.168.1.2:/home/user/workdir/filesystem,nolock mem=116M ip=
    dhcp
    stdin=serial
    stdout=serial
    stderr=serial
    videostd=ntsc
    ver=U-Boot 2009.03 (Jun 21 2010 - 15:13:07)
    ipaddr=192.168.1.3
    gatewayip=192.168.1.1
    netmask=255.255.255.0
    dnsip=192.168.1.1

    Environment size: 481/524284 bytes
    DM355 EVM > tftp 0x80700000 uImage
    dm9000 i/o: 0x4014000, id: 0x90000a46
    DM9000: running in 16 bit mode
    MAC: 00:0e:99:02:ce:78
    operating at 100M full duplex mode
    TFTP from server 192.168.1.2; our IP address is 192.168.1.3
    Filename 'uImage'.
    Load address: 0x80700000
    Loading: T T T T T
    Abort

    DM355 EVM > dhcp
    dm9000 i/o: 0x4014000, id: 0x90000a46
    DM9000: running in 16 bit mode
    MAC: 00:0e:99:02:ce:78
    could not establish link
    BOOTP broadcast 1
    BOOTP broadcast 2

    Abort
    DM355 EVM >

  • Along w/ environment and the previous post w/  /etc/xinet.d/tftp and /etc/default/tftp-hpa files, i have done the following to restart the services.  Still no success?

    user@marc-laptop:/etc/xinetd.d$ sudo service tftpd-hpa restart
    tftpd-hpa start/running


    user@marc-laptop:/etc/xinetd.d$ sudo service xinetd restart
     * Stopping internet superserver xinetd                                                                        [ OK ]
     * Starting internet superserver xinetd                                                                        [ OK ]
    user@marc-laptop:/etc/xinetd.d$

  • I would advise people who don't know whether the problem is the linux server or the embeded client to use another PC as a client to tftp a file and eliminate one of the two possibilities.

    John A

  • I would try this but another complete setup, 'Ubuntu HOST' + 'DM355 EVM' at another site is experiencing the same problem.  I have been playing w/ the

    /etc/xinetd.conf
    /etc/xinetd.d/tftp
    /etc/default/tftp-hpa

    files and i'm now NOT getting 'could not establish link', and instead its just timing out. 


    DM355 EVM > tftp 0x80700000 uImage_dm355
    dm9000 i/o: 0x4014000, id: 0x90000a46
    DM9000: running in 16 bit mode
    MAC: 00:0e:99:02:ce:78
    operating at 100M full duplex mode
    TFTP from server 192.168.1.2; our IP address is 192.168.1.3
    Filename 'uImage_dm355'.
    Load address: 0x80700000
    Loading: T T T
    Abort
    DM355 EVM >

    ======================================================

    I've also tried to tftp locally to take the EVM out of the equation.

    user@marc-laptop:/etc/xinetd.d$ sudo tftp -v localhost -c get uImage_dm355
    Connected to localhost (::1), port 69
    getting from localhost:uImage_dm355 to uImage_dm355 [netascii]
    Transfer timed out.

    ======================================================

    So there must be something wrong w/ my xinetd and/or tftp-hpa setup?

    I have also verified the Firewall is off.

     

  • The following is something I found off the internet when I first set up my TFTP.  I didn't use the method in the DVSDK.

    Installing and setting TFTPD in Ubuntu

    by David Sudjiman ~ March 27th, 2006.
    Filed under: Linux.

    1. Install tftpd and related packages.

    $ sudo apt-get install xinetd tftpd tftp

    2. Create /etc/xinetd.d/tftp and put this entry:

    service tftp

    {
     
    protocol        = udp
     
    port            = 69
     
    socket_type     = dgram
     
    wait            = yes
     
    user            = nobody
     
    server          = /usr/sbin/in.tftpd
     
    server_args     = /tftpboot
     
    disable         = no

    }

    3. Make /tftpboot directory

    $ sudo mkdir /tftpboot

    $ sudo chmod -R 777 /tftpboot

    $ sudo chown -R nobody /tftpboot

    4. Restart xinetd

    $ sudo /etc/inet.d/xinetd restart

    John A

  • John,

    I went through these steps several times to no avail.  I went as far as removing tftp-hpa and reinstalling it.  Still stuck.

  • Marc,

    If you have DVSDK 4.x installed on your host machine then it will make tftp setup process very easy. TFTP/NFS setup is not dependent on platform, So considering if you have DM36x DVSDK 4.x installed. Do this

     Run DVSDK 4.x setup script and configure TFTP + NFS

     *   When it  prompt for NFS server path then give your DM355 rootfs path

    *   When it prompts for uImage name for TFTP, select your DM355 uImage

    And on completion, everything should be configured.

    HTH.

    Thanks

    Brijesh

     

  • Marc DAmato said:

    John,

    I went through these steps several times to no avail.  I went as far as removing tftp-hpa and reinstalling it.  Still stuck.

    Just to eliminate the obvious, can you ping the TFTP server from another PC?  If so then try to TFTP a file from that computer.

    John A