All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Heiko Thiery <heiko.thiery@gmail.com>
Cc: Michael Walle <michael@walle.cc>,
	Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2] Add BR2_ROOTFS_POST_{PRE_BUILD|POST_BUILD|FAKEROOT|IMAGE}_SCRIPT_ARGS
Date: Thu, 28 Mar 2024 21:50:54 +0100	[thread overview]
Message-ID: <ZgXYLsp66NNKB6Aq@landeda> (raw)
In-Reply-To: <20240328140919.157664-1-heiko.thiery@gmail.com>

Heiko, All,

On 2024-03-28 15:09 +0100, Heiko Thiery spake thusly:
> You only can specify one list of arguments that are passed to several
> scripts (BR2_ROOTFS_PRE_BUILD_SCRIPT, BR2_ROOTFS_POST_BUILD_SCRIPT,
> BR2_ROOTFS_POST_FAKEROOT_SCRIPT and BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS).
> 
> So you have to be careful that the arguments for these scripts do not collide.
> 
> To allow specifiying dedicated arguments to each of the script the new
> config options are introduced. For backward compatibility the value of
> BR2_ROOTFS_POST_SCRIPT_ARGS is still passed to the scripts. But now you
> can add specfic arguments from the new config option.
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
[--SNIP--]
> diff --git a/Makefile b/Makefile
> index 91973cca60..a7d9f9149c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -584,7 +584,9 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
>  prepare: $(BUILD_DIR)/buildroot-config/auto.conf
>  	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_PRE_BUILD_SCRIPT)), \
>  		$(call MESSAGE,"Executing pre-build script $(s)"); \
> -		$(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
> +		$(EXTRA_ENV) $(s) $(TARGET_DIR) \
> +		$(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS)) \
> +		$(call qstrip,$(BR2_ROOTFS_PRE_BUILD_SCRIPT_ARGS))$(sep))

I've rewrapped this in a more common way:

    $(EXTRA_ENV) $(s) \
        $(TARGET_DIR) \
        $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS)) \
        $(call qstrip,$(BR2_ROOTFS_PRE_BUILD_SCRIPT_ARGS))

>  .PHONY: world
>  world: target-post-image
> @@ -801,7 +803,9 @@ endif # merged /usr
> 
>  	$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
>  		@$(call MESSAGE,"Executing post-build script $(s)")$(sep) \
> -		$(Q)$(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
> +		$(Q)$(EXTRA_ENV) $(s) $(TARGET_DIR) \
> +		$(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS)) \
> +		$(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT_ARGS))$(sep))

Ditto.

>  	touch $(TARGET_DIR)/usr
> 
> @@ -819,7 +823,9 @@ target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
>  	$(Q)mkdir -p $(BINARIES_DIR)
>  	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
>  		$(call MESSAGE,"Executing post-image script $(s)"); \
> -		$(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
> +		$(EXTRA_ENV) $(s) $(BINARIES_DIR) \
> +		$(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS)) \
> +		$(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS))$(sep))

Ditto.

[--SNIP--]
> diff --git a/fs/common.mk b/fs/common.mk
> index 37eafac4f7..2f3f8bcc7e 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -182,7 +182,7 @@ $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): $$(ROOTFS_$(2)_DEPENDENCIES)
>  		$$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep))
>  	$$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\
>  		echo "echo '$$(TERM_BOLD)>>>   Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \
> -		echo $$(EXTRA_ENV) $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep))
> +		echo $$(EXTRA_ENV) $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) $$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep))

But not here.

[--SNIP--]
> +config BR2_ROOTFS_PRE_BUILD_SCRIPT_ARGS
> +	string "Extra arguments passed to BR2_ROOTFS_PRE_BUILD_SCRIPT"
> +	depends on BR2_ROOTFS_PRE_BUILD_SCRIPT != ""
> +	help
> +	  Pass these additional arguments to the pre-build script.
> +
> +	  Note also, as stated in the respective help text, that the
> +	  first argument to each script is the target directory.
> +	  The arguments in this option will be passed *after* those.

I fixed those help texts to also mention that common args are passed,
and thus the specific args are passed after.

Applied to master, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-03-28 20:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 14:09 [Buildroot] [PATCH v2] Add BR2_ROOTFS_POST_{PRE_BUILD|POST_BUILD|FAKEROOT|IMAGE}_SCRIPT_ARGS Heiko Thiery
2024-03-28 20:50 ` Yann E. MORIN [this message]
2024-03-28 20:53 ` Yann E. MORIN

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=ZgXYLsp66NNKB6Aq@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=heiko.thiery@gmail.com \
    --cc=michael@walle.cc \
    --cc=thomas.de_schampheleire@nokia.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.