mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: Re: [ptxdist] [PATCH] barebox: add option to specify barebox image patterns
Date: Tue, 16 Jun 2020 15:30:33 +0200	[thread overview]
Message-ID: <20200616133033.flgocibzdgpv5ato@pengutronix.de> (raw)
In-Reply-To: <6e7c92f8-9949-8da3-f814-ce57e1e59e47@pengutronix.de>

Hi Bastian, Roland,

thanks for the quick response and comments :)

On 20-06-16 10:34, Bastian Krause wrote:
> 
> On 6/16/20 10:02 AM, Roland Hieber wrote:
> > On Tue, Jun 16, 2020 at 12:56:18AM +0200, Marco Felsch wrote:
> >> Allow users to specify other barebox image naming schemes. Now users can
> >> specify a list of:
> >>  - unique image names and/or
> >>  - matching name patterns using wildcards.
> >>
> >> While on it I fixed the leaking image-results upon a 'ptxdist clean
> >> barebox' command. Now all barebox artefacts are removed from the
> >> $(IMAGEDIR).
> >>
> >> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> >> ---
> > 
> > LGTM on first glance, could you do the same for
> > rules/templates/template-barebox-make too please?
> 
> Is this really necessary? The idea of the barebox rule template is to
> generate a BSP specific barebox rule, right? We already have..
> 
> BAREBOX_@PACKAGE@_IMAGES := @image@
> 
> ..in that template, so we don't really benefit from a config option here.

My idea was to _hopefully_ remove the usage of this template and
instead use ptxdist upstream mechanism:
 - layer -> different barebox configs
 - this patch -> different barebox images

Regards,
  Marco

> Regards,
> Bastian
> 
> > 
> >  - Roland
> > 
> >>  platforms/barebox.in |  9 +++++++++
> >>  rules/barebox.make   | 19 +++++++++++++------
> >>  2 files changed, 22 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/platforms/barebox.in b/platforms/barebox.in
> >> index 526d7ede4..b92cf485e 100644
> >> --- a/platforms/barebox.in
> >> +++ b/platforms/barebox.in
> >> @@ -39,6 +39,15 @@ config BAREBOX_CONFIG
> >>  	  This entry specifies the .config file used to compile
> >>  	  barebox.
> >>  
> >> +config BAREBOX_IMAGES
> >> +	prompt "barebox images to install"
> >> +	string
> >> +	default "barebox-*.img"
> >> +	help
> >> +	  A comma seperated list of images which should be installed
> >> +	  into the $(IMAGEDIR). The list can contain full image names
> >> +	  and/or wildcard pattern image names.
> >> +
> >>  config BAREBOX_EXTRA_ENV
> >>  	prompt "extend the builtin barebox environment"
> >>  	bool
> >> diff --git a/rules/barebox.make b/rules/barebox.make
> >> index d1b5fc598..65bb8251e 100644
> >> --- a/rules/barebox.make
> >> +++ b/rules/barebox.make
> >> @@ -148,6 +148,9 @@ $(STATEDIR)/barebox.install:
> >>  # Target-Install
> >>  # ----------------------------------------------------------------------------
> >>  
> >> +BAREBOX_IMAGES_DIR := $(BAREBOX_BUILD_DIR)/images
> >> +BAREBOX_IMAGES := $(strip $(subst $(ptx/def/comma),$(ptx/def/space),$(call remove_quotes, $(PTXCONF_BAREBOX_IMAGES))))
> >> +
> >>  $(STATEDIR)/barebox.targetinstall:
> >>  	@$(call targetinfo)
> >>  
> >> @@ -166,14 +169,15 @@ ifneq ($(strip $(BAREBOX_PROGS_TARGET_y)),)
> >>  endif
> >>  
> >>  	@rm -f $(IMAGEDIR)/barebox-image
> >> -	@if [ -d $(BAREBOX_BUILD_DIR)/images ]; then \
> >> -		find $(BAREBOX_BUILD_DIR)/images/ -name "barebox-*.img" | sort | while read image; do \
> >> -			install -D -m644 $$image $(IMAGEDIR)/`basename $$image`; \
> >> +	@$(foreach _image, $(BAREBOX_IMAGES), \
> >> +		$(foreach image, $(wildcard $(BAREBOX_IMAGES_DIR)/$(_image)), \
> >> +			install -D -m644 $(image) $(IMAGEDIR)/$(notdir $(image)); \
> >>  			if [ ! -e $(IMAGEDIR)/barebox-image ]; then \
> >> -				ln -sf `basename $$image` $(IMAGEDIR)/barebox-image; \
> >> +				ln -sf $(notdir $(image)) $(IMAGEDIR)/barebox-image; \
> >>  			fi; \
> >> -		done; \
> >> -	fi
> >> +		) \
> >> +	)
> >> +
> >>  	@if [ -e $(IMAGEDIR)/barebox-image ]; then \
> >>  		:; \
> >>  	elif [ -e $(BAREBOX_BUILD_DIR)/barebox-flash-image ]; then \
> >> @@ -199,6 +203,9 @@ $(STATEDIR)/barebox.clean:
> >>  	@$(call clean_pkg, BAREBOX)
> >>  	@$(foreach prog, $(BAREBOX_PROGS_HOST), \
> >>  		rm -vf $(PTXDIST_SYSROOT_HOST)/bin/$(notdir $(prog))$(ptx/nl))
> >> +	@$(foreach _image, $(BAREBOX_IMAGES), \
> >> +		$(foreach image, $(wildcard $(IMAGEDIR)/$(_image)), \
> >> +			rm -vf $(image);))
> >>  	@rm -vf $(IMAGEDIR)/barebox-image $(IMAGEDIR)/barebox-default-environment
> >>  
> >>  # ----------------------------------------------------------------------------
> >> -- 
> >> 2.20.1
> >>
> >>
> >> _______________________________________________
> >> ptxdist mailing list
> >> ptxdist@pengutronix.de
> >> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@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
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@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
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

  parent reply	other threads:[~2020-06-16 13:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 22:56 Marco Felsch
2020-06-16  8:02 ` Roland Hieber
2020-06-16  8:20   ` Roland Hieber
2020-06-16  8:34   ` Bastian Krause
2020-06-16  9:07     ` Roland Hieber
2020-06-16 13:30     ` Marco Felsch [this message]
2020-06-16 15:37       ` Roland Hieber
2020-06-19  6:05 ` Michael Olbrich
2020-06-19  7:14   ` Marco Felsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616133033.flgocibzdgpv5ato@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    --cc=rhi@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox