mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Make barebox flashable image link for "multi-image" targets
@ 2015-10-20 21:47 Trent Piepho
  2015-10-21  6:01 ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Trent Piepho @ 2015-10-20 21:47 UTC (permalink / raw)
  To: barebox

For a target with multi-image support, no barebox-flash-image link is
made pointing to the finished flashable image.  This makes it hard for
buildroot to figure out which file is the barebox image.  And one has
to assume this link is generally useful and convenient to users of
barebox, or why would it have been created in the first place?

This patch to the multi-image build will create that link.

It only works when a single image is made.  If one is making multiple
images, then the concept of a single finished image no longer applies,
and no link is made.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
---
 images/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/images/Makefile b/images/Makefile
index a5f589b..fcdf404 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -121,10 +121,16 @@ targets += $(foreach m, $(image-y), $(FILE_$(m)))
 
 SECONDARY: $(addprefix $(obj)/,$(targets))
 
-images: $(addprefix $(obj)/, $(image-y)) FORCE
+# Set if there is only one image in image-y
+flash-link := $(if $(filter 1,$(words $(image-y))),$(obj)/../barebox-flash-image)
+
+images: $(addprefix $(obj)/, $(image-y)) $(flash-link) FORCE
 	@echo "images built:"
 	@for i in $(image-y); do echo $$i; done
 
+$(flash-link): $(addprefix $(obj)/, $(image-y)) FORCE
+	$(call if_changed,ln)
+
 clean-files := *.pbl *.pblb *.pblx *.map start_*.imximg *.img barebox.z start_*.kwbimg \
 	start_*.kwbuartimg *.socfpgaimg *.mlo *.t20img *.t20img.cfg *.t30img \
 	*.t30img.cfg *.t124img *.t124img.cfg *.mlospi *.mlo *.mxsbs *.mxssd
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-10-26  6:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20 21:47 [PATCH] Make barebox flashable image link for "multi-image" targets Trent Piepho
2015-10-21  6:01 ` Sascha Hauer
2015-10-21 18:09   ` Trent Piepho
2015-10-22  7:06     ` Sascha Hauer
2015-10-22 18:48       ` Trent Piepho
2015-10-26  6:22         ` Sascha Hauer

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