[Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jul 5 13:41:10 UTC 2016


Hello,

On Wed, 22 Jun 2016 21:07:28 +0200, Yann E. MORIN wrote:

> +define SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
> +	rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> +endef
> +
>  SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
>  	SYSTEMD_INSTALL_INIT_HOOK \
>  	SYSTEMD_INSTALL_MACHINEID_HOOK \
> -	SYSTEMD_INSTALL_RESOLVCONF_HOOK
> +	SYSTEMD_INSTALL_RESOLVCONF_HOOK \
> +	SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
>  
>  define SYSTEMD_USERS
>  	systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
> @@ -228,10 +233,6 @@ define SYSTEMD_USERS
>  	- - input -1 * - - - Input device group
>  endef
>  
> -define SYSTEMD_DISABLE_SERVICE_TTY1
> -	rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> -endef
> -
>  ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
>  # systemd needs getty.service for VTs and serial-getty.service for serial ttys
>  # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
> @@ -252,7 +253,6 @@ endef
>  endif
>  
>  define SYSTEMD_INSTALL_INIT_SYSTEMD
> -	$(SYSTEMD_DISABLE_SERVICE_TTY1)
>  	$(SYSTEMD_INSTALL_SERVICE_TTY)
>  	$(SYSTEMD_INSTALL_SERVICE_NETWORK)
>  	$(SYSTEMD_INSTALL_SERVICE_TIMESYNC)

Doing this change doesn't work if BR2_TARGET_GENERIC_GETTY_PORT is
"tty1". In this case, you will create getty at tty1.service symlink during
<pkg>_INIT_SYSTEMD, and then you will remove it in your post-install
target hook. And you end up with no getty@<foo>.service symbolic link.

So, I've marked this patch as Rejected in patchwork.

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



More information about the buildroot mailing list