Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] uboot: support -p option for mkenvimage
@ 2013-10-10 10:05 spdawson at gmail.com
  2013-10-10 15:06 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: spdawson at gmail.com @ 2013-10-10 10:05 UTC (permalink / raw)
  To: buildroot

From: Simon Dawson <spdawson@gmail.com>

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 boot/uboot/Config.in | 6 ++++++
 boot/uboot/uboot.mk  | 1 +
 2 files changed, 7 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 998cda2..c341670 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -242,6 +242,12 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
 	  Size of envronment, can be prefixed with 0x for hexadecimal
 	  values.
 
+config BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE
+	string "Padding byte"
+	default "0xff"
+	help
+	  Pad the image with the specified byte.
+
 endif # BR2_TARGET_UBOOT_ENVIMAGE
 
 endif # BR2_TARGET_UBOOT
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index dc8e26f..77cad6a 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -117,6 +117,7 @@ define UBOOT_INSTALL_IMAGES_CMDS
 		cp -dpf $(@D)/$(BR2_TARGET_UBOOT_SPL_NAME) $(BINARIES_DIR)/)
 	$(if $(BR2_TARGET_UBOOT_ENVIMAGE),
 		$(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+		-p $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE)) \
 		-o $(BINARIES_DIR)/uboot-env.bin $(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE))
 endef
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] uboot: support -p option for mkenvimage
  2013-10-10 10:05 [Buildroot] [PATCH] uboot: support -p option for mkenvimage spdawson at gmail.com
@ 2013-10-10 15:06 ` Thomas Petazzoni
  2013-10-11  7:47   ` Simon Dawson
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2013-10-10 15:06 UTC (permalink / raw)
  To: buildroot

Simon,

On Thu, 10 Oct 2013 11:05:45 +0100, spdawson at gmail.com wrote:
> From: Simon Dawson <spdawson@gmail.com>
> 
> Signed-off-by: Simon Dawson <spdawson@gmail.com>
> ---
>  boot/uboot/Config.in | 6 ++++++
>  boot/uboot/uboot.mk  | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 998cda2..c341670 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -242,6 +242,12 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
>  	  Size of envronment, can be prefixed with 0x for hexadecimal
>  	  values.
>  
> +config BR2_TARGET_UBOOT_ENVIMAGE_PADDING_BYTE
> +	string "Padding byte"
> +	default "0xff"
> +	help
> +	  Pad the image with the specified byte.

Maybe a few more words like in which cases this is useful, would be
nice to have I believe (I myself don't know when this option should be
used).

Thomas
-- 
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] uboot: support -p option for mkenvimage
  2013-10-10 15:06 ` Thomas Petazzoni
@ 2013-10-11  7:47   ` Simon Dawson
  2013-10-11  8:04     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Dawson @ 2013-10-11  7:47 UTC (permalink / raw)
  To: buildroot

On 10 October 2013 16:06, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Maybe a few more words like in which cases this is useful, would be
> nice to have I believe (I myself don't know when this option should be
> used).

I have been using a crappy script to generate a u-boot environment
image, and that script was padding with 0x00 bytes instead of 0xff
(which is the default used by the mkenvimage tool). Having looked into
this a bit more, it appears that the 0xff padding works just fine in
my particular use case.

So, I no longer consider this patch necessary, and cannot provide a
justification for it.

I have, however, found that I need to pass the -r (redundant
environment) flag to mkenvimage; so I propose exposing that flag in
the Buildroot menu.

Simon.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] uboot: support -p option for mkenvimage
  2013-10-11  7:47   ` Simon Dawson
@ 2013-10-11  8:04     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2013-10-11  8:04 UTC (permalink / raw)
  To: buildroot

Dear Simon Dawson,

On Fri, 11 Oct 2013 08:47:20 +0100, Simon Dawson wrote:

> I have been using a crappy script to generate a u-boot environment
> image, and that script was padding with 0x00 bytes instead of 0xff
> (which is the default used by the mkenvimage tool). Having looked into
> this a bit more, it appears that the 0xff padding works just fine in
> my particular use case.
> 
> So, I no longer consider this patch necessary, and cannot provide a
> justification for it.

Ok.

> I have, however, found that I need to pass the -r (redundant
> environment) flag to mkenvimage; so I propose exposing that flag in
> the Buildroot menu.

Right, -r is needed for some U-Boot configurations, so having a config
knob for it makes sense.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-11  8:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 10:05 [Buildroot] [PATCH] uboot: support -p option for mkenvimage spdawson at gmail.com
2013-10-10 15:06 ` Thomas Petazzoni
2013-10-11  7:47   ` Simon Dawson
2013-10-11  8:04     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox