From: ChenQi <Qi.Chen@windriver.com>
To: Ross Burton <Ross.Burton@arm.com>
Cc: "openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][PATCH V2] systemd: do not delete systemd-getty-generator
Date: Wed, 26 Mar 2025 10:55:55 +0800 [thread overview]
Message-ID: <28081747-e0d8-4913-9b52-01a0b02aec74@windriver.com> (raw)
In-Reply-To: <D766D201-766B-42FE-9474-9D09522C00D5@arm.com>
On 3/26/25 01:50, Ross Burton wrote:
> On 19 Mar 2025, at 06:40, Qi.Chen@windriver.com wrote:
>> Some BSPs don't set SERIAL_CONSOLES. They need systemd-getty-generator[1]
>> be there to work. This generator has been there for a few previous
>> releases, we don't see any problem it brings up. So let's keep it.
> This is a wonderfully convoluted and not-by-design situation. Looking at eg, styhead. The getty generator isn’t enabled by default:
>
> $ bitbake-getvar --value -r systemd PACKAGECONFIG|grep getty || echo not found
> not found
>
> In styhead if the getty generator isn’t enabled then we delete the serial-getty units that the generator would create symlinks to, so the generator can’t work.
>
> if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
> # Provided by a separate recipe
> rm ${D}${systemd_system_unitdir}/serial-getty* -f
> fi
>
> If the generator is disabled then systemd depends on the systemd-serialgetty recipe which creates explicit links for the consoles in SERIAL_CONSOLES. This recipe in styhead also ships a serial-getty@.service unit template, but the package should be empty if SERIAL_CONSOLES isn’t set. However, the recipe itself has a default value (SERIAL_CONSOLES ?= "115200;ttyS0”) which provides a value if the BSP doesn’t set it, so the unit files do get installed after all.
>
> I think that your setup potentially doesn’t actually use the getty generator at all, but the bad default of ttyS0 from the systemd-serialgetty recipe. This no longer exists as the recipe doesn’t set its own default anymore (as, I believe, is correct).
>
> Can you have a look at your actual use case? I wouldn’t be surprised if it’s actually just using ttyS0 from the configuration, and the BSP could just set that.
The BSP is using the generator. See output below:
root@xilinx-zynqmp:~# ls -l /run/systemd/generator/getty.target.wants/*
lrwxrwxrwx 1 root root 41 Mar 28 01:00
/run/systemd/generator/getty.target.wants/serial-getty@ttyPS0.service ->
/lib/systemd/system/serial-getty@.service
root@xilinx-zynqmp:~#
I think the generator took effect for previous releases because, as you
said, the systemd-serialgetty@.service template was always installed (by
a lucky mistake that you've now fixed) and the systemd-getty-generator
was always installed.
Now, in master branch, this template is always installed too. But we'll
also need the systemd-getty-generator to be there to do autodetection
for some BSPs.
Regards,
Qi
>
> In the medium term I really do want to propose switching from SERIAL_CONSOLES to auto-detection by default, but this involves making the same thing idea on sysvinit which is more involved. I _almost_ have it working, but it didn’t get working in time for M3.
>
> Ross
next prev parent reply other threads:[~2025-03-26 2:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 6:40 [OE-core][PATCH V2] systemd: do not delete systemd-getty-generator Qi.Chen
2025-03-25 17:50 ` Ross Burton
2025-03-26 2:55 ` ChenQi [this message]
[not found] ` <18303ADA6731991F.6378@lists.openembedded.org>
2025-04-02 5:14 ` ChenQi
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=28081747-e0d8-4913-9b52-01a0b02aec74@windriver.com \
--to=qi.chen@windriver.com \
--cc=Ross.Burton@arm.com \
--cc=openembedded-core@lists.openembedded.org \
/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.