Skip to contentSkip to conversation

uboot: support -p option for mkenvimage

PATCH New spdawson at gmail.com 2 participants 4 messages Oct 10, 2013 – Oct 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot: support -p option for mkenvimage

From: Simon Dawson <[email protected]>

---
 boot/uboot/Config.in | 6 ++++++
 boot/uboot/uboot.mk  | 1 +
 2 files changed, 7 insertions(+)
boot/uboot/Config.in +6 -0
index 998cda2..c341670 100644
@@ -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
boot/uboot/uboot.mk +1 -0
index dc8e26f..77cad6a 100644
@@ -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
 
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 uboot: support -p option for mkenvimage

Simon,

Quoted 13 lines · spdawson at gmail.com

From: Simon Dawson <[email protected]>

---
 boot/uboot/Config.in | 6 ++++++
 boot/uboot/uboot.mk  | 1 +
 2 files changed, 7 insertions(+)
boot/uboot/Config.in +0 -0
index 998cda2..c341670 100644

boot/uboot/Config.in config BR2_TARGET_UBOOT_ENVIMAGE_SIZE · line 249

Quoted 8 lines
boot/uboot/Config.in +5 -0
@@ -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

Signature · 3 lines
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 uboot: support -p option for mkenvimage

Quoted 3 lines · Thomas Petazzoni

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.

#3 lore raw

PATCH 1/1 uboot: support -p option for mkenvimage

Dear Simon Dawson,

Quoted 8 lines · Simon Dawson

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.

Quoted 3 lines

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

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