* env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
@ 2024-07-11 20:31 Tony Dinh
2024-07-11 22:46 ` Tom Rini
2024-07-12 8:14 ` Rasmus Villemoes
0 siblings, 2 replies; 6+ messages in thread
From: Tony Dinh @ 2024-07-11 20:31 UTC (permalink / raw)
To: Tom Rini, U-Boot Mailing List; +Cc: Phil Sutter
Hi Tom,
I'm trying to move some envs from a board header file to the default
env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
before:
https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
erased, and then the envs are populated with what's in
CONFIG_DEFAULT_ENV_FILE.
Did I understand the usage correctly?
Thanks,
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
2024-07-11 20:31 env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS Tony Dinh
@ 2024-07-11 22:46 ` Tom Rini
2024-07-12 0:31 ` Tony Dinh
2024-07-12 8:14 ` Rasmus Villemoes
1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2024-07-11 22:46 UTC (permalink / raw)
To: Tony Dinh; +Cc: U-Boot Mailing List, Phil Sutter
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
On Thu, Jul 11, 2024 at 01:31:34PM -0700, Tony Dinh wrote:
> Hi Tom,
>
> I'm trying to move some envs from a board header file to the default
> env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
> appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
> before:
>
> https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
>
> But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
> erased, and then the envs are populated with what's in
> CONFIG_DEFAULT_ENV_FILE.
>
> Did I understand the usage correctly?
Can you please post your I assume non-functioning-correctly patch? For
example, dragonboard410c has both
board/qualcomm/dragonboard410c/dragonboard410c.env and sets "#define
CFG_EXTRA_ENV_SETTINGS BOOTENV" in
include/configs/dragonboard410c.h
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
2024-07-11 22:46 ` Tom Rini
@ 2024-07-12 0:31 ` Tony Dinh
0 siblings, 0 replies; 6+ messages in thread
From: Tony Dinh @ 2024-07-12 0:31 UTC (permalink / raw)
To: Tom Rini; +Cc: U-Boot Mailing List, Phil Sutter
Hi Tom,
On Thu, Jul 11, 2024 at 3:46 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, Jul 11, 2024 at 01:31:34PM -0700, Tony Dinh wrote:
> > Hi Tom,
> >
> > I'm trying to move some envs from a board header file to the default
> > env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
> > appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
> > before:
> >
> > https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
> >
> > But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
> > erased, and then the envs are populated with what's in
> > CONFIG_DEFAULT_ENV_FILE.
> >
> > Did I understand the usage correctly?
>
> Can you please post your I assume non-functioning-correctly patch? For
> example, dragonboard410c has both
> board/qualcomm/dragonboard410c/dragonboard410c.env and sets "#define
> CFG_EXTRA_ENV_SETTINGS BOOTENV" in
> include/configs/dragonboard410c.h
>
Here is the patch. Note that this patch depends on a previous patch
(irrelevant to this test):
https://patchwork.ozlabs.org/project/uboot/patch/20240708043904.5100-1-mibodhi@gmail.com/
diff --git a/board/Synology/ds414/ds414.env b/board/Synology/ds414/ds414.env
new file mode 100644
index 0000000000..03875e4e93
--- /dev/null
+++ b/board/Synology/ds414/ds414.env
@@ -0,0 +1,3 @@
+# Boot to original firmware if bootstd failed
+#
+bootcmd=bootflow scan -lb; run bootcmd_legacy
diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index 6391c43474..9dd07f01c9 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -55,6 +55,8 @@ CONFIG_CMD_UBI=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_SPI_MAX_HZ=50000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="board/Synology/ds414/ds414.env"
CONFIG_ARP_TIMEOUT=200
CONFIG_NET_RETRY_COUNT=50
CONFIG_NET_RANDOM_ETHADDR=y
Now, I kwboot the newly built u-boot. In the serial console, I set the
envs to default expecting only the bootcmd is replaced. But all other
envs that were in CFG_EXTRA_ENV_SETTINGS got erased.
DS414> ver
U-Boot 2024.07-tld-1-g2b2b95c77b37-dirty (Jul 11 2024 - 17:10:09 -0700)
Synology DS214+/DS414 2/4-Bay Diskstation
DS414> env def -a
## Resetting to default environment
DS414> printenv
bootcmd=bootflow scan -lb; run bootcmd_legacy
Environment size: 47/65532 bytes
DS414>
All the best,
Tony
> --
> Tom
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
2024-07-11 20:31 env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS Tony Dinh
2024-07-11 22:46 ` Tom Rini
@ 2024-07-12 8:14 ` Rasmus Villemoes
2024-07-12 16:50 ` Tom Rini
1 sibling, 1 reply; 6+ messages in thread
From: Rasmus Villemoes @ 2024-07-12 8:14 UTC (permalink / raw)
To: Tony Dinh; +Cc: Tom Rini, U-Boot Mailing List, Phil Sutter
Tony Dinh <mibodhi@gmail.com> writes:
> Hi Tom,
>
> I'm trying to move some envs from a board header file to the default
> env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
> appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
> before:
>
> https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
>
> But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
> erased, and then the envs are populated with what's in
> CONFIG_DEFAULT_ENV_FILE.
>
Author of CONFIG_DEFAULT_ENV_FILE here.
Yes, the point of that option is that you supply the entire and full
intended default environment in that file. No U-Boot CONFIG_ options of
CFG_* defines or anything else affects what goes into the default env
when that option is used. [At run-time, U-Boot probably injects/sets a
few env vars, but that's true regardless of how the default env came to
be].
I think there may be some confusion with the much newer
CONFIG_ENV_SOURCE_FILE, which is another mechanism entirely. In that
case the pointed-to source file is sent through cpp, thus allowing some
u-boot config stuff to be used/referenced, and I think some further
bells-and-whistles also exist. I don't know if CFG_EXTRA_ENV_SETTINGS
are taken into account in that case or not.
Rasmus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
2024-07-12 8:14 ` Rasmus Villemoes
@ 2024-07-12 16:50 ` Tom Rini
2024-07-12 19:28 ` Tony Dinh
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2024-07-12 16:50 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: Tony Dinh, U-Boot Mailing List, Phil Sutter
[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]
On Fri, Jul 12, 2024 at 10:14:27AM +0200, Rasmus Villemoes wrote:
> Tony Dinh <mibodhi@gmail.com> writes:
>
> > Hi Tom,
> >
> > I'm trying to move some envs from a board header file to the default
> > env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
> > appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
> > before:
> >
> > https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
> >
> > But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
> > erased, and then the envs are populated with what's in
> > CONFIG_DEFAULT_ENV_FILE.
> >
>
> Author of CONFIG_DEFAULT_ENV_FILE here.
>
> Yes, the point of that option is that you supply the entire and full
> intended default environment in that file. No U-Boot CONFIG_ options of
> CFG_* defines or anything else affects what goes into the default env
> when that option is used. [At run-time, U-Boot probably injects/sets a
> few env vars, but that's true regardless of how the default env came to
> be].
>
> I think there may be some confusion with the much newer
> CONFIG_ENV_SOURCE_FILE, which is another mechanism entirely. In that
> case the pointed-to source file is sent through cpp, thus allowing some
> u-boot config stuff to be used/referenced, and I think some further
> bells-and-whistles also exist. I don't know if CFG_EXTRA_ENV_SETTINGS
> are taken into account in that case or not.
Yes, I think you're right about the confusion as I too missed that in my
reply.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS
2024-07-12 16:50 ` Tom Rini
@ 2024-07-12 19:28 ` Tony Dinh
0 siblings, 0 replies; 6+ messages in thread
From: Tony Dinh @ 2024-07-12 19:28 UTC (permalink / raw)
To: Tom Rini; +Cc: Rasmus Villemoes, U-Boot Mailing List, Phil Sutter
On Fri, Jul 12, 2024 at 9:50 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Fri, Jul 12, 2024 at 10:14:27AM +0200, Rasmus Villemoes wrote:
> > Tony Dinh <mibodhi@gmail.com> writes:
> >
> > > Hi Tom,
> > >
> > > I'm trying to move some envs from a board header file to the default
> > > env file. I recall that the envs in CONFIG_DEFAULT_ENV_FILE are
> > > appended to the envs in CFG_EXTRA_ENV_SETTINGS. As you mentioned here
> > > before:
> > >
> > > https://lore.kernel.org/all/20220810170439.GJ1146598@bill-the-cat/
> > >
> > > But it looks like envs in CFG_EXTRA_ENV_SETTINGS are completely
> > > erased, and then the envs are populated with what's in
> > > CONFIG_DEFAULT_ENV_FILE.
> > >
> >
> > Author of CONFIG_DEFAULT_ENV_FILE here.
> >
> > Yes, the point of that option is that you supply the entire and full
> > intended default environment in that file. No U-Boot CONFIG_ options of
> > CFG_* defines or anything else affects what goes into the default env
> > when that option is used. [At run-time, U-Boot probably injects/sets a
> > few env vars, but that's true regardless of how the default env came to
> > be].
> >
> > I think there may be some confusion with the much newer
> > CONFIG_ENV_SOURCE_FILE, which is another mechanism entirely. In that
> > case the pointed-to source file is sent through cpp, thus allowing some
> > u-boot config stuff to be used/referenced, and I think some further
> > bells-and-whistles also exist. I don't know if CFG_EXTRA_ENV_SETTINGS
> > are taken into account in that case or not.
>
> Yes, I think you're right about the confusion as I too missed that in my
> reply.
OK, thank you all for your clarification!
All the best,
Tony
>
> --
> Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-12 19:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 20:31 env: CONFIG_DEFAULT_ENV_FILE and CFG_EXTRA_ENV_SETTINGS Tony Dinh
2024-07-11 22:46 ` Tom Rini
2024-07-12 0:31 ` Tony Dinh
2024-07-12 8:14 ` Rasmus Villemoes
2024-07-12 16:50 ` Tom Rini
2024-07-12 19:28 ` Tony Dinh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.