On 07/02/2014 12:42 PM, Andreas Färber wrote:
> Hi,
> 
> Am 02.07.2014 19:32, schrieb Stephen Warren:
>> From: Stephen Warren <[email protected]>
>>
>> This allows run user to pass the following to the flashing script:
> 
> Is "run user" a typo?

s/run/the/ !

>>     --env bootcmd 'usb start ; dhcp zImage'
>>
>> rather than having to manually escape the commands for U-Boot:
>>
>>     --env bootcmd 'usb start \; dhcp zImage'

>> diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher

>>          if args.env:
>>              for (var, value) in args.env:
>> -                bootcmd += 'setenv %s %s ; ' % (var, value)
>> +                bootcmd += 'setenv %s \'%s\' ; ' % (var, value)
> 
> Can't you just s/'/\\\'/g on value somehow, i.e. replace literal
> single-quote with an escaped backslash, escaped single-quote sequence?

I tried that manually at the command-line, and U-Boot's shell doesn't
seem to handle escaping quotes correctly. Escaped semicolons (which was
what I actually wanted to avoid writing manually) do work OK, but it's
simpler to just quote the whole thing rather than writing ever more
complicated parsers to quote certain characters or not based on whether
they're inside strings or not, etc. It'd be nice if U-Boot's setenv
could work like:

setenv -hex varname hex_encoded_value

... to completely avoid any quoting issues!
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to