Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v5 03/13] package/systemd: fix tty handling
Date: Sat, 16 May 2020 16:28:49 +0200	[thread overview]
Message-ID: <20200516162849.5df96b0d@windsurf.home> (raw)
In-Reply-To: <20191216103052.35220-4-jeremy.rosen@smile.fr>

Hello J?r?my,

On Mon, 16 Dec 2019 11:30:42 +0100
J?r?my Rosen <jeremy.rosen@smile.fr> wrote:

> +# systemd defaults to only have getty at tty.service enabled
> +# * DefaultInstance=tty1 in getty at service
> +# * no DefaultInstance in serial-getty at .service
> +# * WantedBy=getty.target in console-getty.service
> +# * console-getty is not enabled because of 90-systemd.preset
> +# We want "systemctl preset-all" to do the right thing, even when run on the target after boot
> +# * remove the default instance of getty at .service via a drop-in in /usr/lib
> +# * set a new DefaultInstance for getty at .service instead, if needed
> +# * set a new DefaultInstance for serial-getty at .service, if needed
> +# * override the systemd-provided preset for console-getty.service if needed
>  define SYSTEMD_INSTALL_SERVICE_TTY
> +	mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d;\
> +	printf '[Install]\nDefaultInstance=\n' > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
>  	if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
>  	then \
>  		TARGET="console-getty.service"; \
> -		LINK_NAME="console-getty.service"; \
> +		printf 'enable console-getty.service\n' > $(TARGET_DIR)/usr/lib/systemd/system-preset/81-buildroot-tty.preset;\
>  	elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
>  	then \
>  		TARGET="getty at .service"; \
> -		LINK_NAME="getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> +		printf '[Install]\nDefaultInstance=%s\n' $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) > $(TARGET_DIR)/usr/lib/systemd/system/getty at .service.d/buildroot-console.conf;\
>  	else \
>  		TARGET="serial-getty at .service"; \
> -		LINK_NAME="serial-getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
> +		mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d;\
> +		printf '[Install]\nDefaultInstance=%s\n' $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) > $(TARGET_DIR)/usr/lib/systemd/system/serial-getty at .service.d/buildroot-console.conf;\
>  	fi; \
> -	mkdir -p $(TARGET_DIR)/etc/systemd/system/getty.target.wants/; \
> -	ln -fs ../../../../lib/systemd/system/$${TARGET} \
> -		$(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${LINK_NAME}; \

I am not sure exactly if it is this change causing the issue, but there
is an issue in this code. See the bug report at:

  https://bugs.busybox.net/show_bug.cgi?id=12786

I must say now that I read the comment on top of this code, I don't
understand at all what is being explained. Could you give a bit more
details about what we are trying to do here, and hopefully help resolve
bug 12786 ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-05-16 14:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 10:30 [Buildroot] [PATCH v5 00/13] use host-systemd to enable units Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 01/13] package/systemd: add host variant Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 02/13] package/systemd: use host-systemctl preset all to enable units Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 03/13] package/systemd: fix tty handling Jérémy Rosen
2020-05-16 14:28   ` Thomas Petazzoni [this message]
2020-05-18  7:12     ` Jérémy ROSEN
2020-05-22 17:00       ` Jérémy ROSEN
2019-12-16 10:30 ` [Buildroot] [PATCH v5 04/13] package: rely on systemctl preset-all for buildroot-provided services Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 05/13] package: rely on systemctl preset-all for upstream-provided services Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 06/13] package/connman: adapt to systemctl preset-all Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 07/13] package/linuxptp " Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 08/13] package/network-manager: " Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 09/13] package/wpa_supplicant: " Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 10/13] package/sysrepo: " Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 11/13] package/syslog-ng: implement systemd enablement using DefaultInstance Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 12/13] package/rauc: add a WantedBy section to the systemd unit file Jérémy Rosen
2019-12-16 10:30 ` [Buildroot] [PATCH v5 13/13] package/alsa-utils: " Jérémy Rosen
2019-12-18 17:48 ` [Buildroot] [PATCH v5 00/13] use host-systemd to enable units Yann E. MORIN
2019-12-19 13:50   ` Jérémy ROSEN
2019-12-19 16:50     ` 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=20200516162849.5df96b0d@windsurf.home \
    --to=thomas.petazzoni@bootlin.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