Http://www.denx.de/wiki/view/DULG/UBootCmdGroupEnvironment#Section_5.9.6.3.
Remember standard shell quoting rules when the value of a variable shall contain characters that have a special meaning to the command line Parser (like$
Character that is used for variable substitution or the semicolon which separates commands). Use the backslash (\
) Character to escape such special characters, or enclose the whole phrase in apstrophes ('
). Use"$ {Name }"
For variable expansion (see 14.2.17. How the command line parsing works for details ).
=> Setenv cons_opts 'console = tty0 console = ttys0, $ {baudrate} '=> printenv cons_optscons_opts = console = tty0 console = ttys0, $ {baudrate} =>
Special characters $ and; escape with \ or'
Include.
Use$ {Name} references the variable
Http://www.denx.de/wiki/view/DULG/CommandLineParsing
Uboot command line Parsing
14.2.17. How the command line parsing works
There are two different command line parsers available with U-boot: the old "simple" one, and the much more powerful "Hush" shell:
There are two types: simple and hush.
14.2.17.1. Old, simple command line parser
-
- Supports environment variables (through
Setenv
/Saveenv
Commands)
-
- Several commands on one line, separated
';'
- Variable Substitution using
"... $ {_ Variablename _}..."
SyntaxNote:Older versions of U-boot used"$ (...)"
For variable substitution. Support for this syntax is still present in current versions, but will be removed soon. Please use"$ {...}"
Instead, which has the additional benefit that your environment definitions are compatible with the hush shell, too.
-
- Special characters (
'$'
,';'
) Can be escaped by prefixing'\'
, For example:Setenv bootcmd bootm \ $ {address}
-
- You can also escape text by enclosing in single apostrophes, for example:
Setenv addip 'setenv bootargs $ {bootargs} IP =$ {ipaddr }:$ {serverip }:: {gatewayip }:: {netmask }:$ {hostname }: $ {netdev}: off'
$ {_ Variablename _} is used as a variable reference. The old syntax is$ (...), To be eliminated.
Special characters ('$'
,';'
)'\'
Escape, such as setenv bootcmd bootm \ $ {address}, or use single quotes, such
Setenv addip 'setenv bootargs $ {bootargs} IP =$ {ipaddr }:$ {serverip }:: {gatewayip }:: {netmask }:$ {hostname }: $ {netdev}: off'