mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2 1/2] barebox: Simplify/cleanup barebox image installations.
@ 2022-06-09 21:33 Christian Melki
  2022-06-09 21:33 ` [ptxdist] [PATCH v2 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
  2022-06-20  6:19 ` [ptxdist] [APPLIED] barebox: Simplify/cleanup barebox image installations Michael Olbrich
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Melki @ 2022-06-09 21:33 UTC (permalink / raw)
  To: ptxdist

Barebox has been carrying a descriptive barebox-flash-images file
for a while now.
This file contains the generated image files.
So instead of searching for images, let barebox tell us.

Also remove some legacy image and environment handling.
This means that only Barebox >= 2015.12 is supported.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/barebox.make | 35 ++++++++++-------------------------
 1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/rules/barebox.make b/rules/barebox.make
index 753a47b59..e2ad43893 100644
--- a/rules/barebox.make
+++ b/rules/barebox.make
@@ -179,31 +179,16 @@ ifneq ($(strip $(BAREBOX_PROGS_TARGET_y)),)
 endif
 
 	@$(call world/image-clean, BAREBOX)
-	@if [ -d $(BAREBOX_BUILD_DIR)/images ]; then \
-		find $(BAREBOX_BUILD_DIR)/images/ -name "barebox-*.img" | sort | while read image; do \
-			$(call ptx/image-install, BAREBOX, $$image); \
-			if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
-				$(call ptx/image-install-link, BAREBOX, `basename $$image`, barebox-image); \
-			fi; \
-		done; \
-	fi
-	@if [ -e $(IMAGEDIR)/barebox-image ]; then \
-		:; \
-	elif [ -e $(BAREBOX_BUILD_DIR)/barebox-flash-image ]; then \
-		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox-flash-image, barebox-image); \
-	else \
-		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox.bin, barebox-image); \
-	fi
-	@if [ -e $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env ]; then \
-		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
-			barebox-default-environment); \
-	elif [ -e $(BAREBOX_BUILD_DIR)/common/barebox_default_env ]; then \
-		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/common/barebox_default_env, \
-			barebox-default-environment); \
-	elif [ -e $(BAREBOX_BUILD_DIR)/barebox_default_env ]; then \
-		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox_default_env, \
-			barebox-default-environment); \
-	fi
+
+	@$(foreach image, $(shell cat $(BAREBOX_BUILD_DIR)/barebox-flash-images), \
+		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/$(image))$(ptx/nl) \
+		if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
+			$(call ptx/image-install-link, BAREBOX, $(notdir $(image)), barebox-image); \
+		fi$(ptx/nl))
+
+	@$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
+		barebox-default-environment)
+
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
-- 
2.34.1




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

* [ptxdist] [PATCH v2 2/2] barebox: Add option to install barebox generated dtbs.
  2022-06-09 21:33 [ptxdist] [PATCH v2 1/2] barebox: Simplify/cleanup barebox image installations Christian Melki
@ 2022-06-09 21:33 ` Christian Melki
  2022-06-20  6:19   ` [ptxdist] [APPLIED] " Michael Olbrich
  2022-06-20  6:19 ` [ptxdist] [APPLIED] barebox: Simplify/cleanup barebox image installations Michael Olbrich
  1 sibling, 1 reply; 4+ messages in thread
From: Christian Melki @ 2022-06-09 21:33 UTC (permalink / raw)
  To: ptxdist

Sometimes it's useful to be able to include the barebox-
generated dtb. An example would be the FIP image target
for TF-A and stm32mp1 targets.

Prefix the barebox-installed dtbs with "barebox-" as they can
have the same name as kernel dtbs for example.

This can partly go away if/when barebox decides to promote
dtbs to the barebox-flash-images file.
Although one would probably still want to rename the dtbs
to avoid a name collision.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 platforms/barebox.in | 8 ++++++++
 rules/barebox.make   | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/platforms/barebox.in b/platforms/barebox.in
index c8192f0c9..2a89df074 100644
--- a/platforms/barebox.in
+++ b/platforms/barebox.in
@@ -89,6 +89,14 @@ config BAREBOX_BAREBOXENV
 	  environment. Enable this option to access the barebox environment
 	  from the target Linux system.
 
+config BAREBOX_INSTALL_DTBS
+       prompt "install dtbs"
+       bool
+       help
+         Install barebox generated dtbs into the image directory.
+	 These dtbs can, for example, be used when constructing a
+	 FIP image for TF-A boot.
+
 config BAREBOX_BAREBOXCRC32
 	prompt "install 'bareboxcrc32'"
 	bool
diff --git a/rules/barebox.make b/rules/barebox.make
index e2ad43893..adab3c4fe 100644
--- a/rules/barebox.make
+++ b/rules/barebox.make
@@ -180,6 +180,11 @@ endif
 
 	@$(call world/image-clean, BAREBOX)
 
+ifdef PTXCONF_BAREBOX_INSTALL_DTBS
+	@$(foreach dtb, $(shell find $(BAREBOX_BUILD_DIR) -name "*.dtb"), \
+		$(call ptx/image-install, BAREBOX, $(dtb), barebox-$(notdir $(dtb)))$(ptx/nl))
+endif
+
 	@$(foreach image, $(shell cat $(BAREBOX_BUILD_DIR)/barebox-flash-images), \
 		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/$(image))$(ptx/nl) \
 		if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
-- 
2.34.1




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

* Re: [ptxdist] [APPLIED] barebox: Simplify/cleanup barebox image installations.
  2022-06-09 21:33 [ptxdist] [PATCH v2 1/2] barebox: Simplify/cleanup barebox image installations Christian Melki
  2022-06-09 21:33 ` [ptxdist] [PATCH v2 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
@ 2022-06-20  6:19 ` Michael Olbrich
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2022-06-20  6:19 UTC (permalink / raw)
  To: ptxdist; +Cc: Christian Melki

Thanks, applied as 4241dc8dc7bb69dce11a95b92ce835373f008759.

Michael

[sent from post-receive hook]

On Mon, 20 Jun 2022 08:19:22 +0200, Christian Melki <christian.melki@t2data.com> wrote:
> Barebox has been carrying a descriptive barebox-flash-images file
> for a while now.
> This file contains the generated image files.
> So instead of searching for images, let barebox tell us.
> 
> Also remove some legacy image and environment handling.
> This means that only Barebox >= 2015.12 is supported.
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> Message-Id: <20220609213328.3913523-1-christian.melki@t2data.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/barebox.make b/rules/barebox.make
> index 753a47b595f0..e2ad43893a0e 100644
> --- a/rules/barebox.make
> +++ b/rules/barebox.make
> @@ -179,31 +179,16 @@ ifneq ($(strip $(BAREBOX_PROGS_TARGET_y)),)
>  endif
>  
>  	@$(call world/image-clean, BAREBOX)
> -	@if [ -d $(BAREBOX_BUILD_DIR)/images ]; then \
> -		find $(BAREBOX_BUILD_DIR)/images/ -name "barebox-*.img" | sort | while read image; do \
> -			$(call ptx/image-install, BAREBOX, $$image); \
> -			if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
> -				$(call ptx/image-install-link, BAREBOX, `basename $$image`, barebox-image); \
> -			fi; \
> -		done; \
> -	fi
> -	@if [ -e $(IMAGEDIR)/barebox-image ]; then \
> -		:; \
> -	elif [ -e $(BAREBOX_BUILD_DIR)/barebox-flash-image ]; then \
> -		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox-flash-image, barebox-image); \
> -	else \
> -		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox.bin, barebox-image); \
> -	fi
> -	@if [ -e $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env ]; then \
> -		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
> -			barebox-default-environment); \
> -	elif [ -e $(BAREBOX_BUILD_DIR)/common/barebox_default_env ]; then \
> -		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/common/barebox_default_env, \
> -			barebox-default-environment); \
> -	elif [ -e $(BAREBOX_BUILD_DIR)/barebox_default_env ]; then \
> -		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/barebox_default_env, \
> -			barebox-default-environment); \
> -	fi
> +
> +	@$(foreach image, $(shell cat $(BAREBOX_BUILD_DIR)/barebox-flash-images), \
> +		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/$(image))$(ptx/nl) \
> +		if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
> +			$(call ptx/image-install-link, BAREBOX, $(notdir $(image)), barebox-image); \
> +		fi$(ptx/nl))
> +
> +	@$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
> +		barebox-default-environment)
> +
>  	@$(call touch)
>  
>  # ----------------------------------------------------------------------------



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

* Re: [ptxdist] [APPLIED] barebox: Add option to install barebox generated dtbs.
  2022-06-09 21:33 ` [ptxdist] [PATCH v2 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
@ 2022-06-20  6:19   ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2022-06-20  6:19 UTC (permalink / raw)
  To: ptxdist; +Cc: Christian Melki

Thanks, applied as 53496a7c76a116c9b2bf05796d0b6872e5a85e7d.

Michael

[sent from post-receive hook]

On Mon, 20 Jun 2022 08:19:24 +0200, Christian Melki <christian.melki@t2data.com> wrote:
> Sometimes it's useful to be able to include the barebox-
> generated dtb. An example would be the FIP image target
> for TF-A and stm32mp1 targets.
> 
> Prefix the barebox-installed dtbs with "barebox-" as they can
> have the same name as kernel dtbs for example.
> 
> This can partly go away if/when barebox decides to promote
> dtbs to the barebox-flash-images file.
> Although one would probably still want to rename the dtbs
> to avoid a name collision.
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> Message-Id: <20220609213328.3913523-2-christian.melki@t2data.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/platforms/barebox.in b/platforms/barebox.in
> index c8192f0c90e3..2a89df074011 100644
> --- a/platforms/barebox.in
> +++ b/platforms/barebox.in
> @@ -89,6 +89,14 @@ config BAREBOX_BAREBOXENV
>  	  environment. Enable this option to access the barebox environment
>  	  from the target Linux system.
>  
> +config BAREBOX_INSTALL_DTBS
> +       prompt "install dtbs"
> +       bool
> +       help
> +         Install barebox generated dtbs into the image directory.
> +	 These dtbs can, for example, be used when constructing a
> +	 FIP image for TF-A boot.
> +
>  config BAREBOX_BAREBOXCRC32
>  	prompt "install 'bareboxcrc32'"
>  	bool
> diff --git a/rules/barebox.make b/rules/barebox.make
> index e2ad43893a0e..adab3c4fe210 100644
> --- a/rules/barebox.make
> +++ b/rules/barebox.make
> @@ -180,6 +180,11 @@ endif
>  
>  	@$(call world/image-clean, BAREBOX)
>  
> +ifdef PTXCONF_BAREBOX_INSTALL_DTBS
> +	@$(foreach dtb, $(shell find $(BAREBOX_BUILD_DIR) -name "*.dtb"), \
> +		$(call ptx/image-install, BAREBOX, $(dtb), barebox-$(notdir $(dtb)))$(ptx/nl))
> +endif
> +
>  	@$(foreach image, $(shell cat $(BAREBOX_BUILD_DIR)/barebox-flash-images), \
>  		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/$(image))$(ptx/nl) \
>  		if [ ! -e $(IMAGEDIR)/barebox-image ]; then \



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

end of thread, other threads:[~2022-06-20  6:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 21:33 [ptxdist] [PATCH v2 1/2] barebox: Simplify/cleanup barebox image installations Christian Melki
2022-06-09 21:33 ` [ptxdist] [PATCH v2 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
2022-06-20  6:19   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-06-20  6:19 ` [ptxdist] [APPLIED] barebox: Simplify/cleanup barebox image installations Michael Olbrich

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