[Buildroot] [PATCH] system: move system.mk recipes inside the "target-finalize" rule

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jun 10 20:33:58 UTC 2014


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



More information about the buildroot mailing list