[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#813023: flash-kernel: quoting error with bootargs in generic U-Boot boot script



Control: tag -1 +moreinfo

On Thu, 2016-01-28 at 16:36 +0000, Ian Campbell wrote:
> 
> > having no quotes should not be a problem for the u-boot setenv command:
> > 
> > => setenv foo a b c d e
> > => printenv foo
> > foo=a b c d e
> > => setenv foo ${foo} bar baz
> > => printenv foo
> > foo=a b c d e bar baz
> > =>
> 
> IIRC some version (probably hacky old vendor branches) of u-boot behave in
> weird and wonderful ways wrt quoting.
> 
> That said, including the quoting seems likely to work more broadly than not
> doing so.

Having played with this I was wrong. e.g. on qnap (a pretty old u-
boot):

Marvell>> version

U-Boot 1.1.4 (May  5 2009 - 18:59:48) Marvell version: 3.4.4
Marvell>> setenv foo bar baz
Marvell>> printenv foo
foo=bar baz
Marvell>> echo ${foo}
bar baz
Marvell>> setenv foo "bar baz"
Marvell>> printenv foo
foo="bar baz"
Marvell>> echo ${foo}
"bar baz"

IOW the quotes become a literal part of the variable.

On a more modern system (cubietruck, although not the very latest
firmware) I see:

sun7i# version

U-Boot 2014.10+dfsg1-5 (Apr 07 2015 - 22:09:16) Allwinner Technology
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
sun7i# setenv foo bar baz
sun7i# printenv foo
foo=bar baz
sun7i# echo ${foo}
bar baz
sun7i# setenv foo "bar baz"
sun7i# printenv foo
foo=bar baz
sun7i# echo ${foo}
bar baz

Which behaves more sanely with the quoting but also works as expected
without.

Lunar -- which platform did you see an issue on and what do the above
test commands give in that case?

I'm going to push a change relating to the other suggestion here (the
ability to set a defaults before ${bootargs}, but so far don't plan to
make any change wrt the quoting behaviour.

Ian.


Reply to: