Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation
@ 2026-11-23 19:22 Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 1/4] systemd: add ukify packageconfig Tan Siewert
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tan Siewert @ 2026-11-23 19:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sai Sireesha T, Tan Siewert

While investigating the storage usage in OpenBMC I noticed that several
features are enabled by default because their meson options default to
true or because they use .allowed() instead of .enabled() for the
validation. This pollutes the storage which is expensive on some
platforms (there are platforms that only have ~20 MiB for rofs).

This series adds packageconfigs for the features ukify, sysinstall, hwdb
and fdisk.

ukify was enabled by default but only works on EFI systems. On non-EFI
builds it will be disabled by default, but enabled by default when the
efi DISTRO_FEATURE is set.

sysinstall is a neat feature that makes installation guidance easier,
but for a lot of embedded systems it is just a waste of storage. It's
not enabled by default as it has runtime dependencies on systemd-repart
which weren't checked before. Enabling it by default would mean we'd
have to enable OpenSSL and repart which does not seem viable to me.

For hwdb, it might be useful for systems that see PCI/USB/HID devices or
for some laptops, but who needs ThinkPad keymaps on an ARM1176 SoC?

fdisk is recommended by libsystemd-shared, and disabling it drops
util-linux-libfdisk. This is only required for sysupdate, repart and
homed.

With all the changes I was able to free a significant amount of storage
again (the hwdb alone was ~9 MiB uncompressed).

I've tested my changes with qemux86-64 by building systemd with the
default configuration and with fdisk off, hwdb off, sysinstall on (with
and without repart), ukify on, and with the efi DISTRO_FEATURE (with and
without ukify), then checked the resulting packages, shipped binaries
and RRECOMMENDS.
Enabling repart or homed without fdisk fails at parse time as expected.

The testimage with default and hwdb-off + usbutils configuration booted
and passed the default tests.

Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
---
Changes in v2:
- Rebase to blacksail and systemd 262.2 [Tan]
- Remove PACKAGE_BEFORE_PN condition for ukify [Paul]
- Link to v1: https://patch.msgid.link/20261023-systemd-optimisations-v1-0-0cce103e54df@9elements.com

---
Tan Siewert (4):
      systemd: add ukify packageconfig
      systemd: add sysinstall packageconfig
      systemd: add hwdb packageconfig
      systemd: add fdisk packageconfig

 meta/recipes-core/systemd/systemd_262.2.bb | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
---
base-commit: d612a1a307a0413aaed24df370627a1f110b0857
change-id: 20261021-systemd-optimisations-dae99d91e807

Best regards,
--  
Tan Siewert <tan.siewert@9elements.com>


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

* [PATCH v2 1/4] systemd: add ukify packageconfig
  2026-11-23 19:22 [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation Tan Siewert
@ 2026-11-23 19:22 ` Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 2/4] systemd: add sysinstall packageconfig Tan Siewert
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tan Siewert @ 2026-11-23 19:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sai Sireesha T, Tan Siewert

systemd gates ukify via allowed(), so it is built and installed unless
explicitly disabled.

Add a packageconfig option that is enabled by default when the efi
DISTRO_FEATURE is set. It can still be removed if wanted, which may be
useful when using meta-tpm, which may include ukify implicitly.

Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
---
 meta/recipes-core/systemd/systemd_262.2.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_262.2.bb b/meta/recipes-core/systemd/systemd_262.2.bb
index 7223a4d192..eaa4b900e0 100644
--- a/meta/recipes-core/systemd/systemd_262.2.bb
+++ b/meta/recipes-core/systemd/systemd_262.2.bb
@@ -51,6 +51,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', 'efi', 'ukify', '', d)} \
     link-udev-shared \
     backlight \
     binfmt \
@@ -196,6 +197,7 @@ PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
 PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
 PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
 PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
+PACKAGECONFIG[ukify] = "-Dukify=enabled,-Dukify=disabled"
 PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
 PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
 PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"

-- 
2.56.0


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

* [PATCH v2 2/4] systemd: add sysinstall packageconfig
  2026-11-23 19:22 [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 1/4] systemd: add ukify packageconfig Tan Siewert
@ 2026-11-23 19:22 ` Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 3/4] systemd: add hwdb packageconfig Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 4/4] systemd: add fdisk packageconfig Tan Siewert
  3 siblings, 0 replies; 5+ messages in thread
From: Tan Siewert @ 2026-11-23 19:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sai Sireesha T, Tan Siewert

sysinstall is a system installer tool and is unnecessary on some
embedded systems. It calls systemd-repart at runtime, but repart is not
enabled by default, so the shipped tool could not work in the default
configuration anyway.

Add a packageconfig option, disabled by default, and warn when it is
enabled without repart.

Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
---
 meta/recipes-core/systemd/systemd_262.2.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_262.2.bb b/meta/recipes-core/systemd/systemd_262.2.bb
index eaa4b900e0..899df09fa2 100644
--- a/meta/recipes-core/systemd/systemd_262.2.bb
+++ b/meta/recipes-core/systemd/systemd_262.2.bb
@@ -187,6 +187,7 @@ PACKAGECONFIG[seccomp] = "-Dseccomp=enabled,-Dseccomp=disabled,libseccomp"
 PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux,initscripts-sushell"
 PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
 PACKAGECONFIG[sysext] = "-Dsysext=true, -Dsysext=false"
+PACKAGECONFIG[sysinstall] = "-Dsysinstall=true,-Dsysinstall=false"
 PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
 # When enabled use reproducible build timestamp if set as time epoch,
 # or build time if not. When disabled, time epoch is unset.
@@ -871,6 +872,9 @@ python __anonymous() {
 
     if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
         bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
+
+    if bb.utils.contains('PACKAGECONFIG', 'sysinstall', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d):
+        bb.warn("PACKAGECONFIG[sysinstall] may call commands from PACKAGECONFIG[repart]. Consider adding it")
 }
 
 ALTERNATIVE:${PN} = "halt reboot shutdown poweroff \

-- 
2.56.0


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

* [PATCH v2 3/4] systemd: add hwdb packageconfig
  2026-11-23 19:22 [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 1/4] systemd: add ukify packageconfig Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 2/4] systemd: add sysinstall packageconfig Tan Siewert
@ 2026-11-23 19:22 ` Tan Siewert
  2026-11-23 19:22 ` [PATCH v2 4/4] systemd: add fdisk packageconfig Tan Siewert
  3 siblings, 0 replies; 5+ messages in thread
From: Tan Siewert @ 2026-11-23 19:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sai Sireesha T, Tan Siewert

The hwdb is not that useful on embedded devices which may never see HID
or PCI devices, and it uses a fair amount of storage.

Add a packageconfig option which is enabled by default and only
recommends udev-hwdb when it is enabled. usbutils and similar only
RRECOMMEND it, so disabling it does not break them.

Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
---
 meta/recipes-core/systemd/systemd_262.2.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_262.2.bb b/meta/recipes-core/systemd/systemd_262.2.bb
index 899df09fa2..5841ee3322 100644
--- a/meta/recipes-core/systemd/systemd_262.2.bb
+++ b/meta/recipes-core/systemd/systemd_262.2.bb
@@ -59,6 +59,7 @@ PACKAGECONFIG ??= " \
     gshadow \
     hibernate \
     hostnamed \
+    hwdb \
     idn \
     ima \
     kmod \
@@ -137,6 +138,7 @@ PACKAGECONFIG[homed] = "-Dhomed=enabled,-Dhomed=disabled"
 PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
 PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
 PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
+PACKAGECONFIG[hwdb] = "-Dhwdb=true,-Dhwdb=false"
 PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
 PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
 # importd requires journal-upload/xz/zlib/bzip2/gcrypt
@@ -759,7 +761,7 @@ RDEPENDS:${PN} += "systemd-serialgetty"
 RDEPENDS:${PN} += "volatile-binds"
 
 RRECOMMENDS:${PN} += "${PN}-extra-utils \
-                      udev-hwdb \
+                      ${@bb.utils.contains('PACKAGECONFIG', 'hwdb', 'udev-hwdb', '', d)} \
                       e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
                       os-release \

-- 
2.56.0


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

* [PATCH v2 4/4] systemd: add fdisk packageconfig
  2026-11-23 19:22 [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation Tan Siewert
                   ` (2 preceding siblings ...)
  2026-11-23 19:22 ` [PATCH v2 3/4] systemd: add hwdb packageconfig Tan Siewert
@ 2026-11-23 19:22 ` Tan Siewert
  3 siblings, 0 replies; 5+ messages in thread
From: Tan Siewert @ 2026-11-23 19:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sai Sireesha T, Tan Siewert

libfdisk is used only by repart, homed and sysupdate, but as a dlopen
dependency of libsystemd-shared it always adds an RRECOMMENDS entry for
util-linux-libfdisk, even when none of those features are enabled.

Add a packageconfig option and make repart and homed require it, as they
would otherwise fail. sysupdate is auto-detected and silently dropped
when fdisk is disabled.

Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
---
 meta/recipes-core/systemd/systemd_262.2.bb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_262.2.bb b/meta/recipes-core/systemd/systemd_262.2.bb
index 5841ee3322..ca7d5bf532 100644
--- a/meta/recipes-core/systemd/systemd_262.2.bb
+++ b/meta/recipes-core/systemd/systemd_262.2.bb
@@ -56,6 +56,7 @@ PACKAGECONFIG ??= " \
     backlight \
     binfmt \
     coredump \
+    fdisk \
     gshadow \
     hibernate \
     hostnamed \
@@ -130,6 +131,7 @@ PACKAGECONFIG[default-compression-xz] = "-Dxz=true -Ddefault-compression=xz,,xz"
 PACKAGECONFIG[default-compression-zstd] = "-Dzstd=true -Ddefault-compression=zstd,,zstd"
 PACKAGECONFIG[efi] = "-Defi=true -Dbootloader=enabled,-Defi=false -Dbootloader=disabled,python3-pyelftools-native"
 PACKAGECONFIG[elfutils] = "-Delfutils=enabled,-Delfutils=disabled,elfutils"
+PACKAGECONFIG[fdisk] = "-Dfdisk=enabled,-Dfdisk=disabled"
 PACKAGECONFIG[fido] = "-Dlibfido2=enabled,-Dlibfido2=disabled,libfido2-initial"
 PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
 PACKAGECONFIG[repart] = "-Drepart=enabled,-Drepart=disabled"
@@ -869,11 +871,11 @@ 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]")
 
-    if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
-        bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
+    if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl fdisk', True, False, d):
+        bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl] and PACKAGECONFIG[fdisk]")
 
-    if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
-        bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
+    if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup fdisk', True, False, d):
+        bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl], PACKAGECONFIG[cryptsetup] and PACKAGECONFIG[fdisk]")
 
     if bb.utils.contains('PACKAGECONFIG', 'sysinstall', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d):
         bb.warn("PACKAGECONFIG[sysinstall] may call commands from PACKAGECONFIG[repart]. Consider adding it")

-- 
2.56.0


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

end of thread, other threads:[~2026-11-23 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 19:22 [PATCH v2 0/4] systemd: add packageconfigs for storage optimisation Tan Siewert
2026-11-23 19:22 ` [PATCH v2 1/4] systemd: add ukify packageconfig Tan Siewert
2026-11-23 19:22 ` [PATCH v2 2/4] systemd: add sysinstall packageconfig Tan Siewert
2026-11-23 19:22 ` [PATCH v2 3/4] systemd: add hwdb packageconfig Tan Siewert
2026-11-23 19:22 ` [PATCH v2 4/4] systemd: add fdisk packageconfig Tan Siewert

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