public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	u-boot-board-maintainers@lists.denx.de,
	"Rasmus Villemoes" <rasmus.villemoes@prevas.dk>,
	u-boot-custodians@lists.denx.de, "Tom Rini" <trini@konsulko.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Joe Hershberger" <joe.hershberger@ni.com>
Subject: Re: [PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file
Date: Fri, 22 Oct 2021 10:29:26 +0200	[thread overview]
Message-ID: <3765086.1634891366@gemini.denx.de> (raw)
In-Reply-To: <20211021210847.v10.3.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid>

Dear Simon,

In message <20211021210847.v10.3.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> you wrote:
> At present U-Boot environment variables, and thus scripts, are defined
> by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
> to this file and dealing with quoting and newlines is harder than it
> should be. It would be better if we could just type the script into a
> text file and have it included by U-Boot.
>
> Add a feature that brings in a .env file associated with the board
> config, if present. To use it, create a file in a board/<vendor>
> directory, typically called <board>.env and controlled by the
> CONFIG_ENV_SOURCE_FILE option.
>
> The environment variables should be of the form "var=value". Values can
> extend to multiple lines. See the README under 'Environment Variables:'
> for more information and an example.

The README does not contain this information as it has been moved
into doc/usage/environment.rst

I think the documentation is lacking a hint that multiline
definitions will always be separated by spaces.

> Also support += to allow variables to be appended to. This is needed when
> using the preprocessor.

I cannot see what the preprocessor has to do with this feature.  It
would be useful in any case, even without the preporcessor.


The documentation reads:

"Variables can contain `+` characters but in the unlikely
event that you want to have a variable name ending in plus, put a backslash
before the `+` so that the script knows you are not adding to an existing
variable but assigning to a new one::
 
    maximum\+=value
"

However, '\' is also a legal character in a variable name (and
doubled backslashes or apostrophes etc. are legal, too), so
above line should actually set the environment variable "maximum\+"
to "value".

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Steal five dollars and you were a petty  thief.  Steal  thousands  of
dollars and you are either a government or a hero.
                                   - Terry Pratchett, _Going_Postal_

  reply	other threads:[~2021-10-22  8:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  3:08 [PATCH v10 0/9] env: Allow environment in text files Simon Glass
2021-10-22  3:08 ` [PATCH v10 1/9] sandbox: Drop distro_boot Simon Glass
2021-11-17  1:57   ` Tom Rini
2021-10-22  3:08 ` [PATCH v10 2/9] doc: Move environment documentation to rST Simon Glass
2021-10-22  3:08 ` [PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file Simon Glass
2021-10-22  8:29   ` Wolfgang Denk [this message]
2021-10-22 14:29     ` Tom Rini
2021-10-22 23:29       ` Tony Dinh
2021-10-24 15:41       ` Wolfgang Denk
2021-11-12 18:12   ` Daniel Golle
2021-11-13 14:19     ` Simon Glass
2022-02-10 11:20   ` Patrick DELAUNAY
2022-03-12 18:14     ` Simon Glass
2021-10-22  3:08 ` [PATCH v10 4/9] sandbox: Use a text-based environment Simon Glass
2021-10-22  3:08 ` [PATCH v10 5/9] doc: Mention CONFIG_DEFAULT_ENV_FILE Simon Glass
2021-10-22  3:08 ` [PATCH v10 6/9] doc: Improve environment documentation Simon Glass
2021-10-22  3:08 ` [PATCH v10 7/9] doc: Improve environment documentation further Simon Glass
2021-10-23  8:23   ` Heinrich Schuchardt
2022-03-12  2:24     ` Simon Glass
2021-10-22  3:08 ` [PATCH v10 8/9] sandbox: Update the test MAC/IP addresses Simon Glass
2021-10-23  8:29   ` Heinrich Schuchardt
2021-10-24 19:54     ` Simon Glass
2021-10-24 21:39       ` Tom Rini
2021-10-22  3:08 ` [PATCH v10 9/9] bootm: Tidy up use of autostart env var Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3765086.1634891366@gemini.denx.de \
    --to=wd@denx.de \
    --cc=joe.hershberger@ni.com \
    --cc=marek.behun@nic.cz \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-board-maintainers@lists.denx.de \
    --cc=u-boot-custodians@lists.denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox