mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] barebox: Simplify/cleanup barebox image installations.
@ 2022-06-07  9:03 Christian Melki
  2022-06-07  9:03 ` [ptxdist] [PATCH 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
  2022-06-09 18:54 ` [ptxdist] [PATCH 1/2] barebox: Simplify/cleanup barebox image installations Michael Olbrich
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Melki @ 2022-06-07  9:03 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..581fd1ff9 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)); \
+		if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
+			$(call ptx/image-install-link, BAREBOX, $(notdir $(image)), barebox-image); \
+		fi; )
+
+	$(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] 3+ messages in thread

end of thread, other threads:[~2022-06-09 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07  9:03 [ptxdist] [PATCH 1/2] barebox: Simplify/cleanup barebox image installations Christian Melki
2022-06-07  9:03 ` [ptxdist] [PATCH 2/2] barebox: Add option to install barebox generated dtbs Christian Melki
2022-06-09 18:54 ` [ptxdist] [PATCH 1/2] 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