[BusyBox] change in tftp

Robert Parusel rp at infratec-plus.de
Mon Feb 18 06:58:03 UTC 2002


Hi folks,
I made the following change to config.h and tftp.c

config.h
    375 // !!!!!!! new
    376 // Allow tftpget to write to stdout
    377 #define BB_FEATURE_TFTP_GET2STDOUT

tftp.c
    363 #ifdef BB_FEATURE_TFTP_GET2STDOUT
    364     if ( localfile == NULL && cmd == tftp_cmd_get ) {
    365         fd = 1;
    366     } else {
    367 #endif
    368         fd = open(localfile, flags, 0644);
    369         if (fd < 0) {
    370             perror_msg_and_die("local file");
    371         }
    372 #ifdef BB_FEATURE_TFTP_GET2STDOUT
    373     }
    374 #endif

With this busybox "tftp get" is able to write the file/s to stdout if you 
leave out  "-l filename". It is very usefull if someone want to use tarballs 
to update an embedded system on the fly for example.
usage:
	change to the directory were you want to install the files
than with compressed tarballs
	tftp -g HOSTNAME -r REMOTEFILE | gzip -d | tar x
or 
	tftp -g HOSTNAME -r REMOTEFILE | tar x
if it is not compressed.

Regards
        R.Parusel

-------------------------------------------------------------

Linus Torvalds: "We're back to the times where men were men,
                 and wrote their own device drivers."

=============================================================
Infratec-Plus
Gesellschaft für innovative Datentechnik mbH
Werner-von-Siemens-Strasse 7
64625 Bensheim

R.Parusel / Tel: 06251/8405-460 /   mailto:rp at infratec-plus.de
=============================================================




More information about the busybox mailing list