Skip to contentSkip to conversation

systemd: check SERIAL_CONSOLES for serial-getty-generator PACKAGECONFIG

PATCH In review [email protected] 2 participants 4 messages Mar 13, 2025 – Mar 19, 2025 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: check SERIAL_CONSOLES for serial-getty-generator PACKAGECONFIG

From: Chen Qi <[email protected]>

If SERIAL_CONSOLES is empty, then systemd-serialgetty recipe does basically nothing, and making systemd RDEPENDS on it does not help.

So a better default behavior is that if SERIAL_CONSOLES is empty, then we put serial-getty-generator in PACKAGECONFIG which let systemd to generate corresponding service instances.

---
 meta/recipes-core/systemd/systemd_257.3.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_257.3.bb +1 -0
index 64fb8fe69a..f1f6055637 100644
@@ -92,6 +92,7 @@ PACKAGECONFIG ??= " \
     quotacheck \
     randomseed \
     resolved \
+    ${@'' if d.getVar('SERIAL_CONSOLES') else 'serial-getty-generator'} \
     set-time-epoch \
     sysusers \
     timedated \
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Chen Qi via lists.openembedded.org

So a better default behavior is that if SERIAL_CONSOLES is empty, then we put serial-getty-generator in PACKAGECONFIG which let systemd to generate corresponding service instances.

Whilst this seems like a good idea, it would also make the systemd recipe machine-specific. Considering systemd provides libsystemd and libudev, this is not a good idea.

Ross

author
#2 lore raw

Hi Ross,

Let me provide some background of the problem I was trying to solve here.
Some BSP layers don't set SERIAL_CONSOLES, and they have worked for a long time with previous systemd. Now systemd-getty-generator is deleted by default, and they don't get any serial console.

How about using the following solution:
Do not delete anything when serial-getty-generator is in PACKAGECONFIG.

I suspect deleting systemd-getty-generator will have potential negative impact on [email protected]. I'm not sure though.

Regards,
Qi

-----Original Message-----
From: Ross Burton <[email protected]>
Sent: Tuesday, March 18, 2025 1:47 AM
To: Chen, Qi <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH] systemd: check SERIAL_CONSOLES for serial-getty-generator PACKAGECONFIG

Quoted 3 lines · Chen Qi via lists.openembedded.org

So a better default behavior is that if SERIAL_CONSOLES is empty, then we put serial-getty-generator in PACKAGECONFIG which let systemd to generate corresponding service instances.

Whilst this seems like a good idea, it would also make the systemd recipe machine-specific. Considering systemd provides libsystemd and libudev, this is not a good idea.

Ross

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 9 lines · Chen Qi via lists.openembedded.org

Hi Ross,

Let me provide some background of the problem I was trying to solve here.
Some BSP layers don't set SERIAL_CONSOLES, and they have worked for a long time with previous systemd. Now systemd-getty-generator is deleted by default, and they don't get any serial console.

How about using the following solution:
Do not delete anything when serial-getty-generator is in PACKAGECONFIG.

I suspect deleting systemd-getty-generator will have potential negative impact [email protected]. I'm not sure though.

OK. I just checked. According to https://www.freedesktop.org/software/systemd/man/latest/systemd-getty-generator.html, this affects |[email protected]|, |console-getty.service and ||[email protected]. |

Anyway, I'll send out V2 using the above solution.

Please help review when convenient.

Regards,
Qi

Quoted 26 lines

Regards,
Qi

-----Original Message-----
From: Ross Burton<[email protected]> Sent: Tuesday, March 18, 2025 1:47 AM
To: Chen, Qi<[email protected]>
Cc:[email protected]
Subject: Re: [OE-core][PATCH] systemd: check SERIAL_CONSOLES for serial-getty-generator PACKAGECONFIG

Quoted 3 lines · Chen Qi via lists.openembedded.org

So a better default behavior is that if SERIAL_CONSOLES is empty, then we put serial-getty-generator in PACKAGECONFIG which let systemd to generate corresponding service instances.

Whilst this seems like a good idea, it would also make the systemd recipe machine-specific. Considering systemd provides libsystemd and libudev, this is not a good idea.

Ross

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#213133):https://lists.openembedded.org/g/openembedded-core/message/213133 Mute This Topic:https://lists.openembedded.org/mt/111674751/3618072
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-