• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » TFTP on Ubuntu 10.04
Share
Linux
  • Forum
Options
  • Subscribe via RSS

TFTP on Ubuntu 10.04

TFTP on Ubuntu 10.04

This question is answered
Inderjit Bains
Posted by Inderjit Bains
on Aug 24 2010 15:31 PM
Expert2425 points

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?

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Niclas
    Posted by Niclas
    on Aug 24 2010 15:47 PM
    Suggested Answer
    Expert3220 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Inderjit Bains
    Posted by Inderjit Bains
    on Aug 24 2010 17:07 PM
    Expert2425 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • cerilet.com
    Posted by cerilet.com
    on Aug 25 2010 03:21 AM
    Intellectual370 points

    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.

    tftpd-hpa tftp ubuntu configure
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Inderjit Bains
    Posted by Inderjit Bains
    on Aug 25 2010 07:07 AM
    Expert2425 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • cerilet.com
    Posted by cerilet.com
    on Aug 25 2010 08:06 AM
    Intellectual370 points

    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/

    iptables tftp configuration
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Inderjit Bains
    Posted by Inderjit Bains
    on Aug 26 2010 04:21 AM
    Expert2425 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Inderjit Bains
    Posted by Inderjit Bains
    on Aug 30 2010 22:58 PM
    Verified Answer
    Verified by Inderjit Bains
    Expert2425 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Marc DAmato
    Posted by Marc DAmato
    on Jan 27 2011 12:28 PM
    Expert7700 points

    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

    DM355 TFTP PSP 3.1 Could Not Establish Link
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hayes
    Posted by Jeff Hayes
    on Jan 27 2011 22:04 PM
    Expert6780 points

    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. 

    Regards,

    Jeff

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Marc DAmato
    Posted by Marc DAmato
    on Jan 28 2011 06:42 AM
    Expert7700 points

    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 >

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Marc DAmato
    Posted by Marc DAmato
    on Jan 28 2011 09:59 AM
    Expert7700 points

    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$

    DM355 TFTP PSP 3.1 Could Not Establish Link
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Anderson
    Posted by John Anderson
    on Jan 28 2011 11:07 AM
    Genius5165 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Marc DAmato
    Posted by Marc DAmato
    on Jan 28 2011 12:26 PM
    Expert7700 points

    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.

     

    DM355 TFTP PSP 3.1 EVM and Localhost Timing Out
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Anderson
    Posted by John Anderson
    on Jan 28 2011 12:33 PM
    Genius5165 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Marc DAmato
    Posted by Marc DAmato
    on Jan 28 2011 14:03 PM
    Expert7700 points

    John,

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

    DM355 TFTP
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use