[PATCH 1/1] doc: man-page for tftpput

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Sep 3 19:07:59 CEST 2022



On 9/3/22 18:55, Simon Glass wrote:
> Hi Heinrich,
> 
> On Sat, 3 Sept 2022 at 06:24, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
>>
>> Provide a man-page for the tftpput command.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>> ---
>>   doc/usage/cmd/tftpput.rst | 69 +++++++++++++++++++++++++++++++++++++++
>>   doc/usage/index.rst       |  1 +
>>   2 files changed, 70 insertions(+)
>>   create mode 100644 doc/usage/cmd/tftpput.rst
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
>>
>> diff --git a/doc/usage/cmd/tftpput.rst b/doc/usage/cmd/tftpput.rst
>> new file mode 100644
>> index 0000000000..70fe0d500f
>> --- /dev/null
>> +++ b/doc/usage/cmd/tftpput.rst
>> @@ -0,0 +1,69 @@
>> +.. SPDX-License-Identifier: GPL-2.0+:
>> +
>> +tftpput command
>> +===============
>> +
>> +Synopsis
>> +--------
>> +
>> +::
>> +
>> +    tftpput address size [[hostIPaddr:]filename]
>> +
>> +Decription
>> +----------
>> +
>> +The tftpput command is used to transfer a file to a tFTP server.
> 
> This is normally written as TFTP, isn't it?

I can change that.

> 
>> +
>> +address
>> +    memory address where the data starts
>> +
>> +size
>> +    number of bytes to be transferred
>> +
>> +hostIPaddr
>> +    IP address of the tFTP server, defaults to $serverip
>> +
>> +filename
>> +    path of the file to be written. If not provided, the clients IP address is
> 
> client's
> 
>> +    used to construct a default file name, e.g. C0.A8.00.28.img for IP address
>> +    192.168.0.40.
> 
> Oh I don't think I knew that. Where is that implemented?

net/tftp.c:755:
sprintf(default_filename, "%02X%02X%02X%02X.img",

Thanks for reviewing

Best regards

Heinrich

> 
>> +
>> +Example
>> +-------
>> +
>> +In the example the following steps are executed:
>> +
>> +* setup client network address
>> +* load a file from the SD-card
>> +* send the file via tFTP to a server
>> +
>> +::
>> +
>> +    => setenv autoload no
>> +    => dhcp
>> +    BOOTP broadcast 1
>> +    DHCP client bound to address 192.168.1.40 (7 ms)
>> +    => load mmc 0:1 $loadaddr test.txt
>> +    260096 bytes read in 13 ms (19.1 MiB/s)
>> +    => tftpput $loadaddr $filesize 192.168.1.3:upload/test.txt
>> +    Using ethernet at 1c30000 device
>> +    TFTP to server 192.168.1.3; our IP address is 192.168.1.40
>> +    Filename 'upload/test.txt'.
>> +    Save address: 0x42000000
>> +    Save size:    0x3f800
>> +    Saving: #################
>> +         4.4 MiB/s
>> +    done
>> +    Bytes transferred = 260096 (3f800 hex)
>> +    =>
>> +
>> +Configuration
>> +-------------
>> +
>> +The command is only available if CONFIG_CMD_TFTPPUT=y.
>> +
>> +Return value
>> +------------
>> +
>> +The return value $? is 0 (true) on success and 1 (false) otherwise.
>> diff --git a/doc/usage/index.rst b/doc/usage/index.rst
>> index 28f9683a3e..f1beeec59c 100644
>> --- a/doc/usage/index.rst
>> +++ b/doc/usage/index.rst
>> @@ -63,6 +63,7 @@ Shell commands
>>      cmd/scp03
>>      cmd/setexpr
>>      cmd/size
>> +   cmd/tftpput
>>      cmd/true
>>      cmd/ums
>>      cmd/wdt
>> --
>> 2.37.2
>>
> 
> Regards,
> Simon


More information about the U-Boot mailing list