scripts

Marc Kleine-Budde mkl at pengutronix.de
Wed Mar 2 04:30:29 EST 2011


On 03/02/2011 09:36 AM, Vanalme Filip wrote:
>> -----Original Message----- From: Marc Kleine-Budde
>> [mailto:mkl at pengutronix.de] Sent: dinsdag 1 maart 2011 15:12 To:
>> Vanalme Filip Cc: barebox at lists.infradead.org Subject: Re: scripts
>> 
>> On 03/01/2011 03:06 PM, Vanalme Filip wrote: [...]
>> 
>>> One more question about barebox scripts (I guess even scripts in 
>>> general...). This is part of a script from another board (that I
>>> took over for my own board):
>> 
>>> #!/bin/sh
>>> 
>>> . /env/config
>>> 
>>> If [ x$1 = xflash ]; then root=flash kernel=flash fi
>>> 
>>> if [ x$1 = xnet ]; then root=net kernel=net fi
>>> 
>>> why the scripts are using i.e. [ x$1 = xflash ] instead of just
>>> simply [ $1 = flash ] ?
>> Both are doing the same, no ?
>> 
>> The shell is quite old and doesn't support that. But you're right
>> for modern shells like bash or dash.
> 
> [Filip] When I do : barebox:/ echo "this is \"quoted text\""
> 
> I get : barebox:/ this is \"quoted text\"
> 
> I would have expected this : barebox:/ this is "quoted text"

Yeah, that's a known problem.......feel free to fix.
> 
> It looks like the escape character is not working as expected. When I
> have this in my boot script : bootargs="$bootargs
> mtdparts=\"physmap-flash.0:$nor_parts;mxc_nand:$nand_parts\""

You can remove the \". They were needed some time ago, when "mcx_nand"
needed to be the name of the Flash Chip, which contained spaces.

> Will this work correctly ? Will the mtdparts be passed correctly to 
> the kernel ? (I guess the escape character will remain, so I think
> it might be an problem, no?)

I once, or rather the kernel I used, had problems with the \"...

cheers, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20110302/1f7439c1/attachment.sig>


More information about the barebox mailing list