mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] u-boot: generate default environment image
@ 2019-10-31 17:28 Bruno Thomsen
  2019-11-04 10:27 ` Alexander Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bruno Thomsen @ 2019-10-31 17:28 UTC (permalink / raw)
  To: ptxdist; +Cc: Bruno Thomsen, bth

Can be used during manufacturing to avoid bootloader
console usage and speed up first boot.

Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
---
 platforms/u-boot.in | 28 ++++++++++++++++++++++++++++
 rules/u-boot.make   | 11 +++++++++++
 2 files changed, 39 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 9bac4a758..d9195d7cd 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -2,6 +2,7 @@
 
 menuconfig U_BOOT
 	select BOOTLOADER
+	select HOST_U_BOOT_TOOLS if U_BOOT_DEFAULT_ENV_IMAGE
 	prompt "U-Boot                        "
 	bool
 
@@ -71,6 +72,33 @@ config U_BOOT_CONFIG
 
 endif
 
+config U_BOOT_DEFAULT_ENV_IMAGE
+	prompt "Generate U-Boot default environment image"
+	bool
+	help
+	  Use U-Boot's mkenvimage to compile a U-Boot default environment
+	  image for use in device manufacturing.
+
+if U_BOOT_DEFAULT_ENV_IMAGE
+
+config U_BOOT_DEFAULT_ENV_IMAGE_SIZE
+	prompt "Default environment image size"
+	string
+	default "0x2000"
+	help
+	  Enter the U-Boot environment size for generation of manufacturing
+	  image. Size can be prefixed with 0x for hexadecimal values.
+	  Must match size defined in target config and "/etc/fw_env.config".
+
+config U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT
+	prompt "Default environment image with redundant copy"
+	bool
+	help
+	  Use to generate a redundant environment in the default image.
+	  Must match target config and "/etc/fw_env.config".
+
+endif
+
 config U_BOOT_BOOT_SCRIPT
 	prompt "Compile U-Boot boot script"
 	bool
diff --git a/rules/u-boot.make b/rules/u-boot.make
index 8f9290ea7..b6e65a95a 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -94,6 +94,13 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
 	@$(U_BOOT_DIR)/tools/mkimage -T script -C none \
 		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
 		$(U_BOOT_DIR)/boot.scr.uimg
+endif
+ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
+	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh | \
+		$(PTXDIST_SYSROOT_HOST)/bin/mkenvimage -p 0x0 \
+		$(call ptx/ifdef,PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT,-r,) \
+		-s $(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_SIZE) \
+		-o $(U_BOOT_DIR)/u-boot-env.img -
 endif
 	@$(call touch)
 
@@ -141,6 +148,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
 	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
 		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
 endif
+ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
+	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-env.img \
+		$(IMAGEDIR)/u-boot-env.img
+endif
 
 ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
 	@$(call install_init, u-boot)
-- 
2.23.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: generate default environment image
  2019-10-31 17:28 [ptxdist] [PATCH] u-boot: generate default environment image Bruno Thomsen
@ 2019-11-04 10:27 ` Alexander Dahl
  2019-11-06 14:12 ` Denis OSTERLAND
  2019-11-08 17:47 ` Michael Olbrich
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-11-04 10:27 UTC (permalink / raw)
  To: ptxdist; +Cc: Bruno Thomsen, bth

Hei hei,

did not review carefully, but …

Am Donnerstag, 31. Oktober 2019, 18:28:52 CET schrieb Bruno Thomsen:
> Can be used during manufacturing to avoid bootloader
> console usage and speed up first boot.
> 
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
>  platforms/u-boot.in | 28 ++++++++++++++++++++++++++++
>  rules/u-boot.make   | 11 +++++++++++
>  2 files changed, 39 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..d9195d7cd 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -2,6 +2,7 @@
> 
>  menuconfig U_BOOT
>  	select BOOTLOADER
> +	select HOST_U_BOOT_TOOLS if U_BOOT_DEFAULT_ENV_IMAGE
>  	prompt "U-Boot                        "
>  	bool
> 
> @@ -71,6 +72,33 @@ config U_BOOT_CONFIG
> 
>  endif
> 
> +config U_BOOT_DEFAULT_ENV_IMAGE
> +	prompt "Generate U-Boot default environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a U-Boot default environment
> +	  image for use in device manufacturing.
> +
> +if U_BOOT_DEFAULT_ENV_IMAGE
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_SIZE
> +	prompt "Default environment image size"
> +	string
> +	default "0x2000"
> +	help
> +	  Enter the U-Boot environment size for generation of manufacturing
> +	  image. Size can be prefixed with 0x for hexadecimal values.
> +	  Must match size defined in target config and "/etc/fw_env.config".
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT
> +	prompt "Default environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the default image.
> +	  Must match target config and "/etc/fw_env.config".
> +
> +endif
> +
>  config U_BOOT_BOOT_SCRIPT
>  	prompt "Compile U-Boot boot script"
>  	bool
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 8f9290ea7..b6e65a95a 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -94,6 +94,13 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(U_BOOT_DIR)/tools/mkimage -T script -C none \
>  		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
>  		$(U_BOOT_DIR)/boot.scr.uimg
> +endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh | \
> +		$(PTXDIST_SYSROOT_HOST)/bin/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/u-boot-env.img -
>  endif
>  	@$(call touch)
> 
> @@ -141,6 +148,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
>  	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
>  		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-env.img \
> +		$(IMAGEDIR)/u-boot-env.img
> +endif
> 
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)

Tested-by: Alexander Dahl <ada@thorsis.com>

Image looks fine, as far as I can tell.

Greets
Alex


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: generate default environment image
  2019-10-31 17:28 [ptxdist] [PATCH] u-boot: generate default environment image Bruno Thomsen
  2019-11-04 10:27 ` Alexander Dahl
@ 2019-11-06 14:12 ` Denis OSTERLAND
  2019-11-08 17:47 ` Michael Olbrich
  2 siblings, 0 replies; 5+ messages in thread
From: Denis OSTERLAND @ 2019-11-06 14:12 UTC (permalink / raw)
  To: ptxdist

Hi,

the get_default_envs.sh script generates a text file
which represents the compiled in default environment.
It would be handy to specify the text file, to have a environment
image for production, different from default.

I think about:
Kconfig:
config U_BOOT_ENV_IMAGE
	bool
	...
if U_BOOT_ENV_IMAGE
config U_BOOT_ENV_IMAGE_SOURCE
	string ""
	help
	  Text file describing the environment. The file should have
	  lines of the form var=value, one per line. Blank lines and
	  lines starting with a # are ignored..
	  Leave empty to generate image from compiled-in env.

	...
I am fine with U_BOOT_DEFAULT_ENV_IMAGE_SIZE and U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT.

And in make file:
	$(U_BOOT_MAKE_ENV) $(if $(call remove_quotes,$(PTXCONF_U_BOOT_ENV_IMAGE_SOURCE)), \
		cat "$(shell ptxd_get_alternative config/images $(PTXCONF_U_BOOT_ENV_IMAGE_SOURCE) && echo "$$ptxd_reply" || ptxd_bailout "could not find u-boot env file")", \
		$(U_BOOT_DIR)/scripts/get_default_envs.sh) | \
		mkenvimage -p 0x0 \

Not sure if config/images the the right place and layout should be better.

BTW ptxdist will search SYSROOT_HOST for mkenvimage, so there is no need to be verbose.

Regards Denis

Am Donnerstag, den 31.10.2019, 18:28 +0100 schrieb Bruno Thomsen:
> Can be used during manufacturing to avoid bootloader
> console usage and speed up first boot.
> 
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
>  platforms/u-boot.in | 28 ++++++++++++++++++++++++++++
>  rules/u-boot.make   | 11 +++++++++++
>  2 files changed, 39 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..d9195d7cd 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -2,6 +2,7 @@
>  
>  menuconfig U_BOOT
>  	select BOOTLOADER
> +	select HOST_U_BOOT_TOOLS if U_BOOT_DEFAULT_ENV_IMAGE
>  	prompt "U-Boot                        "
>  	bool
>  
> @@ -71,6 +72,33 @@ config U_BOOT_CONFIG
>  
>  endif
>  
> +config U_BOOT_DEFAULT_ENV_IMAGE
> +	prompt "Generate U-Boot default environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a U-Boot default environment
> +	  image for use in device manufacturing.
> +
> +if U_BOOT_DEFAULT_ENV_IMAGE
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_SIZE
> +	prompt "Default environment image size"
> +	string
> +	default "0x2000"
> +	help
> +	  Enter the U-Boot environment size for generation of manufacturing
> +	  image. Size can be prefixed with 0x for hexadecimal values.
> +	  Must match size defined in target config and "/etc/fw_env.config".
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT
> +	prompt "Default environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the default image.
> +	  Must match target config and "/etc/fw_env.config".
> +
> +endif
> +
>  config U_BOOT_BOOT_SCRIPT
>  	prompt "Compile U-Boot boot script"
>  	bool
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 8f9290ea7..b6e65a95a 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -94,6 +94,13 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(U_BOOT_DIR)/tools/mkimage -T script -C none \
>  		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
>  		$(U_BOOT_DIR)/boot.scr.uimg
> +endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh | \
> +		$(PTXDIST_SYSROOT_HOST)/bin/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/u-boot-env.img -
>  endif
>  	@$(call touch)
>  
> @@ -141,6 +148,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
>  	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
>  		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-env.img \
> +		$(IMAGEDIR)/u-boot-env.img
> +endif
>  
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)


Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter https://www.diehl.com/group/de/transparenz-und-informationspflichten/

The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
- For general information on data protection and your respective rights please visit https://www.diehl.com/group/en/transparency-and-information-obligations/
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: generate default environment image
  2019-10-31 17:28 [ptxdist] [PATCH] u-boot: generate default environment image Bruno Thomsen
  2019-11-04 10:27 ` Alexander Dahl
  2019-11-06 14:12 ` Denis OSTERLAND
@ 2019-11-08 17:47 ` Michael Olbrich
  2019-11-12 13:20   ` Bruno Thomsen
  2 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2019-11-08 17:47 UTC (permalink / raw)
  To: ptxdist

On Thu, Oct 31, 2019 at 06:28:52PM +0100, Bruno Thomsen wrote:
> Can be used during manufacturing to avoid bootloader
> console usage and speed up first boot.
> 
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
>  platforms/u-boot.in | 28 ++++++++++++++++++++++++++++
>  rules/u-boot.make   | 11 +++++++++++
>  2 files changed, 39 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..d9195d7cd 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -2,6 +2,7 @@
>  
>  menuconfig U_BOOT
>  	select BOOTLOADER
> +	select HOST_U_BOOT_TOOLS if U_BOOT_DEFAULT_ENV_IMAGE

Hmm, u-boot builds it's own mkenvimage, right? Why not use that one and
avoid the extra dependency?

Michael

>  	prompt "U-Boot                        "
>  	bool
>  
> @@ -71,6 +72,33 @@ config U_BOOT_CONFIG
>  
>  endif
>  
> +config U_BOOT_DEFAULT_ENV_IMAGE
> +	prompt "Generate U-Boot default environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a U-Boot default environment
> +	  image for use in device manufacturing.
> +
> +if U_BOOT_DEFAULT_ENV_IMAGE
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_SIZE
> +	prompt "Default environment image size"
> +	string
> +	default "0x2000"
> +	help
> +	  Enter the U-Boot environment size for generation of manufacturing
> +	  image. Size can be prefixed with 0x for hexadecimal values.
> +	  Must match size defined in target config and "/etc/fw_env.config".
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT
> +	prompt "Default environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the default image.
> +	  Must match target config and "/etc/fw_env.config".
> +
> +endif
> +
>  config U_BOOT_BOOT_SCRIPT
>  	prompt "Compile U-Boot boot script"
>  	bool
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index 8f9290ea7..b6e65a95a 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -94,6 +94,13 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(U_BOOT_DIR)/tools/mkimage -T script -C none \
>  		-d $(U_BOOT_BOOT_SCRIPT_TXT) \
>  		$(U_BOOT_DIR)/boot.scr.uimg
> +endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	$(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh | \
> +		$(PTXDIST_SYSROOT_HOST)/bin/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/u-boot-env.img -
>  endif
>  	@$(call touch)
>  
> @@ -141,6 +148,10 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
>  	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
>  		$(IMAGEDIR)/u-boot-with-spl-pbl.bin
>  endif
> +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE
> +	@install -v -D -m644 $(U_BOOT_DIR)/u-boot-env.img \
> +		$(IMAGEDIR)/u-boot-env.img
> +endif
>  
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)
> -- 
> 2.23.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] u-boot: generate default environment image
  2019-11-08 17:47 ` Michael Olbrich
@ 2019-11-12 13:20   ` Bruno Thomsen
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Thomsen @ 2019-11-12 13:20 UTC (permalink / raw)
  To: ptxdist

Hi

Thanks for review and test everybody.

Den fre. 8. nov. 2019 kl. 18.47 skrev Michael Olbrich
<m.olbrich@pengutronix.de>:
>
> Hmm, u-boot builds it's own mkenvimage, right? Why not use that one and
> avoid the extra dependency?

You are right, I just assumed it was for target architecture.

Den ons. 6. nov. 2019 kl. 15.12 skrev Denis OSTERLAND
<denis.osterland@diehl.com>:
>
> the get_default_envs.sh script generates a text file
> which represents the compiled in default environment.
> It would be handy to specify the text file, to have a environment
> image for production, different from default.

Sure, I will try and add a custom environment generation as well in
the next version of the patch.

Bruno

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2019-11-12 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 17:28 [ptxdist] [PATCH] u-boot: generate default environment image Bruno Thomsen
2019-11-04 10:27 ` Alexander Dahl
2019-11-06 14:12 ` Denis OSTERLAND
2019-11-08 17:47 ` Michael Olbrich
2019-11-12 13:20   ` Bruno Thomsen

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