kwboot - positional tty argument

Stefan Roese sr at
Mon Mar 7 15:39:33 CET 2022

On 3/7/22 12:40, Pali Rohár wrote:
> Hello!
> On Sunday 06 March 2022 14:38:57 Tony Dinh wrote:
>> Hi Pali,
>> I have an observation, which is not related to this patch. But about
>> the kwboot options changes in general, I hope it is OK to mention it
>> here.
>> Before the changes you've made to solve the problem with the -b
>> option, I can do this:
>> kwboot -t  -B 115200 /dev/ttyUSB0 -b uboot.kwb
> Interesting... I did not know that this kind of setup worked. It was not
> documented neither in usage nor in manpage. Normally in applications and
> scripts, all option arguments are before non-option (positional)
> argument.
>> But now, the -b option can not be used after the tty device name. All
>> options must appear before the tty device.
>> Is this the actual intention? it did break some of my existing
>> aliases/scripts (It is not a big deal to retrofit them). Just want to
>> make sure I understand the reason to make the tty device a positional
>> argument for kwboot.
>> Thanks,
>> Tony
> Marek, Stefan, do you want to support above (old) handling of positional
> tty device argument to be present in the middle of option arguments?

I personally don't...

> I think I can develop some "hack" patch for argv[] processing to support
> this operation. But my question is, if this is something which we want
> to officially support. Because if not, it is better to have separate
> option arguments and positional arguments like in any other application.


The only case I can think of, is scripts that use the "incorrect" format
and might fail now. I don't have any such scripts and I would not object
to breaking this backward compatibility. Tony, what's your thinking on
this? Marek?


More information about the U-Boot mailing list