Am 30.11.2015 um 12:32 schrieb Siarhei Siamashka:
Thanks, this looks good. Just the description of this new command is missing in the help message text (when the sunxi-fel tool is run without any arguments).
-- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
>From 73d7989148f32f5183cbce2c49081f89203a3254 Mon Sep 17 00:00:00 2001 From: Bernhard Nortmann <bernhard.nortm...@web.de> Date: Fri, 27 Nov 2015 15:13:48 +0100 Subject: [PATCH v6 9/9] 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.nortm...@web.de> Reviewed-by: Siarhei Siamashka <siarhei.siamas...@gmail.com> --- fel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fel.c b/fel.c index cdb34c7..df96f4d 100644 --- a/fel.c +++ b/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); -- 2.4.6