public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] systemd: Stop supporting sysvinit compatibility
@ 2026-02-13 17:56 Richard Purdie
  2026-02-15 16:32 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2026-02-13 17:56 UTC (permalink / raw)
  To: openembedded-core

Systemd has worked with sysvinit compatibility but upstream plans to remove
this and hence we will no longer be able to support it. We need to remove this
before the LTS since the support will certainly not be there for the lifetime
of the LTS.

This patch disables that usage mode and removes some of the compatibility logic.
There is more that can be removed, this is meant just to signal to people it is
no longer supported and start that process. Further cleanup can be made over time
in later commits.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-recipe/systemd.bbclass           | 14 +++-------
 .../distro/include/init-manager-systemd.inc   |  2 +-
 meta/conf/distro/include/maintainers.inc      |  1 -
 .../systemd/systemd-compat-units.bb           | 27 -------------------
 meta/recipes-core/systemd/systemd_258.1.bb    | 18 +++++--------
 5 files changed, 12 insertions(+), 50 deletions(-)
 delete mode 100644 meta/recipes-core/systemd/systemd-compat-units.bb

diff --git a/meta/classes-recipe/systemd.bbclass b/meta/classes-recipe/systemd.bbclass
index 562e71fb56e..26eaaf1922f 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -18,14 +18,12 @@ SYSTEMD_AUTO_ENABLE ??= "enable"
 # even if systemd is not in DISTRO_FEATURES.  As such don't make any changes
 # directly but check the DISTRO_FEATURES first.
 python __anonymous() {
-    # If the distro features have systemd but not sysvinit, inhibit update-rcd
-    # from doing any work so that pure-systemd images don't have redundant init
-    # files.
+    # Inhibit update-rcd from doing any work so that systemd images don't have
+    # redundant init files.
     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         d.appendVar("DEPENDS", " systemd-systemctl-native")
         d.appendVar("PACKAGE_WRITE_DEPS", " systemd-systemctl-native")
-        if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-            d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
 systemd_postinst() {
@@ -295,9 +293,5 @@ rm_sysvinit_initddir() {
 }
 
 do_install[postfuncs] += "${RMINITDIR}"
-RMINITDIR = " \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'rm_systemd_unitdir', d)} \
-    ${@'rm_sysvinit_initddir' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
-                                 not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) else ''} \
-"
+RMINITDIR = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'rm_sysvinit_initddir', 'rm_systemd_unitdir', d)}"
 RMINITDIR:class-native = ""
diff --git a/meta/conf/distro/include/init-manager-systemd.inc b/meta/conf/distro/include/init-manager-systemd.inc
index 0a76647459b..1e64b8ad226 100644
--- a/meta/conf/distro/include/init-manager-systemd.inc
+++ b/meta/conf/distro/include/init-manager-systemd.inc
@@ -2,7 +2,7 @@
 DISTRO_FEATURES:append = " systemd usrmerge"
 DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
 VIRTUAL-RUNTIME_init_manager ??= "systemd"
-VIRTUAL-RUNTIME_initscripts ??= "systemd-compat-units"
+VIRTUAL-RUNTIME_initscripts ??= ""
 VIRTUAL-RUNTIME_login_manager ??= "shadow-base"
 VIRTUAL-RUNTIME_dev_manager ??= "systemd"
 # systemd hardcodes /root in its source codes, other values are not offically supported
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index f7728f3fad9..37d22df2f43 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -826,7 +826,6 @@ RECIPE_MAINTAINER:pn-systemd-bootchart = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-bootconf = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-boot-native = "Viswanath Kraleti <quic_vkraleti@quicinc.com>"
 RECIPE_MAINTAINER:pn-systemd-conf = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER:pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-machine-units = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
deleted file mode 100644
index 68391010371..00000000000
--- a/meta/recipes-core/systemd/systemd-compat-units.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
-LICENSE = "MIT"
-
-DEPENDS = "systemd-systemctl-native"
-INHIBIT_DEFAULT_DEPS = "1"
-
-S = "${UNPACKDIR}"
-
-inherit features_check
-
-REQUIRED_DISTRO_FEATURES = "systemd"
-
-SYSTEMD_DISABLED_SYSV_SERVICES = " \
-  busybox-udhcpc \
-  hwclock \
-  networking \
-  nfsserver \
-  nfscommon \
-  syslog.busybox \
-"
-
-do_install() {
-	for unit in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
-		systemctl --root ${D} mask $unit
-	done
-}
diff --git a/meta/recipes-core/systemd/systemd_258.1.bb b/meta/recipes-core/systemd/systemd_258.1.bb
index bd8a01f645d..3847b985476 100644
--- a/meta/recipes-core/systemd/systemd_258.1.bb
+++ b/meta/recipes-core/systemd/systemd_258.1.bb
@@ -18,6 +18,10 @@ REQUIRED_DISTRO_FEATURES += "usrmerge"
 # that we don't build both udev and systemd in world builds.
 REQUIRED_DISTRO_FEATURES += "systemd"
 
+# Systemd used to work with sysvinit compatibility but upstream plans to remove
+# this and hence we can no longer support it
+CONFLICT_DISTRO_FEATURES += "sysvinit"
+
 SRC_URI += " \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
@@ -62,7 +66,7 @@ PACKAGECONFIG ??= " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit', 'link-udev-shared', d)} \
+    link-udev-shared \
     backlight \
     binfmt \
     gshadow \
@@ -300,13 +304,6 @@ do_install() {
 
 	install -m 0644 ${UNPACKDIR}/00-create-volatile.conf ${D}${nonarch_libdir}/tmpfiles.d/
 
-	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
-		install -d ${D}${sysconfdir}/init.d
-		install -m 0755 ${UNPACKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
-		sed -i s%@UDEVD@%${nonarch_libdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
-		install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
-	fi
-
 	if ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'true', 'false', d)}; then
 		# base-files recipe provides /var/log which is a symlink to /var/volatile/log
 		rm -rf ${D}${localstatedir}/log
@@ -841,10 +838,9 @@ INITSCRIPT_PACKAGES = "udev"
 INITSCRIPT_NAME:udev = "systemd-udevd"
 INITSCRIPT_PARAMS:udev = "start 03 S ."
 
-python __anonymous() {
-    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+INHIBIT_UPDATERCD_BBCLASS = "1"
 
+python __anonymous() {
     if bb.utils.contains('DISTRO_FEATURES', 'systemd-resolved', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'nss-resolve resolved', True, False, d):
         bb.error("DISTRO_FEATURES[systemd-resolved] requires PACKAGECONFIG[nss-resolve, resolved]")
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] systemd: Stop supporting sysvinit compatibility
  2026-02-13 17:56 [PATCH] systemd: Stop supporting sysvinit compatibility Richard Purdie
@ 2026-02-15 16:32 ` Mathieu Dubois-Briand
  2026-02-15 17:03   ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Dubois-Briand @ 2026-02-15 16:32 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

On Fri Feb 13, 2026 at 6:56 PM CET, Richard Purdie via lists.openembedded.org wrote:
> Systemd has worked with sysvinit compatibility but upstream plans to remove
> this and hence we will no longer be able to support it. We need to remove this
> before the LTS since the support will certainly not be there for the lifetime
> of the LTS.
>
> This patch disables that usage mode and removes some of the compatibility logic.
> There is more that can be removed, this is meant just to signal to people it is
> no longer supported and start that process. Further cleanup can be made over time
> in later commits.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---

Hi Richard,

I suspect we also want to remove the "Systemd with sysvinit compat" and
"Sysvinit with systemd" steps from qa-extras2:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/26/builds/3165
https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1562

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] systemd: Stop supporting sysvinit compatibility
  2026-02-15 16:32 ` [OE-core] " Mathieu Dubois-Briand
@ 2026-02-15 17:03   ` Richard Purdie
  2026-02-16  6:51     ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2026-02-15 17:03 UTC (permalink / raw)
  To: Mathieu Dubois-Briand, openembedded-core

Hi Mattieu,

On Sun, 2026-02-15 at 17:32 +0100, Mathieu Dubois-Briand wrote:
> On Fri Feb 13, 2026 at 6:56 PM CET, Richard Purdie via lists.openembedded.org wrote:
> > Systemd has worked with sysvinit compatibility but upstream plans to remove
> > this and hence we will no longer be able to support it. We need to remove this
> > before the LTS since the support will certainly not be there for the lifetime
> > of the LTS.
> > 
> > This patch disables that usage mode and removes some of the compatibility logic.
> > There is more that can be removed, this is meant just to signal to people it is
> > no longer supported and start that process. Further cleanup can be made over time
> > in later commits.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> I suspect we also want to remove the "Systemd with sysvinit compat" and
> "Sysvinit with systemd" steps from qa-extras2:
> 
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/26/builds/3165
> https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1562

Yes, that is on my todo list! I knew we had a few tests to remove, I
think that is the only one I haven't patched yet. Thankfully an easy
tweak for a change.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] systemd: Stop supporting sysvinit compatibility
  2026-02-15 17:03   ` Richard Purdie
@ 2026-02-16  6:51     ` Mathieu Dubois-Briand
  2026-02-16  7:42       ` Vyacheslav Yurkov
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Dubois-Briand @ 2026-02-16  6:51 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On Sun Feb 15, 2026 at 6:03 PM CET, Richard Purdie wrote:
> Hi Mattieu,
>
> On Sun, 2026-02-15 at 17:32 +0100, Mathieu Dubois-Briand wrote:
>> On Fri Feb 13, 2026 at 6:56 PM CET, Richard Purdie via lists.openembedded.org wrote:
>> > Systemd has worked with sysvinit compatibility but upstream plans to remove
>> > this and hence we will no longer be able to support it. We need to remove this
>> > before the LTS since the support will certainly not be there for the lifetime
>> > of the LTS.
>> > 
>> > This patch disables that usage mode and removes some of the compatibility logic.
>> > There is more that can be removed, this is meant just to signal to people it is
>> > no longer supported and start that process. Further cleanup can be made over time
>> > in later commits.
>> > 
>> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> 
>> I suspect we also want to remove the "Systemd with sysvinit compat" and
>> "Sysvinit with systemd" steps from qa-extras2:
>> 
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/26/builds/3165
>> https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1562
>
> Yes, that is on my todo list! I knew we had a few tests to remove, I
> think that is the only one I haven't patched yet. Thankfully an easy
> tweak for a change.
>
> Cheers,
>
> Richard

Just in case: I also noted following selftests:

bbclasses.Systemd.test_systemd_and_sysvinit_in_distro
overlayfs.OverlayFSTests.test_not_all_units_installed
overlayfs.OverlayFSTests.test_not_all_units_installed_but_qa_skipped

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] systemd: Stop supporting sysvinit compatibility
  2026-02-16  6:51     ` Mathieu Dubois-Briand
@ 2026-02-16  7:42       ` Vyacheslav Yurkov
  2026-02-16  8:45         ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Vyacheslav Yurkov @ 2026-02-16  7:42 UTC (permalink / raw)
  To: mathieu.dubois-briand, Richard Purdie, openembedded-core

On 16.02.2026 07:51, Mathieu Dubois-Briand via lists.openembedded.org wrote:
> Just in case: I also noted following selftests:
>
> bbclasses.Systemd.test_systemd_and_sysvinit_in_distro
> overlayfs.OverlayFSTests.test_not_all_units_installed
> overlayfs.OverlayFSTests.test_not_all_units_installed_but_qa_skipped
>
> Thanks,
> Mathieu

Overlayfs feature doesn't use sysvinit.

Slava


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] systemd: Stop supporting sysvinit compatibility
  2026-02-16  7:42       ` Vyacheslav Yurkov
@ 2026-02-16  8:45         ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2026-02-16  8:45 UTC (permalink / raw)
  To: Vyacheslav Yurkov, mathieu.dubois-briand, openembedded-core

On Mon, 2026-02-16 at 08:42 +0100, Vyacheslav Yurkov wrote:
> On 16.02.2026 07:51, Mathieu Dubois-Briand via lists.openembedded.org wrote:
> > Just in case: I also noted following selftests:
> > 
> > bbclasses.Systemd.test_systemd_and_sysvinit_in_distro
> > overlayfs.OverlayFSTests.test_not_all_units_installed
> > overlayfs.OverlayFSTests.test_not_all_units_installed_but_qa_skipped
> > 
> > Thanks,
> > Mathieu
> 
> Overlayfs feature doesn't use sysvinit.

Some of the overlayfs tests still have sysvinit compatibility enabled
which is why these tests started failing. I have a patch which tweaks
those just to use systemd only which fixes that.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-16  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 17:56 [PATCH] systemd: Stop supporting sysvinit compatibility Richard Purdie
2026-02-15 16:32 ` [OE-core] " Mathieu Dubois-Briand
2026-02-15 17:03   ` Richard Purdie
2026-02-16  6:51     ` Mathieu Dubois-Briand
2026-02-16  7:42       ` Vyacheslav Yurkov
2026-02-16  8:45         ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox