mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* kwboot Preamble only feature
@ 2013-11-19 16:48 Matthew Minter
  2013-11-21 14:01 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Minter @ 2013-11-19 16:48 UTC (permalink / raw)
  To: barebox

Hi everyone,

I was not sure this is the correct list to send this to, however when
using the included kwboot utility to bootstrap a Marvell Armada XP
board I quickly noticed it was missing a useful feature, the ability
to send the boot preamble without sending a boot image afterwards.
This was useful to me as my configuration required an xmodem program
with special features, not available in the useful but very light
included one.

As such I have written a patch which adds the -j option. This allows
behaviour similar to the -b option except kwboot exits just before the
actual xmodem transfer, allowing another xmodem program to take over
and send the boot file.

I think this may be of use to others bootstrapping Armada XP based
systems so attach this patch to the end of my post.

Many thanks,
Matthew

--- barebox/scripts/kwboot.c.old    2013-11-19 16:37:04.717255752 +0000
+++ barebox/scripts/kwboot.c    2013-11-19 16:38:36.573351680 +0000
@@ -587,13 +587,15 @@
 kwboot_usage(FILE *stream, char *progname)
 {
     fprintf(stream,
-        "Usage: %s [-d | -b <image> | -D <image> ] [ -t ] [-B <baud>
] <TTY>\n",
+        "Usage: %s [-d | -b <image> | -D <image> | -j ] [ -t ] [-B
<baud> ] <TTY>\n",
         progname);
     fprintf(stream, "\n");
     fprintf(stream,
         "  -b <image>: boot <image> with preamble (Kirkwood, Armada
370/XP)\n");
     fprintf(stream,
         "  -D <image>: boot <image> without preamble (Dove)\n");
+        fprintf(stream,
+                "  -j: just send the boot preamble but do not send
any image\n");
     fprintf(stream, "  -d: enter debug mode\n");
     fprintf(stream, "\n");
     fprintf(stream, "  -t: mini terminal\n");
@@ -626,7 +628,7 @@
     kwboot_verbose = isatty(STDOUT_FILENO);

     do {
-        int c = getopt(argc, argv, "hb:dtB:D:");
+        int c = getopt(argc, argv, "jhb:dtB:D:");
         if (c < 0)
             break;

@@ -636,6 +638,10 @@
             imgpath = optarg;
             break;

+        case 'j':
+            bootmsg = kwboot_msg_boot;
+            break;
+
         case 'D':
             bootmsg = NULL;
             imgpath = optarg;

-- 


------------------------------
For additional information including the registered office and the treatment of Xyratex confidential information please visit www.xyratex.com

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kwboot Preamble only feature
  2013-11-19 16:48 kwboot Preamble only feature Matthew Minter
@ 2013-11-21 14:01 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2013-11-21 14:01 UTC (permalink / raw)
  To: Matthew Minter; +Cc: barebox

Dear Matthew Minter,

Cc'ing Sebastian Hesselbarth, who has also worked on kwboot.

On Tue, 19 Nov 2013 16:48:25 +0000, Matthew Minter wrote:

> I was not sure this is the correct list to send this to, however when
> using the included kwboot utility to bootstrap a Marvell Armada XP
> board I quickly noticed it was missing a useful feature, the ability
> to send the boot preamble without sending a boot image afterwards.
> This was useful to me as my configuration required an xmodem program
> with special features, not available in the useful but very light
> included one.
> 
> As such I have written a patch which adds the -j option. This allows
> behaviour similar to the -b option except kwboot exits just before the
> actual xmodem transfer, allowing another xmodem program to take over
> and send the boot file.
> 
> I think this may be of use to others bootstrapping Armada XP based
> systems so attach this patch to the end of my post.

The feature looks ok to me. Can you submit a proper patch (i.e a git
patch, with description and Signed-off-by line) ?

Just curious, which features does your xmodem program provides that
this light tool doesn't? It might be interesting to know that, just to
see what use cases kwboot isn't covering.

Thanks!

Thomas

> --- barebox/scripts/kwboot.c.old    2013-11-19 16:37:04.717255752
> +0000 +++ barebox/scripts/kwboot.c    2013-11-19 16:38:36.573351680
> +0000 @@ -587,13 +587,15 @@
>  kwboot_usage(FILE *stream, char *progname)
>  {
>      fprintf(stream,
> -        "Usage: %s [-d | -b <image> | -D <image> ] [ -t ] [-B <baud>
> ] <TTY>\n",
> +        "Usage: %s [-d | -b <image> | -D <image> | -j ] [ -t ] [-B
> <baud> ] <TTY>\n",
>          progname);
>      fprintf(stream, "\n");
>      fprintf(stream,
>          "  -b <image>: boot <image> with preamble (Kirkwood, Armada
> 370/XP)\n");
>      fprintf(stream,
>          "  -D <image>: boot <image> without preamble (Dove)\n");
> +        fprintf(stream,
> +                "  -j: just send the boot preamble but do not send
> any image\n");
>      fprintf(stream, "  -d: enter debug mode\n");
>      fprintf(stream, "\n");
>      fprintf(stream, "  -t: mini terminal\n");
> @@ -626,7 +628,7 @@
>      kwboot_verbose = isatty(STDOUT_FILENO);
> 
>      do {
> -        int c = getopt(argc, argv, "hb:dtB:D:");
> +        int c = getopt(argc, argv, "jhb:dtB:D:");
>          if (c < 0)
>              break;
> 
> @@ -636,6 +638,10 @@
>              imgpath = optarg;
>              break;
> 
> +        case 'j':
> +            bootmsg = kwboot_msg_boot;
> +            break;
> +
>          case 'D':
>              bootmsg = NULL;
>              imgpath = optarg;
> 



-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-21 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 16:48 kwboot Preamble only feature Matthew Minter
2013-11-21 14:01 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox