mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Christian Melki <christian.melki@t2data.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH 1/2] barebox: Simplify/cleanup barebox image installations.
Date: Thu, 9 Jun 2022 20:54:05 +0200	[thread overview]
Message-ID: <YqJBzWv0qOZua6I3@pengutronix.de> (raw)
In-Reply-To: <20220607090350.346676-1-christian.melki@t2data.com>

On Tue, Jun 07, 2022 at 11:03:49AM +0200, Christian Melki 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>
> ---
>  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
> +

For some reason I get "make: /usr/bin/bash: Argument list too long" with
this now. Not sure why this didn't happen with the old version. Please do
the following to fix that:

> +	@$(foreach image, $(shell cat $(BAREBOX_BUILD_DIR)/barebox-flash-images), \
> +		$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/$(image)); \

		$(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; )

		fi$(ptx/nl))

This creates multiple lines and the commands are executed separately. This
shortens the argument list and the error is gone.
As a side benefit, errors are no longer ignored.

> +	$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
> +		barebox-default-environment); \

	@$(call ptx/image-install, BAREBOX, $(BAREBOX_BUILD_DIR)/defaultenv/barebox_zero_env, \
		barebox-default-environment)

Michael

> +
>  	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
> -- 
> 2.34.1
> 
> 
> 

-- 
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 |



      parent reply	other threads:[~2022-06-09 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Michael Olbrich [this message]

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=YqJBzWv0qOZua6I3@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=christian.melki@t2data.com \
    --cc=ptxdist@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