* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
@ 2013-09-12 23:41 Ryan Barnett
2013-09-13 2:13 ` Danomi Manchego
2013-09-13 7:01 ` Thomas Petazzoni
0 siblings, 2 replies; 6+ messages in thread
From: Ryan Barnett @ 2013-09-12 23:41 UTC (permalink / raw)
To: buildroot
Some boards in u-boot support the ability to modify the environment
by placing a plain text file as uEnv.txt in the root of the partition
of an SD card. For the extact placement of where the uEnv.txt should
be, consult your u-boot environment. Your board supports this
overwriting of environment variables if "loadbootenv" and
"importbootenv" are defined in the board's environment.
Add support for specifying a plain text file under
Bootloaders > U-Boot > uEnv.txt that will be copied to the the
BINARIES_DIR as uEnv.txt.
Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>
---
boot/uboot/Config.in | 11 +++++++++++
boot/uboot/uboot.mk | 8 ++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 1b98339..d9d788c 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -241,4 +241,15 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
endif # BR2_TARGET_UBOOT_ENVIMAGE
+config BR2_TARGET_UBOOT_ENV_TXT_FILE
+ string "uEnv.txt file"
+ help
+ If your board supports the ability to modify the environment
+ with a plain text file named uEnv.txt, specify a plain text
+ file that will be copied to the BINARIES_DIR as uEnv.txt.
+ Information about the format for this text file can be found
+ on TI's wiki under
+ "Setting U-Boot environment using uEnv.txt":
+ http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide
+
endif # BR2_TARGET_UBOOT
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 631da6b..68c055b 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -150,6 +150,14 @@ endif
UBOOT_DEPENDENCIES += host-uboot-tools
endif
+UBOOT_ENV_TXT_FILE=$(call qstrip,$(BR2_TARGET_UBOOT_ENV_TXT_FILE))
+ifneq ($(UBOOT_ENV_TXT_FILE),)
+define UBOOT_INSTALL_UENV_TXT_FILE
+ cp -dpf $(UBOOT_ENV_TXT_FILE) $(BINARIES_DIR)/uEnv.txt
+endef
+UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_UENV_TXT_FILE
+endif
+
$(eval $(generic-package))
ifeq ($(BR2_TARGET_UBOOT),y)
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
2013-09-12 23:41 [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file Ryan Barnett
@ 2013-09-13 2:13 ` Danomi Manchego
2013-09-13 7:01 ` Thomas Petazzoni
1 sibling, 0 replies; 6+ messages in thread
From: Danomi Manchego @ 2013-09-13 2:13 UTC (permalink / raw)
To: buildroot
On Thu, Sep 12, 2013 at 7:41 PM, Ryan Barnett
<rjbarnet@rockwellcollins.com>wrote:
> Some boards in u-boot support the ability to modify the environment
> by placing a plain text file as uEnv.txt in the root of the partition
> of an SD card. For the extact placement of where the uEnv.txt should
>
Spelling ... /extact/exact/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130912/a2e90c04/attachment.html>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
2013-09-12 23:41 [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file Ryan Barnett
2013-09-13 2:13 ` Danomi Manchego
@ 2013-09-13 7:01 ` Thomas Petazzoni
2013-09-13 14:36 ` Ryan Barnett
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2013-09-13 7:01 UTC (permalink / raw)
To: buildroot
Dear Ryan Barnett,
On Thu, 12 Sep 2013 18:41:43 -0500, Ryan Barnett wrote:
> Some boards in u-boot support the ability to modify the environment
> by placing a plain text file as uEnv.txt in the root of the partition
> of an SD card. For the extact placement of where the uEnv.txt should
> be, consult your u-boot environment. Your board supports this
> overwriting of environment variables if "loadbootenv" and
> "importbootenv" are defined in the board's environment.
loadbootenv and importbootenv are just U-Boot scripts that are specific
to certain board configurations.
All what loadbootenv does it load a file into memory, and all what
importbootenv does is call 'env import -t <addr> <size>' to load the
environment into U-Boot.
So I don't think we should be mentioning loadbootenv and importbootenv
here.
However, what I'm really wondering if is we really need this. After
all, this is all about copying a text file to $(BINARIES_DIR),
something a post-build or a post-image script can do perfectly fine. I
mean, there's nothing U-Boot specific involved here, it's just a plain
'cp'. Therefore, I'm not sure we need this at all, but I am open to
discussion on this.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
2013-09-13 7:01 ` Thomas Petazzoni
@ 2013-09-13 14:36 ` Ryan Barnett
2013-09-13 20:42 ` Arnout Vandecappelle
0 siblings, 1 reply; 6+ messages in thread
From: Ryan Barnett @ 2013-09-13 14:36 UTC (permalink / raw)
To: buildroot
Thomas,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote on 09/13/2013
02:01:34 AM:
>
> Dear Ryan Barnett,
>
> On Thu, 12 Sep 2013 18:41:43 -0500, Ryan Barnett wrote:
> > Some boards in u-boot support the ability to modify the environment
> > by placing a plain text file as uEnv.txt in the root of the partition
> > of an SD card. For the extact placement of where the uEnv.txt should
> > be, consult your u-boot environment. Your board supports this
> > overwriting of environment variables if "loadbootenv" and
> > "importbootenv" are defined in the board's environment.
>
> loadbootenv and importbootenv are just U-Boot scripts that are specific
> to certain board configurations.
>
> All what loadbootenv does it load a file into memory, and all what
> importbootenv does is call 'env import -t <addr> <size>' to load the
> environment into U-Boot.
>
> So I don't think we should be mentioning loadbootenv and importbootenv
> here.
That is fine, and I'll remove if we decide to push forward with the patch.
> However, what I'm really wondering if is we really need this. After
> all, this is all about copying a text file to $(BINARIES_DIR),
> something a post-build or a post-image script can do perfectly fine. I
> mean, there's nothing U-Boot specific involved here, it's just a plain
> 'cp'. Therefore, I'm not sure we need this at all, but I am open to
> discussion on this.
>
Well I do agree that it isn't difficult to place in post-build/image
script
which is how I currently do things. My thought with adding it here is that
it is a potential alternative to an Environment image. I didn't know about
this feature until just within the last couple months and I always keep
forgetting it is an option. So placing it under the "Environment image"
may open some eye's that this option exists for them. It seems like more
and more boards are adapting this feature.
Thanks,
-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130913/4fb05793/attachment.html>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
2013-09-13 14:36 ` Ryan Barnett
@ 2013-09-13 20:42 ` Arnout Vandecappelle
2013-09-13 20:57 ` Ryan Barnett
0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2013-09-13 20:42 UTC (permalink / raw)
To: buildroot
On 13/09/13 16:36, Ryan Barnett wrote:
> Thomas,
>
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote on
> 09/13/2013 02:01:34 AM:
> >
> > Dear Ryan Barnett,
> >
> > On Thu, 12 Sep 2013 18:41:43 -0500, Ryan Barnett wrote:
> > > Some boards in u-boot support the ability to modify the environment
> > > by placing a plain text file as uEnv.txt in the root of the partition
> > > of an SD card. For the extact placement of where the uEnv.txt should
> > > be, consult your u-boot environment. Your board supports this
> > > overwriting of environment variables if "loadbootenv" and
> > > "importbootenv" are defined in the board's environment.
[snip]
> > However, what I'm really wondering if is we really need this. After
> > all, this is all about copying a text file to $(BINARIES_DIR),
> > something a post-build or a post-image script can do perfectly fine. I
> > mean, there's nothing U-Boot specific involved here, it's just a plain
> > 'cp'. Therefore, I'm not sure we need this at all, but I am open to
> > discussion on this.
> >
>
> Well I do agree that it isn't difficult to place in post-build/image script
> which is how I currently do things. My thought with adding it here is that
> it is a potential alternative to an Environment image. I didn't know about
> this feature until just within the last couple months and I always keep
> forgetting it is an option. So placing it under the "Environment image"
> may open some eye's that this option exists for them. It seems like more
> and more boards are adapting this feature.
I'm with Thomas on this one. It's not buildroot's mission to replace
the documentation of the underlying tools/packages. If there is something
simple that we can do that saves the user a lot of time, let's go for it,
but otherwise buildroot should be about building upstream code.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file
2013-09-13 20:42 ` Arnout Vandecappelle
@ 2013-09-13 20:57 ` Ryan Barnett
0 siblings, 0 replies; 6+ messages in thread
From: Ryan Barnett @ 2013-09-13 20:57 UTC (permalink / raw)
To: buildroot
Arnout/Thomas Petazzoni,
Arnout Vandecappelle <arnout@mind.be> wrote on 09/13/2013 03:42:12 PM:
> >
> > Well I do agree that it isn't difficult to place in post-build/image
script
> > which is how I currently do things. My thought with adding it here is
that
> > it is a potential alternative to an Environment image. I didn't know
about
> > this feature until just within the last couple months and I always
keep
> > forgetting it is an option. So placing it under the "Environment
image"
> > may open some eye's that this option exists for them. It seems like
more
> > and more boards are adapting this feature.
>
> I'm with Thomas on this one. It's not buildroot's mission to replace
> the documentation of the underlying tools/packages. If there is
something
> simple that we can do that saves the user a lot of time, let's go for
it,
> but otherwise buildroot should be about building upstream code.
Alright, I understand that it is not buildroot's mission to replace the
documentation of the underlying tools/packages. I can take all of that
information out if that would help if wanted. I guess I was just offering
this up as an alternative to Environment image when browsing through the
menuconfig.
At the end of the day if you don't feel this is best to be in buildroot,
I'm fine with leaving this out as I spent all of 10 minutes on
implementing this so I don't have much invested in this.
Thanks,
-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130913/1ca4a2d7/attachment.html>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-13 20:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 23:41 [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file Ryan Barnett
2013-09-13 2:13 ` Danomi Manchego
2013-09-13 7:01 ` Thomas Petazzoni
2013-09-13 14:36 ` Ryan Barnett
2013-09-13 20:42 ` Arnout Vandecappelle
2013-09-13 20:57 ` Ryan Barnett
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.