Hi Igor,

On 10/31/26 22:53, Igor Velkov via B4 Relay wrote:
> wget can write a disk image only after the whole file is in RAM. This
> series lets lwIP wget write the download to a block device while it
> arrives:
> 
>   => wget -o mmc 1 -b 400000 http://192.168.1.65/armbian.img
> 

Please write this as an user interface that is extensible to other
streaming data transfers like UART YMODEM or 'load' from one dev or
partition to write to another; or to/from a file on a filesystem.

There are existing commands for 'wget' and 'save', so we should re-use
the familiar user interface commandline options of existing commands and
add a stateful 'cc' wrapper command with some helpers to set the env
variables:

cc in wget [$loadaddress] http://192.168.1.65/armbian.img
env set cc_in wget
env set cc_buf_addr $loadaddress
env set cc_in_wget_url http://192.168.1.65/armbian.img

cc buf - 400000
env set cc_buf_size 400000

cc buf $loadaddress
env set cc_buf_addr $loadaddress

cc out save mmc 1
env set cc_out save
env set cc_out_save_interface mmc
env set cc_out_save_dev 1

cc dd
# begin the streaming copy

There could also be offset, block size, and count, for input and output.

> The target is a whole device, a hardware partition, a partition by
> number or name, and an optional byte offset into it.
> 
> [...]

This surely belongs as its own command with a build-time CONFIG option
and not adding forced complexity to 'wget' command.

-E

Reply via email to