From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmBE6-0000mK-Rq for ptxdist@pengutronix.de; Fri, 19 Jun 2020 09:14:14 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jmBE6-0006Hx-Id for ptxdist@pengutronix.de; Fri, 19 Jun 2020 09:14:14 +0200 Date: Fri, 19 Jun 2020 09:14:14 +0200 From: Marco Felsch Message-ID: <20200619071414.5seijd5wwi3sjwln@pengutronix.de> References: <20200615225618.30871-1-m.felsch@pengutronix.de> <20200619060505.GH9312@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200619060505.GH9312@pengutronix.de> Subject: Re: [ptxdist] [PATCH] barebox: add option to specify barebox image patterns List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On 20-06-19 08:05, Michael Olbrich 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 > > --- > > 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. > > Why comma seperated? Just use a space seperated list and avoid the > substitutions below. Good point, I tought the DTS are also comma seperated, but they are space seperated.. *Damn* I will change this and send a v2. Regards, Marco > Michael > > > + > > 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 | > -- 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