Retrieving files from tftpd

balanga

Son of Beastie

Reaction score: 201
Messages: 3,830

I'm trying to follow a Clonezilla script for retrieving files from a tftp server, but this does not seem to work on FreeBSD...

The example is tftp -g -r custom-ocs-2 -l /tmp/custom-ocs-2 192.168.120.254 but on FreeBSD I just get:-
Code:
usage: tftp [host [port]]
tftp>

Is this to be expected?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,991
Messages: 36,924

If you look at tftp(1) you'll notice FreeBSD's tftp(1) client doesn't support all those options.
 
OP
B

balanga

Son of Beastie

Reaction score: 201
Messages: 3,830

Yes I did notice the man page, but thought there might be some undocumented options... I kind of thought that such universal programs as tftpd, which have been around for ever, would have similar options..

I have actually found that something like this works:-

echo 'get ldlinux.c32' | tftp 192.168.1.1
 

honk

Active Member

Reaction score: 23
Messages: 152

I kind of thought that such universal programs as tftpd, which have been around for ever, would have similar options

Is there an authority responsible to ensure that command line tools behave exactly the same across different operating systems?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,991
Messages: 36,924

I kind of thought that such universal programs as tftpd, which have been around for ever, would have similar options..
Different implementations of the programs will have different options. Just because the protocol is the same and the tools are named the same that doesn't mean they all have the same options or usage.
 

honk

Active Member

Reaction score: 23
Messages: 152

Yes, POSIX. It's optional to comply.

Optional to comply and mandatory to pay to read the specs?! Do you know whether the user interface of a tftp-client (e.g. command line options) is defined in POSIX?
 

mark_j

Aspiring Daemon

Reaction score: 519
Messages: 965

That's a different question.
I was splitting hairs.
POSIX defines the applications API if you will, but not how you implement it for your own OS. So while tftp might use the POSIX library calls across different POSIX systems, it is totally up to the designers/implementers whether they follow the RFC and restrict or extend its capability.
See: RFC1350 and its extension RFC2347

So, ultimately, no, there is no standard. Some, for example, extended the functionality of grep into egrep. Still, I would guess the GNU version of grep is not exactly the same as the OpenBSD (now FreeBSD) version of grep?

Generally people get around this with tests in shell scripts to detect the OS and implement accordingly. It makes portability a pain, but that's life, I guess.
 
Top