* [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG
@ 2026-04-15 8:29 Qi.Chen
2026-04-15 9:35 ` Paul Barker
0 siblings, 1 reply; 5+ messages in thread
From: Qi.Chen @ 2026-04-15 8:29 UTC (permalink / raw)
To: openembedded-core; +Cc: paul, mns
From: Chen Qi <Qi.Chen@windriver.com>
Add a new PACKAGECONFIG to give users the choice of whether to
have /etc/profile.d/80-systemd-osc-context.sh file or not.
This is because the /etc/profile.d/80-systemd-osc-context.sh[1] is setting
PS0 with OSC 3008 standard[2]. If a terminal (e.g., minicom) cannot
deal with this OSC 3008 standard, it will just output the whole contents.
This is quite annoying. See example output below:
3008;start=9c578e41-1a0f-4b47-9a87-ab22adebe376;machineid=cc467af9bedc4d98a437e5d744928301;...
Below are steps of how to reproduce the issue with qemu:
1. IMAGE_INSTALL:append = " bash"
2. bitbake core-image-minimal
3. runqemu snapshot kvm nographic qemuparams="-serial pty"
4. minicom -D /dev/pts/X -b 115200 (/dev/pts/X is the one printed in the step 3)
5. [In minicom] type any command or just type "Enter" key
A new PR is also created for systemd upstream:
https://github.com/systemd/systemd/pull/41647
If systemd accepts the PR, we can then use the new option. Otherwise, we'll need
to keep the way it is now.
[1] https://github.com/systemd/systemd/commit/dadbb34919abd3fefeb5b8ccc9794da9398a2503
[2] https://uapi-group.org/specifications/specs/osc_context/
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-core/systemd/systemd_259.5.bb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/recipes-core/systemd/systemd_259.5.bb b/meta/recipes-core/systemd/systemd_259.5.bb
index 6987d4ad54..7a2f7832d5 100644
--- a/meta/recipes-core/systemd/systemd_259.5.bb
+++ b/meta/recipes-core/systemd/systemd_259.5.bb
@@ -67,6 +67,7 @@ PACKAGECONFIG ??= " \
nss \
nss-mymachines \
nss-resolve \
+ osc-context \
quotacheck \
randomseed \
resolved \
@@ -161,6 +162,7 @@ PACKAGECONFIG[no-ntp-fallback] = "-Dntp-servers="
PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false,,libnss-systemd"
PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=enabled,-Dnss-mymachines=disabled"
PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=enabled,-Dnss-resolve=disabled,,libnss-resolve"
+PACKAGECONFIG[osc-context] = ",,,"
PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false"
PACKAGECONFIG[openssl] = "-Dopenssl=enabled,-Dopenssl=disabled,openssl"
PACKAGECONFIG[p11kit] = "-Dp11kit=enabled,-Dp11kit=disabled,p11-kit"
@@ -273,6 +275,13 @@ do_install() {
find ${D} -name \*getty-generator\* -delete
fi
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'osc-context', 'true', 'false', d)}; then
+ # Ensure there's no /etc/profile.d/80-systemd-osc-context.sh.
+ # Some programs such as minicom does not support this OSC 3008 standard.
+ rm -f ${D}${sysconfdir}/profile.d/80-systemd-osc-context.sh
+ rm -f ${D}${nonarch_libdir}/tmpfiles.d/20-systemd-osc-context.conf
+ fi
+
# Provide support for initramfs
[ ! -e ${D}/init ] && ln -s ${nonarch_libdir}/systemd/systemd ${D}/init
[ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${nonarch_libdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG
2026-04-15 8:29 [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG Qi.Chen
@ 2026-04-15 9:35 ` Paul Barker
2026-04-16 3:41 ` Chen, Qi
0 siblings, 1 reply; 5+ messages in thread
From: Paul Barker @ 2026-04-15 9:35 UTC (permalink / raw)
To: Qi.Chen, openembedded-core; +Cc: mns
[-- Attachment #1: Type: text/plain, Size: 2262 bytes --]
On Wed, 2026-04-15 at 16:29 +0800, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Add a new PACKAGECONFIG to give users the choice of whether to
> have /etc/profile.d/80-systemd-osc-context.sh file or not.
>
> This is because the /etc/profile.d/80-systemd-osc-context.sh[1] is setting
> PS0 with OSC 3008 standard[2]. If a terminal (e.g., minicom) cannot
> deal with this OSC 3008 standard, it will just output the whole contents.
> This is quite annoying. See example output below:
>
> 3008;start=9c578e41-1a0f-4b47-9a87-ab22adebe376;machineid=cc467af9bedc4d98a437e5d744928301;...
>
> Below are steps of how to reproduce the issue with qemu:
> 1. IMAGE_INSTALL:append = " bash"
> 2. bitbake core-image-minimal
> 3. runqemu snapshot kvm nographic qemuparams="-serial pty"
> 4. minicom -D /dev/pts/X -b 115200 (/dev/pts/X is the one printed in the step 3)
> 5. [In minicom] type any command or just type "Enter" key
>
> A new PR is also created for systemd upstream:
> https://github.com/systemd/systemd/pull/41647
> If systemd accepts the PR, we can then use the new option. Otherwise, we'll need
> to keep the way it is now.
>
> [1] https://github.com/systemd/systemd/commit/dadbb34919abd3fefeb5b8ccc9794da9398a2503
> [2] https://uapi-group.org/specifications/specs/osc_context/
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
I think the best way to solve this problem is to set TERM for the serial
port in question, perhaps to something like `vt100` if you expect to be
connecting with minicom. That would have to be hardcoded in the inittab
or relevant systemd unit file as there's no negotiation of terminal type
when connecting over serial.
The `80-systemd-osc-context.sh` script in systemd also needs
modification, it assumes that anything other than TERM=dumb can support
OSC 3008 messages. We all know TERM and terminfo is a mess, but it's
equally messy to just assume support for features like this.
Adding a PACKAGECONFIG and/or an option to the systemd build system to
control whether this is installed is not a good solution - a target
system may have multiple types of terminal in use, some of which do
support OSC 3008.
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG
2026-04-15 9:35 ` Paul Barker
@ 2026-04-16 3:41 ` Chen, Qi
2026-04-22 9:43 ` Paul Barker
0 siblings, 1 reply; 5+ messages in thread
From: Chen, Qi @ 2026-04-16 3:41 UTC (permalink / raw)
To: Paul Barker, openembedded-core@lists.openembedded.org; +Cc: mns@gomspace.com
Hi Paul,
The purpose of this patch is to give vendors/distributions an easy way to disable installing the file.
Distributions can put something like PACKAGECONFIG:remove:pn-systemd = "osc-context" in their distro conf file.
We have looked into this problem so we know what's going on and how to handle it. But how do we convey this information properly to users.
Users get this messy output from console and they have negative impression about your product before they go to any doc.
I like systemd pioneering things, but for the current status, I guess most embedded systems will not benefit from this PS0 setting.
The net effect will be relatively negative. Users get messy output from console in some case. They get it every time they type a command or just the "Enter" key. And they get annoyed.
I got this feedback from two very experienced BSP developers, separately.
So could you please give this patch a second thought? I also think disabling this PACKAGECONFIG for oe-core is a more reasonable default. What do you think?
Regards,
Qi
-----Original Message-----
From: Paul Barker <paul@pbarker.dev>
Sent: Wednesday, April 15, 2026 5:36 PM
To: Chen, Qi <Qi.Chen@windriver.com>; openembedded-core@lists.openembedded.org
Cc: mns@gomspace.com
Subject: Re: [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG
On Wed, 2026-04-15 at 16:29 +0800, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Add a new PACKAGECONFIG to give users the choice of whether to have
> /etc/profile.d/80-systemd-osc-context.sh file or not.
>
> This is because the /etc/profile.d/80-systemd-osc-context.sh[1] is
> setting
> PS0 with OSC 3008 standard[2]. If a terminal (e.g., minicom) cannot
> deal with this OSC 3008 standard, it will just output the whole contents.
> This is quite annoying. See example output below:
>
> 3008;start=9c578e41-1a0f-4b47-9a87-ab22adebe376;machineid=cc467af9bedc4d98a437e5d744928301;...
>
> Below are steps of how to reproduce the issue with qemu:
> 1. IMAGE_INSTALL:append = " bash"
> 2. bitbake core-image-minimal
> 3. runqemu snapshot kvm nographic qemuparams="-serial pty"
> 4. minicom -D /dev/pts/X -b 115200 (/dev/pts/X is the one printed in
> the step 3) 5. [In minicom] type any command or just type "Enter" key
>
> A new PR is also created for systemd upstream:
> https://github.com/systemd/systemd/pull/41647
> If systemd accepts the PR, we can then use the new option. Otherwise,
> we'll need to keep the way it is now.
>
> [1]
> https://github.com/systemd/systemd/commit/dadbb34919abd3fefeb5b8ccc979
> 4da9398a2503 [2]
> https://uapi-group.org/specifications/specs/osc_context/
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
I think the best way to solve this problem is to set TERM for the serial port in question, perhaps to something like `vt100` if you expect to be connecting with minicom. That would have to be hardcoded in the inittab or relevant systemd unit file as there's no negotiation of terminal type when connecting over serial.
The `80-systemd-osc-context.sh` script in systemd also needs modification, it assumes that anything other than TERM=dumb can support OSC 3008 messages. We all know TERM and terminfo is a mess, but it's equally messy to just assume support for features like this.
Adding a PACKAGECONFIG and/or an option to the systemd build system to control whether this is installed is not a good solution - a target system may have multiple types of terminal in use, some of which do support OSC 3008.
Best regards,
--
Paul Barker
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG
2026-04-16 3:41 ` Chen, Qi
@ 2026-04-22 9:43 ` Paul Barker
2026-04-24 5:05 ` [PATCH] " Martin Siegumfeldt
0 siblings, 1 reply; 5+ messages in thread
From: Paul Barker @ 2026-04-22 9:43 UTC (permalink / raw)
To: Chen, Qi, openembedded-core@lists.openembedded.org; +Cc: mns@gomspace.com
[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]
On Thu, 2026-04-16 at 03:41 +0000, Chen, Qi wrote:
> Hi Paul,
>
> The purpose of this patch is to give vendors/distributions an easy way to disable installing the file.
> Distributions can put something like PACKAGECONFIG:remove:pn-systemd = "osc-context" in their distro conf file.
>
> We have looked into this problem so we know what's going on and how to handle it. But how do we convey this information properly to users.
> Users get this messy output from console and they have negative impression about your product before they go to any doc.
>
> I like systemd pioneering things, but for the current status, I guess most embedded systems will not benefit from this PS0 setting.
> The net effect will be relatively negative. Users get messy output from console in some case. They get it every time they type a command or just the "Enter" key. And they get annoyed.
> I got this feedback from two very experienced BSP developers, separately.
>
> So could you please give this patch a second thought? I also think disabling this PACKAGECONFIG for oe-core is a more reasonable default. What do you think?
Hi Qi,
Thanks for the additional info.
I don't really like this approach, I'd prefer a "proper" fix in systemd
and/or inittab, but that isn't likely to happen quickly. So as a
compromise, yes, we should take this patch for now.
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] systemd: add osc-context PACKAGECONFIG
2026-04-22 9:43 ` Paul Barker
@ 2026-04-24 5:05 ` Martin Siegumfeldt
0 siblings, 0 replies; 5+ messages in thread
From: Martin Siegumfeldt @ 2026-04-24 5:05 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 104 bytes --]
Thank you both, I can confirm that the introduced PACKAGECONFIG works as intended.
Regards,
Martin
[-- Attachment #2: Type: text/html, Size: 154 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-24 5:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15 8:29 [OE-core][PATCH] systemd: add osc-context PACKAGECONFIG Qi.Chen
2026-04-15 9:35 ` Paul Barker
2026-04-16 3:41 ` Chen, Qi
2026-04-22 9:43 ` Paul Barker
2026-04-24 5:05 ` [PATCH] " Martin Siegumfeldt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox