summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-07-02 11:27:25 -0600
committerStephen Warren <swarren@nvidia.com>2014-07-02 17:18:01 -0600
commitf4dfee3680c8a92b0f9fcd4d0d4d4cac40239f06 (patch)
tree138374f374c4d12290a3f3eba1d8323bbdba652e
parente49579e1dc866a5bd54b3e5c31527bc847675a32 (diff)
downloadtegra-uboot-flasher-scripts-f4dfee3680c8a92b0f9fcd4d0d4d4cac40239f06.tar.gz
Wrap any env var settings in quotes
This allows the user to pass the following to the flashing script: --env bootcmd 'usb start ; dhcp zImage' rather than having to manually escape the commands for U-Boot: --env bootcmd 'usb start \; dhcp zImage' (The quoting in both cases is for the shell invoking tegra-uboot-flasher, not for U-Boot's command-line. The removed escaping was to work around the lack of quoting/escaping when passing the user's command to U-Boot's setenv command during flashing.) This change will interact badly with the user wanting to use single quotes in environment variable values, but hopefully that's less likely, and can be fixed later if needed. Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rwxr-xr-xtegra-uboot-flasher2
1 files changed, 1 insertions, 1 deletions
diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher
index c9adba6..ed2f2d9 100755
--- a/tegra-uboot-flasher
+++ b/tegra-uboot-flasher
@@ -213,7 +213,7 @@ def func_flash():
bootcmd += 'setenv board ' + boardname + config['dtbfn-extra'] + ' ; '
if args.env:
for (var, value) in args.env:
- bootcmd += 'setenv %s %s ; ' % (var, value)
+ bootcmd += 'setenv %s \'%s\' ; ' % (var, value)
bootcmd += 'saveenv ; '
bootcmd += 'echo >>> Flashing OK, rebooting... ; '
# To update the bootloader, reset.