[PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file

Tony Dinh mibodhi at gmail.com
Sat Oct 23 01:29:37 CEST 2021


Hi all,

My 2 cents.

As a maintainer for some hobbyist downstream u-boots (tracking
mainline) and some out-of-tree u-boots, I do lots of envs scripting.
The most common scenario for me is to create an env by combining 2 or
more strings. Examples, init_usb, init_sata, init_sata_usb and so on,
i.e concatenating "init" with the device name(s). The device names
might be some other envs, and so on.

Note that I used _ (underscore) and could end up with an env name that
has trailing underscore. So I can see the trailing + in env names
might occur often in some existing scripts. It's just my preference to
use underscore, but someone else might use a + sign!

OTOH, It never occurred to me that I can use a backward slash \ in env
names. Since we use this escape character in
./include/configs/someboard.h CONFIG_EXTRA_ENV_SETTINGS as a
linebreak, I think perhaps nobody would have attempted to make use of
that in the env name.

So I agree with Tom, we could disallow \ in env name, and use it as a
separator during parsing. Such as in the following 2 assignments, the
1st is appending the string bar to foo, the 2nd is assigning the
string bar to foo+.

foo\+=bar
foo+\=bar

Thanks,
Tony


More information about the U-Boot mailing list