mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2] u-boot: generate environment image
@ 2019-11-13 17:05 Bruno Thomsen
  2019-11-13 19:02 ` Alexander Dahl
  2019-11-15 13:59 ` Michael Olbrich
  0 siblings, 2 replies; 5+ messages in thread
From: Bruno Thomsen @ 2019-11-13 17:05 UTC (permalink / raw)
  To: ptxdist; +Cc: ada, denis.osterland, m.olbrich, Bruno Thomsen, bth

Add possiblity to generate both a default and/or
a custom environment image. Image can be used during
manufacturing to avoid bootloader console usage and
speed up first boot. Other image use-cases include
device development edition, device demonstration
mode, etc.

Custom environment image is generated from an user
provided config file with one 'var=value' per line
format. Input config file name is configurable.

Both outputs has configurable image names so it's
easier to see specific use-case.

Examples:
u-boot-demo-env.img
u-boot-development-env.img
u-boot-manufacturing-env.img
u-boot-default-env.img

Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
---
v2:
- remove HOST_U_BOOT_TOOLS dependency
- configurable default env image name
- add custom env image generation option
- move all options to sub menu

 platforms/u-boot.in | 64 +++++++++++++++++++++++++++++++++++++++++++++
 rules/u-boot.make   | 22 ++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/platforms/u-boot.in b/platforms/u-boot.in
index 9bac4a758..629fc9482 100644
--- a/platforms/u-boot.in
+++ b/platforms/u-boot.in
@@ -71,6 +71,70 @@ config U_BOOT_CONFIG
 
 endif
 
+menuconfig U_BOOT_GENERATE_ENV_IMAGE
+	bool
+	prompt "Generate environment image  "
+
+if U_BOOT_GENERATE_ENV_IMAGE
+
+config U_BOOT_DEFAULT_ENV_IMAGE
+	prompt "Generate default environment image"
+	bool
+	help
+	  Use U-Boot's mkenvimage to compile a default U-Boot environment
+	  image for use in e.g. device manufacturing or development.
+
+config U_BOOT_DEFAULT_ENV_IMAGE_FILE
+	prompt "Default environment image filename"
+	string
+	default "u-boot-env.img"
+	help
+	  Change default environment output image name.
+
+config U_BOOT_CUSTOM_ENV_IMAGE
+	prompt "Generate custom environment image"
+	bool
+	help
+	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
+	  image based on the text file in U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
+	  for use in e.g. device manufacturing or development.
+
+config U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
+	prompt "Custom environment source"
+	string
+	default "custom_env.config"
+	help
+	  Text file in PTXDIST_WORKSPACE describing the custom environment.
+	  The file should have lines in the form var=value, one per line.
+	  Blank lines and lines starting with a # are ignored.
+
+config U_BOOT_CUSTOM_ENV_IMAGE_FILE
+	prompt "Custom environment image filename"
+	string
+	default "u-boot-custom-env.img"
+	help
+	  Change custom environment output image name.
+
+comment "common options   ---"
+
+config U_BOOT_ENV_IMAGE_SIZE
+	prompt "Environment image size"
+	string
+	default "0x2000"
+	help
+	  Enter the U-Boot environment size for generation of 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_ENV_IMAGE_REDUNDANT
+	prompt "Environment image with redundant copy"
+	bool
+	help
+	  Use to generate a redundant environment in the 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..c3c426d6d 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -94,6 +94,20 @@ 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 | \
+		$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
+		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
+		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
+		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) -
+endif
+ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
+	$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
+		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
+		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
+		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
+		$(PTXDIST_WORKSPACE)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_SOURCE)
 endif
 	@$(call touch)
 
@@ -141,6 +155,14 @@ 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)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) \
+		$(IMAGEDIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE)
+endif
+ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
+	@install -v -D -m644 $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
+		$(IMAGEDIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE)
+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 v2] u-boot: generate environment image
  2019-11-13 17:05 [ptxdist] [PATCH v2] u-boot: generate environment image Bruno Thomsen
@ 2019-11-13 19:02 ` Alexander Dahl
  2019-11-15 13:59 ` Michael Olbrich
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-11-13 19:02 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl


[-- Attachment #1.1: Type: text/plain, Size: 5738 bytes --]

Hei hei,

On Wed, Nov 13, 2019 at 06:05:59PM +0100, Bruno Thomsen wrote:
> Add possiblity to generate both a default and/or
> a custom environment image. Image can be used during
> manufacturing to avoid bootloader console usage and
> speed up first boot. Other image use-cases include
> device development edition, device demonstration
> mode, etc.
> 
> Custom environment image is generated from an user
> provided config file with one 'var=value' per line
> format. Input config file name is configurable.
> 
> Both outputs has configurable image names so it's
> easier to see specific use-case.
> 
> Examples:
> u-boot-demo-env.img
> u-boot-development-env.img
> u-boot-manufacturing-env.img
> u-boot-default-env.img
> 
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> Tested-by: Alexander Dahl <ada@thorsis.com>

I did not test v2!

Will do in a few days, but technically I did not it.

Alex

> ---
> v2:
> - remove HOST_U_BOOT_TOOLS dependency
> - configurable default env image name
> - add custom env image generation option
> - move all options to sub menu
> 
>  platforms/u-boot.in | 64 +++++++++++++++++++++++++++++++++++++++++++++
>  rules/u-boot.make   | 22 ++++++++++++++++
>  2 files changed, 86 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..629fc9482 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -71,6 +71,70 @@ config U_BOOT_CONFIG
>  
>  endif
>  
> +menuconfig U_BOOT_GENERATE_ENV_IMAGE
> +	bool
> +	prompt "Generate environment image  "
> +
> +if U_BOOT_GENERATE_ENV_IMAGE
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE
> +	prompt "Generate default environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a default U-Boot environment
> +	  image for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_FILE
> +	prompt "Default environment image filename"
> +	string
> +	default "u-boot-env.img"
> +	help
> +	  Change default environment output image name.
> +
> +config U_BOOT_CUSTOM_ENV_IMAGE
> +	prompt "Generate custom environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
> +	  image based on the text file in U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> +	  for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> +	prompt "Custom environment source"
> +	string
> +	default "custom_env.config"
> +	help
> +	  Text file in PTXDIST_WORKSPACE describing the custom environment.
> +	  The file should have lines in the form var=value, one per line.
> +	  Blank lines and lines starting with a # are ignored.
> +
> +config U_BOOT_CUSTOM_ENV_IMAGE_FILE
> +	prompt "Custom environment image filename"
> +	string
> +	default "u-boot-custom-env.img"
> +	help
> +	  Change custom environment output image name.
> +
> +comment "common options   ---"
> +
> +config U_BOOT_ENV_IMAGE_SIZE
> +	prompt "Environment image size"
> +	string
> +	default "0x2000"
> +	help
> +	  Enter the U-Boot environment size for generation of 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_ENV_IMAGE_REDUNDANT
> +	prompt "Environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the 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..c3c426d6d 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -94,6 +94,20 @@ 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 | \
> +		$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) -
> +endif
> +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> +	$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> +		$(PTXDIST_WORKSPACE)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_SOURCE)
>  endif
>  	@$(call touch)
>  
> @@ -141,6 +155,14 @@ 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)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) \
> +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE)
> +endif
> +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> +	@install -v -D -m644 $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE)
> +endif
>  
>  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
>  	@$(call install_init, u-boot)
> -- 
> 2.23.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN     | speech censured, the first thought forbidden, the
 X  AGAINST      | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 92 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2] u-boot: generate environment image
  2019-11-13 17:05 [ptxdist] [PATCH v2] u-boot: generate environment image Bruno Thomsen
  2019-11-13 19:02 ` Alexander Dahl
@ 2019-11-15 13:59 ` Michael Olbrich
  2019-11-18  8:43   ` Denis OSTERLAND
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2019-11-15 13:59 UTC (permalink / raw)
  To: ptxdist; +Cc: ada, denis.osterland, Bruno Thomsen, bth

On Wed, Nov 13, 2019 at 06:05:59PM +0100, Bruno Thomsen wrote:
> Add possiblity to generate both a default and/or
> a custom environment image. Image can be used during
> manufacturing to avoid bootloader console usage and
> speed up first boot. Other image use-cases include
> device development edition, device demonstration
> mode, etc.
> 
> Custom environment image is generated from an user
> provided config file with one 'var=value' per line
> format. Input config file name is configurable.
> 
> Both outputs has configurable image names so it's
> easier to see specific use-case.
> 
> Examples:
> u-boot-demo-env.img
> u-boot-development-env.img
> u-boot-manufacturing-env.img
> u-boot-default-env.img
> 
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> Tested-by: Alexander Dahl <ada@thorsis.com>
> ---
> v2:
> - remove HOST_U_BOOT_TOOLS dependency
> - configurable default env image name
> - add custom env image generation option
> - move all options to sub menu
> 
>  platforms/u-boot.in | 64 +++++++++++++++++++++++++++++++++++++++++++++
>  rules/u-boot.make   | 22 ++++++++++++++++
>  2 files changed, 86 insertions(+)
> 
> diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> index 9bac4a758..629fc9482 100644
> --- a/platforms/u-boot.in
> +++ b/platforms/u-boot.in
> @@ -71,6 +71,70 @@ config U_BOOT_CONFIG
>  
>  endif
>  
> +menuconfig U_BOOT_GENERATE_ENV_IMAGE
> +	bool
> +	prompt "Generate environment image  "
> +
> +if U_BOOT_GENERATE_ENV_IMAGE
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE
> +	prompt "Generate default environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a default U-Boot environment
> +	  image for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_DEFAULT_ENV_IMAGE_FILE
> +	prompt "Default environment image filename"
> +	string
> +	default "u-boot-env.img"
> +	help
> +	  Change default environment output image name.

Why the custom name? It's just the filename in images/ and it can be
changed wenn it's added to an image, if that's necessary.
If it's important, then the option should depend on
U_BOOT_DEFAULT_ENV_IMAGE

> +
> +config U_BOOT_CUSTOM_ENV_IMAGE
> +	prompt "Generate custom environment image"
> +	bool
> +	help
> +	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
> +	  image based on the text file in U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> +	  for use in e.g. device manufacturing or development.
> +
> +config U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> +	prompt "Custom environment source"
> +	string
> +	default "custom_env.config"
> +	help
> +	  Text file in PTXDIST_WORKSPACE describing the custom environment.
> +	  The file should have lines in the form var=value, one per line.
> +	  Blank lines and lines starting with a # are ignored.
> +
> +config U_BOOT_CUSTOM_ENV_IMAGE_FILE
> +	prompt "Custom environment image filename"
> +	string
> +	default "u-boot-custom-env.img"
> +	help
> +	  Change custom environment output image name.

Denis, I think you were asking for a selectable input file, not generating
multiple env images?

And the same issue as above, if this stays: do we need to custom output
filename and hide the suboptions with 'depends'.

Michael

> +
> +comment "common options   ---"
> +
> +config U_BOOT_ENV_IMAGE_SIZE
> +	prompt "Environment image size"
> +	string
> +	default "0x2000"
> +	help
> +	  Enter the U-Boot environment size for generation of 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_ENV_IMAGE_REDUNDANT
> +	prompt "Environment image with redundant copy"
> +	bool
> +	help
> +	  Use to generate a redundant environment in the 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..c3c426d6d 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -94,6 +94,20 @@ 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 | \
> +		$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) -
> +endif
> +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> +	$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> +		$(PTXDIST_WORKSPACE)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_SOURCE)
>  endif
>  	@$(call touch)
>  
> @@ -141,6 +155,14 @@ 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)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) \
> +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE)
> +endif
> +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> +	@install -v -D -m644 $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE)
> +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 v2] u-boot: generate environment image
  2019-11-15 13:59 ` Michael Olbrich
@ 2019-11-18  8:43   ` Denis OSTERLAND
  2019-11-18 12:25     ` Bruno Thomsen
  0 siblings, 1 reply; 5+ messages in thread
From: Denis OSTERLAND @ 2019-11-18  8:43 UTC (permalink / raw)
  To: ptxdist, m.olbrich; +Cc: ada, bruno.thomsen, bth

Hi,

Am Freitag, den 15.11.2019, 14:59 +0100 schrieb Michael Olbrich:
> On Wed, Nov 13, 2019 at 06:05:59PM +0100, Bruno Thomsen wrote:
...
> >  
> > +menuconfig U_BOOT_GENERATE_ENV_IMAGE
> > +	bool
> > +	prompt "Generate environment image  "
> > +
> > +if U_BOOT_GENERATE_ENV_IMAGE
> > +
> > +config U_BOOT_DEFAULT_ENV_IMAGE
> > +	prompt "Generate default environment image"
> > +	bool
> > +	help
> > +	  Use U-Boot's mkenvimage to compile a default U-Boot environment
> > +	  image for use in e.g. device manufacturing or development.
> > +
> > +config U_BOOT_DEFAULT_ENV_IMAGE_FILE
> > +	prompt "Default environment image filename"
> > +	string
> > +	default "u-boot-env.img"
> > +	help
> > +	  Change default environment output image name.
> 
> Why the custom name? It's just the filename in images/ and it can be
> changed wenn it's added to an image, if that's necessary.
> If it's important, then the option should depend on
> U_BOOT_DEFAULT_ENV_IMAGE
> 
> > +
> > +config U_BOOT_CUSTOM_ENV_IMAGE
> > +	prompt "Generate custom environment image"
> > +	bool
> > +	help
> > +	  Use U-Boot's mkenvimage to compile a custom U-Boot environment
> > +	  image based on the text file in U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> > +	  for use in e.g. device manufacturing or development.
> > +
> > +config U_BOOT_CUSTOM_ENV_IMAGE_SOURCE
> > +	prompt "Custom environment source"
> > +	string
> > +	default "custom_env.config"
> > +	help
> > +	  Text file in PTXDIST_WORKSPACE describing the custom environment.
> > +	  The file should have lines in the form var=value, one per line.
> > +	  Blank lines and lines starting with a # are ignored.
> > +
> > +config U_BOOT_CUSTOM_ENV_IMAGE_FILE
> > +	prompt "Custom environment image filename"
> > +	string
> > +	default "u-boot-custom-env.img"
> > +	help
> > +	  Change custom environment output image name.
> 
> Denis, I think you were asking for a selectable input file, not generating
> multiple env images?
correct.
I see no reason to have both files, or to specify the output file name.
My suggestion was to give a filename or generate it via get_default_envs.sh if none given.
If you want to be more explicit, I would prefer a choice between default and custom,
where the filename depends on the custom selected.

Regards Denis

> 
> And the same issue as above, if this stays: do we need to custom output
> filename and hide the suboptions with 'depends'.
> 
> Michael
> 
> > +
> > +comment "common options   ---"
> > +
> > +config U_BOOT_ENV_IMAGE_SIZE
> > +	prompt "Environment image size"
> > +	string
> > +	default "0x2000"
> > +	help
> > +	  Enter the U-Boot environment size for generation of 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_ENV_IMAGE_REDUNDANT
> > +	prompt "Environment image with redundant copy"
> > +	bool
> > +	help
> > +	  Use to generate a redundant environment in the 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..c3c426d6d 100644
> > --- a/rules/u-boot.make
> > +++ b/rules/u-boot.make
> > @@ -94,6 +94,20 @@ 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 | \
> > +		$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> > +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> > +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> > +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) -
> > +endif
> > +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> > +	$(U_BOOT_DIR)/tools/mkenvimage -p 0x0 \
> > +		$(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \
> > +		-s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \
> > +		-o $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> > +		$(PTXDIST_WORKSPACE)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_SOURCE)
> >  endif
> >  	@$(call touch)
> >  
> > @@ -141,6 +155,14 @@ 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)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE) \
> > +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE_FILE)
> > +endif
> > +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE
> > +	@install -v -D -m644 $(U_BOOT_DIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE) \
> > +		$(IMAGEDIR)/$(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_FILE)
> > +endif
> >  
> >  ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
> >  	@$(call install_init, u-boot)
> > -- 
> > 2.23.0
> > 
> > 
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
> > 
> 
> 


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 v2] u-boot: generate environment image
  2019-11-18  8:43   ` Denis OSTERLAND
@ 2019-11-18 12:25     ` Bruno Thomsen
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Thomsen @ 2019-11-18 12:25 UTC (permalink / raw)
  To: Denis OSTERLAND; +Cc: ada, m.olbrich, ptxdist, bth

Hi

Den man. 18. nov. 2019 kl. 09.43 skrev Denis OSTERLAND
<denis.osterland@diehl.com>:
>
> Hi,
>
> Am Freitag, den 15.11.2019, 14:59 +0100 schrieb Michael Olbrich:
> > On Wed, Nov 13, 2019 at 06:05:59PM +0100, Bruno Thomsen wrote:
> ...
> > > +config U_BOOT_DEFAULT_ENV_IMAGE_FILE
> > > +   prompt "Default environment image filename"
> > > +   string
> > > +   default "u-boot-env.img"
> > > +   help
> > > +     Change default environment output image name.
> >
> > Why the custom name? It's just the filename in images/ and it can be
> > changed wenn it's added to an image, if that's necessary.
> > If it's important, then the option should depend on
> > U_BOOT_DEFAULT_ENV_IMAGE

So it's easier to tell what environment image you flashing.

We use the image directly from images/ and does not create a
combined device image, but will remove both image names in
next version.

> > Denis, I think you were asking for a selectable input file, not generating
> > multiple env images?
> correct.
> I see no reason to have both files, or to specify the output file name.
> My suggestion was to give a filename or generate it via get_default_envs.sh if none given.
> If you want to be more explicit, I would prefer a choice between default and custom,
> where the filename depends on the custom selected.

I just overdid the function and will revert it to a simple choice between
none, default and custom.

> > And the same issue as above, if this stays: do we need to custom output
> > filename and hide the suboptions with 'depends'.

Will hide custom source file when choice is none or default.

/Bruno

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 17:05 [ptxdist] [PATCH v2] u-boot: generate environment image Bruno Thomsen
2019-11-13 19:02 ` Alexander Dahl
2019-11-15 13:59 ` Michael Olbrich
2019-11-18  8:43   ` Denis OSTERLAND
2019-11-18 12:25     ` Bruno Thomsen

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