1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTP client

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by prpr, Nov 9, 2012.

  1. prpr

    prpr Well-Known Member

    How easy would it be to compile a bog-standard FTP client for the T2?
    I looked at importing the Debian pre-compiled one, but it ends up needing 10 million dependent packages to make it work.
    I looked at the source for it as well, but it ends up apparently needing 10 million dependent packages to make it work (although most of them seem similar to what I already have installed).
    Arrgghhh...... Linux drives you insane.

    What would be the best way to go about it?
     
  2. Black Hole

    Black Hole Felonius Gru

    How would you control it, if you did manage to install an FTP client?
     
  3. af123

    af123 Administrator Staff Member

    I'll see if I can compile and package one.

    The curl command supports FTP (upload and download) if that's of use.
     
  4. prpr

    prpr Well-Known Member

    Telnet to the box and use command line FTP in the usual way.

    I'm thinking of box to box transfers for example.
     
  5. Black Hole

    Black Hole Felonius Gru

    What about FXP (thanks to Makem)?
     
  6. prpr

    prpr Well-Known Member

    Thanks. I'd be quite interested in knowing how you go about it, if you have time to write some words of guidance.

    I knew wget and curl did download, but never investigated either for upload.
    Sometimes it's just easier to drive things manually using basic standard familiar tools.
     
  7. prpr

    prpr Well-Known Member

    No idea what either of those terms mean without doing some research...
     
  8. Black Hole

    Black Hole Felonius Gru

    Makem is the member who first made me aware of it - see HERE (click). File Exchange Protocol uses FTP to pass data between two other machines, so you would only need a FXP client on the command machine and FTP servers on the data machines.

    http://hummy.tv/forum/threads/virtual-disk.1105/ - should be useful.
     
  9. af123

    af123 Administrator Staff Member

    Try the tnftp package that I just uploaded.
     
  10. af123

    af123 Administrator Staff Member

    Most FTP servers disable this though. It's a security risk for many reasons.
     
  11. Black Hole

    Black Hole Felonius Gru

    Makem had success with it. See updated link in post 8.
     
  12. af123

    af123 Administrator Staff Member

    Maybe it pulls the data down to the client machine from one server, then uploads it to the other. The original FTP protocol also supported direct server-to-server transfers controlled by a standard FTP client on a third system. No longer widely used.
     
  13. af123

    af123 Administrator Staff Member

    I just compiled tnftp in my cross-compilation environment.

    Code:
    CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \
    ./configure \
        --prefix=/mod \
        --host=mipsel-linux \
        --target=mipsel-linux \
        --disable-nls \
        --disable-editcomplete
    
    Tried a couple of other small clients too but they had too many dependencies or required GNU libc.
     
  14. prpr

    prpr Well-Known Member

    Oh right, I'll have a read of that thread.

    FXP seems hideously insecure and is usually disabled as far as I can tell - don't know how this applies to BetaFTPD for example.
    I don't have a client and anyway it's not really what I want to do.
     
  15. af123

    af123 Administrator Staff Member

    In case you missed it in the fast moving thread, tnftp now in the repository:

    Code:
    humax# opkg update && opkg install tnftp
    Downloading http://hummypkg.org.uk/hdrfoxt2/base/Packages.gz.
    Inflating http://hummypkg.org.uk/hdrfoxt2/base/Packages.gz.
    Updated list of available packages in /mod/var/opkg/base.
    Installing tnftp (20091122) to root...
    Downloading http://hummypkg.org.uk/hdrfoxt2/base/tnftp_20091122_mipsel.opk.
    Configuring tnftp.
    humax#  
    humax# ftp hummypkg.org.uk
    Trying 2a00:5600:1600::1:1:21 ...
    ftp: Can't create socket for connection to `2a00:5600:1600::1:1:21': Address family not supported by protocol
    Trying 89.248.55.76:21 ...
    Connected to 2a00:5600:1600::1:1.
    220 Citrus IT FTP Server ready.
    Name (hummypkg.org.uk:root): ftp
    331 Anonymous login ok, send your complete email address as your password
    Password: 
    230 Access permitted.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> quit
    221 Goodbye.
    
     
  16. prpr

    prpr Well-Known Member

    Absolutely brilliant af123. You're a legend. Less than an hour. What more could anybody ask?
    Thankyou.
     
  17. prpr

    prpr Well-Known Member

    I've been trying to use the ftp client on a diskless HD box (downloaded onto the machine from another using wget).
    It crashes with a Segfault error on attempting to open a connection to anywhere.
    I downloaded strace the same way and ran it under that to see if I could work out the cause.
    The last thing it does is try to read /etc/hosts so I took a look at that and found it symlinked to /tmp/hosts, which doesn't exist. Ah!
    A quick "touch /tmp/hosts" sorted it out, but it would be better if this sort of stuff didn't happen, although not sure exactly where/how to apply any sort of fix.
     
    Last edited: Aug 19, 2016
  18. af123

    af123 Administrator Staff Member

    /tmp/hosts is created during boot by the /sbin/modinit script. Any ideas why it may have failed in your setup?
     
  19. prpr

    prpr Well-Known Member

    Isn't modinit run by run-and-gun which is run by mdev which is run by the kernel when it detects a disk being connected?
    I did say it was diskless, so none of this will happen and therefore the file doesn't get created?
    Or does/should "modinit -minimal" get run some other way?
    There is no /tmp/modinit.log file either.
     
    Wallace and af123 like this.
  20. af123

    af123 Administrator Staff Member

    Yes, sorry missed the diskless bit.
    modinit -minimal is still triggered by disk detection; it runs when the disk being connected is not EXT2/3.

    Something to consider fixing in the next firmware. I could update the FTP client package so that it doesn't crash but not sure if it's worth it.