Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] system: move system.mk recipes inside the "target-finalize" rule
Date: Tue, 10 Jun 2014 22:33:58 +0200	[thread overview]
Message-ID: <20140610223358.69a70e6e@free-electrons.com> (raw)
In-Reply-To: <1402390367-25418-1-git-send-email-fabio.porcedda@gmail.com>

Dear Fabio Porcedda,

On Tue, 10 Jun 2014 10:52:47 +0200, Fabio Porcedda wrote:

>  target-finalize: $(TARGETS)
>  	@$(call MESSAGE,"Finalizing target directory")
> +	$(TARGET_FINALIZE_GENERIC_SECURETTY)
> +	$(TARGET_FINALIZE_GENERIC_HOSTNAME)
> +	$(TARGET_FINALIZE_GENERIC_ISSUE)
> +	$(TARGET_FINALIZE_ROOT_PASSWD)
> +	$(TARGET_FINALIZE_GENERIC_GETTY)
> +	$(TARGET_FINALIZE_GENERIC_REMOUNT_RW)

I agree with the principle, but I'd like to have a better
implementation, which is really long overdue to stop cluttering
target-finalize with more and more crap. Could we implement
target-finalize as just:

target-finalize: $(TARGETS)
	$(foreach hook,$(TARGET_FINALIZE_HOOKS),$(call $(hook),end,$(1),$($(PKG)_NAME))$(sep))

And then:

> +ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> +define TARGET_FINALIZE_GENERIC_SECURETTY
>  	grep -q '^$(TARGET_GENERIC_GETTY_PORT)$$' $(TARGET_DIR)/etc/securetty || \
>  		echo '$(TARGET_GENERIC_GETTY_PORT)' >> $(TARGET_DIR)/etc/securetty
> +endef

TARGET_FINALIZE_HOOKS += TARGET_FINALIZE_GENERIC_SECURETTY

Then we can also use this to move the Python, Perl and other
package-specific target-finalize logic down to the specific packages.
Of course, I'm not asking you to do all of this work. But at least,
post a patch introducing the TARGET_FINALIZE_HOOKS, and use it for
those targets you were converting in your original patch.

We should go towards *removing* stuff from the main Makefile, not
adding more :-)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-06-10 20:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10  8:52 [Buildroot] [PATCH] system: move system.mk recipes inside the "target-finalize" rule Fabio Porcedda
2014-06-10 20:33 ` Thomas Petazzoni [this message]
2014-06-11  9:14   ` Fabio Porcedda
2014-06-11  9:18     ` Thomas Petazzoni
2014-06-11  9:21       ` Fabio Porcedda
2014-06-11 12:54         ` Thomas Petazzoni
2014-06-11 16:32     ` Arnout Vandecappelle
2014-06-11 17:36       ` Thomas Petazzoni
2014-06-12  7:20       ` Fabio Porcedda
2014-06-12  7:32         ` Fabio Porcedda
2014-06-12  7:56           ` Thomas Petazzoni
2014-06-12  8:05             ` Fabio Porcedda
2014-06-12  8:23               ` Thomas Petazzoni
2014-06-12 12:54                 ` Arnout Vandecappelle
2014-06-19 10:06                   ` Fabio Porcedda

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=20140610223358.69a70e6e@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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