fel: support updating the caption for "dialog --gauge"
This patch adds an "echo-gauge" command that is intended for use with
sunxi-fel's output piped into the dialog utility. "echo-gauge" will
output its string argument in a way that updates (i.e. overwrites)
the prompt text that dialog displays, so it's possible to change that
inbetween file transfers from sunxi-fel.
Example:
sunxi-fel uboot ${UBOOT} \
echo-gauge "Uploading kernel (1/2)" \
write-with-gauge 0x42000000 ${KERNEL} \
write 0x43100000 ${SCRIPT} \
echo-gauge "Uploading rootfs (2/2)" \
write-with-gauge 0x44000000 ${ROOTFS} \
| dialog --gauge "" 6 70
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Reviewed-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
This commit is contained in:
parent
6712eb84a0
commit
7755022252
5
fel.c
5
fel.c
@ -1306,6 +1306,7 @@ int main(int argc, char **argv)
|
||||
" multi[write]-with-gauge ... like their \"write-with-*\" counterpart,\n"
|
||||
" multi[write]-with-xgauge ... but following the 'multi' syntax:\n"
|
||||
" <#> addr file [addr file [...]]\n"
|
||||
" echo-gauge \"some text\" Update prompt/caption for gauge output\n"
|
||||
" ver[sion] Show BROM version\n"
|
||||
" clear address length Clear memory\n"
|
||||
" fill address length value Fill memory\n"
|
||||
@ -1393,6 +1394,10 @@ int main(int argc, char **argv)
|
||||
size_t count = strtoul(argv[2], NULL, 0); /* file count */
|
||||
skip = 2 + 2 * file_upload(handle, count, argc - 3,
|
||||
argv + 3, progress_gauge_xxx);
|
||||
} else if ((strcmp(argv[1], "echo-gauge") == 0) && argc > 2) {
|
||||
skip = 2;
|
||||
printf("XXX\n0\n%s\nXXX\n", argv[2]);
|
||||
fflush(stdout);
|
||||
} else if (strcmp(argv[1], "read") == 0 && argc > 4) {
|
||||
size_t size = strtoul(argv[3], NULL, 0);
|
||||
void *buf = malloc(size);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user