Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs
@ 2025-07-16 23:29 Hiago De Franco
  2025-07-16 23:29 ` [PATCH 1/2] systemd: drop build dependency on util-linux Hiago De Franco
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hiago De Franco @ 2025-07-16 23:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chen Qi, Alexander Kanavin, Hiago De Franco

From: Hiago De Franco <hiago.franco@toradex.com>

The libmount dependency in systemd was made optional upstream [2]. This
series backports that change, allowing us to drop util-linux as a build
dependency for systemd. This resolves a circular dependency between
util-linux and systemd when systemd PACKAGECONFIG is enabled in
util-linux. Without this fix, each recipe depends on the other,
triggering the circular dependency error.

Note that this alone does not fully resolve the circular dependency
on util-linux-fstrim/uuid. There is another one:

glib-2.0 -> util-linux -> systemd -> shared-mime-info -> glib-2.0

But the libmount PACKAGECONFIG can be removed from glib-2.0 to break its
dependency on util-linux.

In addition, according to systemd's README [2], the dependencies on
libblkid and libfdisk from util-linux are optional, so add them as new
PACKAGECONFIGs.

[1] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
[2] https://github.com/systemd/systemd/blob/main/README#L216

Hiago De Franco (2):
  systemd: drop build dependency on util-linux
  systemd: add libblkid and libfdisk PACKAGECONFIG options

 .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_257.6.bb    |  9 ++-
 2 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch

-- 
2.39.5



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

* [PATCH 1/2] systemd: drop build dependency on util-linux
  2025-07-16 23:29 [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Hiago De Franco
@ 2025-07-16 23:29 ` Hiago De Franco
  2025-07-17  9:53   ` Alexander Kanavin
       [not found]   ` <1853013D626CB3EF.8991@lists.openembedded.org>
  2025-07-16 23:29 ` [PATCH 2/2] systemd: add libblkid and libfdisk PACKAGECONFIG options Hiago De Franco
  2025-07-17  9:49 ` [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Mathieu Dubois-Briand
  2 siblings, 2 replies; 9+ messages in thread
From: Hiago De Franco @ 2025-07-16 23:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chen Qi, Alexander Kanavin, Hiago De Franco

From: Hiago De Franco <hiago.franco@toradex.com>

The libmount dependency was made optional on systemd upstream [2]. By
backporting this upstream change, we can drop util-linux as a build
dependency for systemd, making it only as a runtime dependency.

This is important to fix a circular dependency between util-linux and
systemd when util-linux is built with the systemd PACKAGECONFIG enabled.
Without this change, each recipe depends on the other, triggering the
circular dependency error.

[1] https://github.com/systemd/systemd/blob/main/README#L216
[2] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
---
 .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_257.6.bb    |  7 ++-
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch

diff --git a/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
new file mode 100644
index 000000000000..b04acd6fef08
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
@@ -0,0 +1,58 @@
+From 821c809e1e1e449f5a2fe591d6aae1343b141b6c Mon Sep 17 00:00:00 2001
+From: Daan De Meyer <daan.j.demeyer@gmail.com>
+Date: Thu, 5 Jun 2025 11:05:08 +0200
+Subject: [PATCH] meson: Add libmount feature
+
+Let's reduce the dependencies required to build just libsystemd by
+making libmount optional. The meson disabler feature makes this quite
+trivial.
+
+Upstream-Status: Backport [d1ee3889cf8e8a9edc82e41d306155fb4c531c8f]
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+---
+ meson.build       | 4 +++-
+ meson_options.txt | 2 ++
+ tools/oss-fuzz.sh | 2 +-
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 957e00ecad..594fadbb37 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1179,7 +1179,9 @@ else
+ endif
+ 
+ libmount = dependency('mount',
+-                      version : fuzzer_build ? '>= 0' : '>= 2.30')
++                      version : fuzzer_build ? '>= 0' : '>= 2.30',
++                      disabler : true,
++                      required : get_option('libmount'))
+ 
+ libfdisk = dependency('fdisk',
+                       version : '>= 2.32',
+diff --git a/meson_options.txt b/meson_options.txt
+index f30b3f5238..f292732d62 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -471,6 +471,8 @@ option('dbus', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'd
+        description : 'libdbus support (for tests only)')
+ option('libarchive', type : 'feature',
+        description : 'libarchive support')
++option('libmount', type : 'feature',
++       description : 'libmount support')
+ 
+ option('bootloader', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
+        description : 'sd-boot/stub and userspace tools')
+diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
+index df3d39eba6..b7a70207df 100755
+--- a/tools/oss-fuzz.sh
++++ b/tools/oss-fuzz.sh
+@@ -32,7 +32,7 @@ meson_args=("-Db_lundef=false")
+ if [ -z "$FUZZING_ENGINE" ]; then
+     meson_args+=("-Dllvm-fuzz=true")
+ else
+-    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled")
++    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dlibmount=enabled")
+ 
+     apt-get update
+     apt-get install -y gperf m4 gettext python3-pip \
diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
index 9092d02c5109..d73c0cfe0d8b 100644
--- a/meta/recipes-core/systemd/systemd_257.6.bb
+++ b/meta/recipes-core/systemd/systemd_257.6.bb
@@ -4,7 +4,7 @@ PROVIDES = "udev"
 
 PE = "1"
 
-DEPENDS = "gperf-native libcap util-linux python3-jinja2-native"
+DEPENDS = "gperf-native libcap python3-jinja2-native"
 
 SECTION = "base/shell"
 
@@ -29,6 +29,7 @@ SRC_URI += " \
            file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
            file://0002-implment-systemd-sysv-install-for-OE.patch \
            file://0001-Do-not-create-var-log-README.patch \
+           file://0001-meson-Add-libmount-feature.patch \
            "
 
 # patches needed by musl
@@ -81,6 +82,7 @@ PACKAGECONFIG ??= " \
     idn \
     ima \
     kmod \
+    libmount \
     localed \
     logind \
     machined \
@@ -172,6 +174,7 @@ PACKAGECONFIG[kmod] = "-Dkmod=enabled,-Dkmod=disabled,kmod,libkmod"
 PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
 PACKAGECONFIG[libidn] = "-Dlibidn=enabled,-Dlibidn=disabled,libidn,,libidn"
 PACKAGECONFIG[libidn2] = "-Dlibidn2=enabled,-Dlibidn2=disabled,libidn2,,libidn2"
+PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux,util-linux-mount util-linux-umount"
 # Link udev shared with systemd helper library.
 # If enabled the udev package depends on the systemd package (which has the needed shared library).
 PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
@@ -742,7 +745,7 @@ FILES:${PN} = " ${base_bindir}/* \
 
 FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
+RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
 RDEPENDS:${PN} += "systemd-serialgetty"
 RDEPENDS:${PN} += "volatile-binds"
 
-- 
2.39.5



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

* [PATCH 2/2] systemd: add libblkid and libfdisk PACKAGECONFIG options
  2025-07-16 23:29 [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Hiago De Franco
  2025-07-16 23:29 ` [PATCH 1/2] systemd: drop build dependency on util-linux Hiago De Franco
@ 2025-07-16 23:29 ` Hiago De Franco
  2025-07-17  9:49 ` [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Mathieu Dubois-Briand
  2 siblings, 0 replies; 9+ messages in thread
From: Hiago De Franco @ 2025-07-16 23:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chen Qi, Alexander Kanavin, Hiago De Franco

From: Hiago De Franco <hiago.franco@toradex.com>

Introduce new PACKAGECONFIG options in systemd for both libblkid and
libfdisk to allow explicit control over these optional dependencies [1]
[2].

[1] https://github.com/systemd/systemd/blob/main/README#L219
[2] https://github.com/systemd/systemd/blob/main/README#L228

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
---
 meta/recipes-core/systemd/systemd_257.6.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
index d73c0cfe0d8b..019f084b2e34 100644
--- a/meta/recipes-core/systemd/systemd_257.6.bb
+++ b/meta/recipes-core/systemd/systemd_257.6.bb
@@ -137,6 +137,7 @@ PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit"
 PACKAGECONFIG[apparmor] = "-Dapparmor=enabled,-Dapparmor=disabled,apparmor"
 PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
 PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
+PACKAGECONFIG[blkid] = "-Dblkid=enabled,-Dblkid=disabled,util-linux,util-linux-libblkid util-linux-blkid"
 PACKAGECONFIG[bpf-framework] = "-Dbpf-framework=enabled,-Dbpf-framework=disabled,clang-native bpftool-native libbpf,libbpf"
 PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
 PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
@@ -152,6 +153,7 @@ PACKAGECONFIG[default-compression-zstd] = "-Dzstd=true -Ddefault-compression=zst
 PACKAGECONFIG[dbus] = "-Ddbus=enabled,-Ddbus=disabled,dbus"
 PACKAGECONFIG[efi] = "-Defi=true -Dbootloader=enabled,-Defi=false -Dbootloader=disabled,python3-pyelftools-native"
 PACKAGECONFIG[elfutils] = "-Delfutils=enabled,-Delfutils=disabled,elfutils,,libelf libdw"
+PACKAGECONFIG[fdisk] = "-Dfdisk=enabled,-Dfdisk=disabled,util-linux,util-linux-libfdisk util-linux-fdisk"
 PACKAGECONFIG[fido] = "-Dlibfido2=enabled,-Dlibfido2=disabled,libfido2"
 PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
 PACKAGECONFIG[repart] = "-Drepart=enabled,-Drepart=disabled"
-- 
2.39.5



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

* Re: [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs
  2025-07-16 23:29 [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Hiago De Franco
  2025-07-16 23:29 ` [PATCH 1/2] systemd: drop build dependency on util-linux Hiago De Franco
  2025-07-16 23:29 ` [PATCH 2/2] systemd: add libblkid and libfdisk PACKAGECONFIG options Hiago De Franco
@ 2025-07-17  9:49 ` Mathieu Dubois-Briand
  2025-07-17 12:57   ` Hiago De Franco
  2 siblings, 1 reply; 9+ messages in thread
From: Mathieu Dubois-Briand @ 2025-07-17  9:49 UTC (permalink / raw)
  To: hiagofranco, openembedded-core
  Cc: Chen Qi, Alexander Kanavin, Hiago De Franco

On Thu Jul 17, 2025 at 1:29 AM CEST, Hiago De Franco via lists.openembedded.org wrote:
> From: Hiago De Franco <hiago.franco@toradex.com>
>
> The libmount dependency in systemd was made optional upstream [2]. This
> series backports that change, allowing us to drop util-linux as a build
> dependency for systemd. This resolves a circular dependency between
> util-linux and systemd when systemd PACKAGECONFIG is enabled in
> util-linux. Without this fix, each recipe depends on the other,
> triggering the circular dependency error.
>
> Note that this alone does not fully resolve the circular dependency
> on util-linux-fstrim/uuid. There is another one:
>
> glib-2.0 -> util-linux -> systemd -> shared-mime-info -> glib-2.0
>
> But the libmount PACKAGECONFIG can be removed from glib-2.0 to break its
> dependency on util-linux.
>
> In addition, according to systemd's README [2], the dependencies on
> libblkid and libfdisk from util-linux are optional, so add them as new
> PACKAGECONFIGs.
>
> [1] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
> [2] https://github.com/systemd/systemd/blob/main/README#L216
>
> Hiago De Franco (2):
>   systemd: drop build dependency on util-linux
>   systemd: add libblkid and libfdisk PACKAGECONFIG options
>
>  .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
>  meta/recipes-core/systemd/systemd_257.6.bb    |  9 ++-
>  2 files changed, 65 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch

Hi Hiago,

Thanks for your patches.

I suspect this series is responsible from a test failure:

Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
  File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 100, in test_systemd_failed
    output += self.systemctl('status --full --failed')
  File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 26, in systemctl
    self.assertEqual(status, expected, message)
AssertionError: 3 != 0 : SYSTEMD_BUS_TIMEOUT=240s systemctl status --full --failed
× systemd-boot-update.service - Automatic Boot Loader Update
     Loaded: loaded (/usr/lib/systemd/system/systemd-boot-update.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Thu 2025-07-17 09:02:59 UTC; 25min ago
 Invocation: a44df1a151da4bbfa387c056d59eb001
       Docs: man:bootctl(1)
   Main PID: 189 (code=exited, status=203/EXEC)
   Mem peak: 828K
        CPU: 58ms
...
RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (9.36s)

https://autobuilder.yoctoproject.org/valkyrie/#/builders/74/builds/2034
https://autobuilder.yoctoproject.org/valkyrie/#/builders/9/builds/2030
https://autobuilder.yoctoproject.org/valkyrie/#/builders/95/builds/2018
https://autobuilder.yoctoproject.org/valkyrie/#/builders/20/builds/2017

Can you have a look at this failure please?

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



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

* Re: [PATCH 1/2] systemd: drop build dependency on util-linux
  2025-07-16 23:29 ` [PATCH 1/2] systemd: drop build dependency on util-linux Hiago De Franco
@ 2025-07-17  9:53   ` Alexander Kanavin
       [not found]   ` <1853013D626CB3EF.8991@lists.openembedded.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2025-07-17  9:53 UTC (permalink / raw)
  To: Hiago De Franco; +Cc: openembedded-core, Chen Qi, Hiago De Franco

I don't understand. The backported patch adds a meson option, but not
any uses of it. Why is it needed?

Alex

On Thu, 17 Jul 2025 at 01:29, Hiago De Franco <hiagofranco@gmail.com> wrote:
>
> From: Hiago De Franco <hiago.franco@toradex.com>
>
> The libmount dependency was made optional on systemd upstream [2]. By
> backporting this upstream change, we can drop util-linux as a build
> dependency for systemd, making it only as a runtime dependency.
>
> This is important to fix a circular dependency between util-linux and
> systemd when util-linux is built with the systemd PACKAGECONFIG enabled.
> Without this change, each recipe depends on the other, triggering the
> circular dependency error.
>
> [1] https://github.com/systemd/systemd/blob/main/README#L216
> [2] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
>
> Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
> ---
>  .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
>  meta/recipes-core/systemd/systemd_257.6.bb    |  7 ++-
>  2 files changed, 63 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
>
> diff --git a/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> new file mode 100644
> index 000000000000..b04acd6fef08
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> @@ -0,0 +1,58 @@
> +From 821c809e1e1e449f5a2fe591d6aae1343b141b6c Mon Sep 17 00:00:00 2001
> +From: Daan De Meyer <daan.j.demeyer@gmail.com>
> +Date: Thu, 5 Jun 2025 11:05:08 +0200
> +Subject: [PATCH] meson: Add libmount feature
> +
> +Let's reduce the dependencies required to build just libsystemd by
> +making libmount optional. The meson disabler feature makes this quite
> +trivial.
> +
> +Upstream-Status: Backport [d1ee3889cf8e8a9edc82e41d306155fb4c531c8f]
> +Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
> +---
> + meson.build       | 4 +++-
> + meson_options.txt | 2 ++
> + tools/oss-fuzz.sh | 2 +-
> + 3 files changed, 6 insertions(+), 2 deletions(-)
> +
> +diff --git a/meson.build b/meson.build
> +index 957e00ecad..594fadbb37 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -1179,7 +1179,9 @@ else
> + endif
> +
> + libmount = dependency('mount',
> +-                      version : fuzzer_build ? '>= 0' : '>= 2.30')
> ++                      version : fuzzer_build ? '>= 0' : '>= 2.30',
> ++                      disabler : true,
> ++                      required : get_option('libmount'))
> +
> + libfdisk = dependency('fdisk',
> +                       version : '>= 2.32',
> +diff --git a/meson_options.txt b/meson_options.txt
> +index f30b3f5238..f292732d62 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -471,6 +471,8 @@ option('dbus', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'd
> +        description : 'libdbus support (for tests only)')
> + option('libarchive', type : 'feature',
> +        description : 'libarchive support')
> ++option('libmount', type : 'feature',
> ++       description : 'libmount support')
> +
> + option('bootloader', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
> +        description : 'sd-boot/stub and userspace tools')
> +diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
> +index df3d39eba6..b7a70207df 100755
> +--- a/tools/oss-fuzz.sh
> ++++ b/tools/oss-fuzz.sh
> +@@ -32,7 +32,7 @@ meson_args=("-Db_lundef=false")
> + if [ -z "$FUZZING_ENGINE" ]; then
> +     meson_args+=("-Dllvm-fuzz=true")
> + else
> +-    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled")
> ++    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dlibmount=enabled")
> +
> +     apt-get update
> +     apt-get install -y gperf m4 gettext python3-pip \
> diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
> index 9092d02c5109..d73c0cfe0d8b 100644
> --- a/meta/recipes-core/systemd/systemd_257.6.bb
> +++ b/meta/recipes-core/systemd/systemd_257.6.bb
> @@ -4,7 +4,7 @@ PROVIDES = "udev"
>
>  PE = "1"
>
> -DEPENDS = "gperf-native libcap util-linux python3-jinja2-native"
> +DEPENDS = "gperf-native libcap python3-jinja2-native"
>
>  SECTION = "base/shell"
>
> @@ -29,6 +29,7 @@ SRC_URI += " \
>             file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
>             file://0002-implment-systemd-sysv-install-for-OE.patch \
>             file://0001-Do-not-create-var-log-README.patch \
> +           file://0001-meson-Add-libmount-feature.patch \
>             "
>
>  # patches needed by musl
> @@ -81,6 +82,7 @@ PACKAGECONFIG ??= " \
>      idn \
>      ima \
>      kmod \
> +    libmount \
>      localed \
>      logind \
>      machined \
> @@ -172,6 +174,7 @@ PACKAGECONFIG[kmod] = "-Dkmod=enabled,-Dkmod=disabled,kmod,libkmod"
>  PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
>  PACKAGECONFIG[libidn] = "-Dlibidn=enabled,-Dlibidn=disabled,libidn,,libidn"
>  PACKAGECONFIG[libidn2] = "-Dlibidn2=enabled,-Dlibidn2=disabled,libidn2,,libidn2"
> +PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux,util-linux-mount util-linux-umount"
>  # Link udev shared with systemd helper library.
>  # If enabled the udev package depends on the systemd package (which has the needed shared library).
>  PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
> @@ -742,7 +745,7 @@ FILES:${PN} = " ${base_bindir}/* \
>
>  FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
>
> -RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
> +RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
>  RDEPENDS:${PN} += "systemd-serialgetty"
>  RDEPENDS:${PN} += "volatile-binds"
>
> --
> 2.39.5
>


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

* Re: [OE-core] [PATCH 1/2] systemd: drop build dependency on util-linux
       [not found]   ` <1853013D626CB3EF.8991@lists.openembedded.org>
@ 2025-07-17  9:56     ` Alexander Kanavin
  2025-07-17 12:55       ` Hiago De Franco
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2025-07-17  9:56 UTC (permalink / raw)
  To: alex.kanavin; +Cc: Hiago De Franco, openembedded-core, Chen Qi, Hiago De Franco

Ah nevermind. The dependency was already there, it's just converted
from floating to explicit?

Alex

On Thu, 17 Jul 2025 at 11:54, Alexander Kanavin via
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
wrote:
>
> I don't understand. The backported patch adds a meson option, but not
> any uses of it. Why is it needed?
>
> Alex
>
> On Thu, 17 Jul 2025 at 01:29, Hiago De Franco <hiagofranco@gmail.com> wrote:
> >
> > From: Hiago De Franco <hiago.franco@toradex.com>
> >
> > The libmount dependency was made optional on systemd upstream [2]. By
> > backporting this upstream change, we can drop util-linux as a build
> > dependency for systemd, making it only as a runtime dependency.
> >
> > This is important to fix a circular dependency between util-linux and
> > systemd when util-linux is built with the systemd PACKAGECONFIG enabled.
> > Without this change, each recipe depends on the other, triggering the
> > circular dependency error.
> >
> > [1] https://github.com/systemd/systemd/blob/main/README#L216
> > [2] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
> >
> > Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
> > ---
> >  .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
> >  meta/recipes-core/systemd/systemd_257.6.bb    |  7 ++-
> >  2 files changed, 63 insertions(+), 2 deletions(-)
> >  create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> >
> > diff --git a/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> > new file mode 100644
> > index 000000000000..b04acd6fef08
> > --- /dev/null
> > +++ b/meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> > @@ -0,0 +1,58 @@
> > +From 821c809e1e1e449f5a2fe591d6aae1343b141b6c Mon Sep 17 00:00:00 2001
> > +From: Daan De Meyer <daan.j.demeyer@gmail.com>
> > +Date: Thu, 5 Jun 2025 11:05:08 +0200
> > +Subject: [PATCH] meson: Add libmount feature
> > +
> > +Let's reduce the dependencies required to build just libsystemd by
> > +making libmount optional. The meson disabler feature makes this quite
> > +trivial.
> > +
> > +Upstream-Status: Backport [d1ee3889cf8e8a9edc82e41d306155fb4c531c8f]
> > +Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
> > +---
> > + meson.build       | 4 +++-
> > + meson_options.txt | 2 ++
> > + tools/oss-fuzz.sh | 2 +-
> > + 3 files changed, 6 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/meson.build b/meson.build
> > +index 957e00ecad..594fadbb37 100644
> > +--- a/meson.build
> > ++++ b/meson.build
> > +@@ -1179,7 +1179,9 @@ else
> > + endif
> > +
> > + libmount = dependency('mount',
> > +-                      version : fuzzer_build ? '>= 0' : '>= 2.30')
> > ++                      version : fuzzer_build ? '>= 0' : '>= 2.30',
> > ++                      disabler : true,
> > ++                      required : get_option('libmount'))
> > +
> > + libfdisk = dependency('fdisk',
> > +                       version : '>= 2.32',
> > +diff --git a/meson_options.txt b/meson_options.txt
> > +index f30b3f5238..f292732d62 100644
> > +--- a/meson_options.txt
> > ++++ b/meson_options.txt
> > +@@ -471,6 +471,8 @@ option('dbus', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'd
> > +        description : 'libdbus support (for tests only)')
> > + option('libarchive', type : 'feature',
> > +        description : 'libarchive support')
> > ++option('libmount', type : 'feature',
> > ++       description : 'libmount support')
> > +
> > + option('bootloader', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
> > +        description : 'sd-boot/stub and userspace tools')
> > +diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
> > +index df3d39eba6..b7a70207df 100755
> > +--- a/tools/oss-fuzz.sh
> > ++++ b/tools/oss-fuzz.sh
> > +@@ -32,7 +32,7 @@ meson_args=("-Db_lundef=false")
> > + if [ -z "$FUZZING_ENGINE" ]; then
> > +     meson_args+=("-Dllvm-fuzz=true")
> > + else
> > +-    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled")
> > ++    meson_args+=("-Doss-fuzz=true" "--auto-features=disabled" "-Dlibmount=enabled")
> > +
> > +     apt-get update
> > +     apt-get install -y gperf m4 gettext python3-pip \
> > diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
> > index 9092d02c5109..d73c0cfe0d8b 100644
> > --- a/meta/recipes-core/systemd/systemd_257.6.bb
> > +++ b/meta/recipes-core/systemd/systemd_257.6.bb
> > @@ -4,7 +4,7 @@ PROVIDES = "udev"
> >
> >  PE = "1"
> >
> > -DEPENDS = "gperf-native libcap util-linux python3-jinja2-native"
> > +DEPENDS = "gperf-native libcap python3-jinja2-native"
> >
> >  SECTION = "base/shell"
> >
> > @@ -29,6 +29,7 @@ SRC_URI += " \
> >             file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
> >             file://0002-implment-systemd-sysv-install-for-OE.patch \
> >             file://0001-Do-not-create-var-log-README.patch \
> > +           file://0001-meson-Add-libmount-feature.patch \
> >             "
> >
> >  # patches needed by musl
> > @@ -81,6 +82,7 @@ PACKAGECONFIG ??= " \
> >      idn \
> >      ima \
> >      kmod \
> > +    libmount \
> >      localed \
> >      logind \
> >      machined \
> > @@ -172,6 +174,7 @@ PACKAGECONFIG[kmod] = "-Dkmod=enabled,-Dkmod=disabled,kmod,libkmod"
> >  PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
> >  PACKAGECONFIG[libidn] = "-Dlibidn=enabled,-Dlibidn=disabled,libidn,,libidn"
> >  PACKAGECONFIG[libidn2] = "-Dlibidn2=enabled,-Dlibidn2=disabled,libidn2,,libidn2"
> > +PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux,util-linux-mount util-linux-umount"
> >  # Link udev shared with systemd helper library.
> >  # If enabled the udev package depends on the systemd package (which has the needed shared library).
> >  PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
> > @@ -742,7 +745,7 @@ FILES:${PN} = " ${base_bindir}/* \
> >
> >  FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
> >
> > -RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
> > +RDEPENDS:${PN} += "kmod ${VIRTUAL-RUNTIME_dbus} udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
> >  RDEPENDS:${PN} += "systemd-serialgetty"
> >  RDEPENDS:${PN} += "volatile-binds"
> >
> > --
> > 2.39.5
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#220528): https://lists.openembedded.org/g/openembedded-core/message/220528
> Mute This Topic: https://lists.openembedded.org/mt/114194829/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

* Re: [OE-core] [PATCH 1/2] systemd: drop build dependency on util-linux
  2025-07-17  9:56     ` [OE-core] " Alexander Kanavin
@ 2025-07-17 12:55       ` Hiago De Franco
  0 siblings, 0 replies; 9+ messages in thread
From: Hiago De Franco @ 2025-07-17 12:55 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, Chen Qi, Hiago De Franco

Hi Alex,

On Thu, Jul 17, 2025 at 11:56:10AM +0200, Alexander Kanavin wrote:
> Ah nevermind. The dependency was already there, it's just converted
> from floating to explicit?

Yes it was already there, but now we can set the option to build without
it, so we can remove it from DEPENDS and convert it into a
PACKAGECONFIG.

Thanks!

Hiago.

> 
> Alex
>


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

* Re: [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs
  2025-07-17  9:49 ` [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Mathieu Dubois-Briand
@ 2025-07-17 12:57   ` Hiago De Franco
  2025-07-17 19:51     ` Hiago De Franco
  0 siblings, 1 reply; 9+ messages in thread
From: Hiago De Franco @ 2025-07-17 12:57 UTC (permalink / raw)
  To: Mathieu Dubois-Briand
  Cc: openembedded-core, Chen Qi, Alexander Kanavin, Hiago De Franco

Hi Mathieu,

On Thu, Jul 17, 2025 at 11:49:54AM +0200, Mathieu Dubois-Briand wrote:
> On Thu Jul 17, 2025 at 1:29 AM CEST, Hiago De Franco via lists.openembedded.org wrote:
> > From: Hiago De Franco <hiago.franco@toradex.com>
> >
> > The libmount dependency in systemd was made optional upstream [2]. This
> > series backports that change, allowing us to drop util-linux as a build
> > dependency for systemd. This resolves a circular dependency between
> > util-linux and systemd when systemd PACKAGECONFIG is enabled in
> > util-linux. Without this fix, each recipe depends on the other,
> > triggering the circular dependency error.
> >
> > Note that this alone does not fully resolve the circular dependency
> > on util-linux-fstrim/uuid. There is another one:
> >
> > glib-2.0 -> util-linux -> systemd -> shared-mime-info -> glib-2.0
> >
> > But the libmount PACKAGECONFIG can be removed from glib-2.0 to break its
> > dependency on util-linux.
> >
> > In addition, according to systemd's README [2], the dependencies on
> > libblkid and libfdisk from util-linux are optional, so add them as new
> > PACKAGECONFIGs.
> >
> > [1] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
> > [2] https://github.com/systemd/systemd/blob/main/README#L216
> >
> > Hiago De Franco (2):
> >   systemd: drop build dependency on util-linux
> >   systemd: add libblkid and libfdisk PACKAGECONFIG options
> >
> >  .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
> >  meta/recipes-core/systemd/systemd_257.6.bb    |  9 ++-
> >  2 files changed, 65 insertions(+), 2 deletions(-)
> >  create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> 
> Hi Hiago,
> 
> Thanks for your patches.
> 
> I suspect this series is responsible from a test failure:
> 
> Traceback (most recent call last):
>   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
>     return func(*args, **kwargs)
>   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 100, in test_systemd_failed
>     output += self.systemctl('status --full --failed')
>   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 26, in systemctl
>     self.assertEqual(status, expected, message)
> AssertionError: 3 != 0 : SYSTEMD_BUS_TIMEOUT=240s systemctl status --full --failed
> � systemd-boot-update.service - Automatic Boot Loader Update
>      Loaded: loaded (/usr/lib/systemd/system/systemd-boot-update.service; enabled; preset: enabled)
>      Active: failed (Result: exit-code) since Thu 2025-07-17 09:02:59 UTC; 25min ago
>  Invocation: a44df1a151da4bbfa387c056d59eb001
>        Docs: man:bootctl(1)
>    Main PID: 189 (code=exited, status=203/EXEC)
>    Mem peak: 828K
>         CPU: 58ms
> ...
> RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (9.36s)
> 
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/74/builds/2034
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/9/builds/2030
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/95/builds/2018
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/20/builds/2017
> 
> Can you have a look at this failure please?

Sure, I will take a look.

Best Regards,
Hiago.

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


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

* Re: [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs
  2025-07-17 12:57   ` Hiago De Franco
@ 2025-07-17 19:51     ` Hiago De Franco
  0 siblings, 0 replies; 9+ messages in thread
From: Hiago De Franco @ 2025-07-17 19:51 UTC (permalink / raw)
  To: Mathieu Dubois-Briand
  Cc: openembedded-core, Chen Qi, Alexander Kanavin, Hiago De Franco

On Thu, Jul 17, 2025 at 09:57:28AM -0300, Hiago De Franco wrote:
> Hi Mathieu,
> 
> On Thu, Jul 17, 2025 at 11:49:54AM +0200, Mathieu Dubois-Briand wrote:
> > On Thu Jul 17, 2025 at 1:29 AM CEST, Hiago De Franco via lists.openembedded.org wrote:
> > > From: Hiago De Franco <hiago.franco@toradex.com>
> > >
> > > The libmount dependency in systemd was made optional upstream [2]. This
> > > series backports that change, allowing us to drop util-linux as a build
> > > dependency for systemd. This resolves a circular dependency between
> > > util-linux and systemd when systemd PACKAGECONFIG is enabled in
> > > util-linux. Without this fix, each recipe depends on the other,
> > > triggering the circular dependency error.
> > >
> > > Note that this alone does not fully resolve the circular dependency
> > > on util-linux-fstrim/uuid. There is another one:
> > >
> > > glib-2.0 -> util-linux -> systemd -> shared-mime-info -> glib-2.0
> > >
> > > But the libmount PACKAGECONFIG can be removed from glib-2.0 to break its
> > > dependency on util-linux.
> > >
> > > In addition, according to systemd's README [2], the dependencies on
> > > libblkid and libfdisk from util-linux are optional, so add them as new
> > > PACKAGECONFIGs.
> > >
> > > [1] https://github.com/systemd/systemd/commit/d1ee3889cf8e8a9edc82e41d306155fb4c531c8f
> > > [2] https://github.com/systemd/systemd/blob/main/README#L216
> > >
> > > Hiago De Franco (2):
> > >   systemd: drop build dependency on util-linux
> > >   systemd: add libblkid and libfdisk PACKAGECONFIG options
> > >
> > >  .../0001-meson-Add-libmount-feature.patch     | 58 +++++++++++++++++++
> > >  meta/recipes-core/systemd/systemd_257.6.bb    |  9 ++-
> > >  2 files changed, 65 insertions(+), 2 deletions(-)
> > >  create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-libmount-feature.patch
> > 
> > Hi Hiago,
> > 
> > Thanks for your patches.
> > 
> > I suspect this series is responsible from a test failure:
> > 
> > Traceback (most recent call last):
> >   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
> >     return func(*args, **kwargs)
> >   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 100, in test_systemd_failed
> >     output += self.systemctl('status --full --failed')
> >   File "/srv/pokybuild/yocto-worker/qemuarm-alt/build/meta/lib/oeqa/runtime/cases/systemd.py", line 26, in systemctl
> >     self.assertEqual(status, expected, message)
> > AssertionError: 3 != 0 : SYSTEMD_BUS_TIMEOUT=240s systemctl status --full --failed
> > � systemd-boot-update.service - Automatic Boot Loader Update
> >      Loaded: loaded (/usr/lib/systemd/system/systemd-boot-update.service; enabled; preset: enabled)
> >      Active: failed (Result: exit-code) since Thu 2025-07-17 09:02:59 UTC; 25min ago
> >  Invocation: a44df1a151da4bbfa387c056d59eb001
> >        Docs: man:bootctl(1)
> >    Main PID: 189 (code=exited, status=203/EXEC)
> >    Mem peak: 828K
> >         CPU: 58ms
> > ...
> > RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (9.36s)
> > 
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/74/builds/2034
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/9/builds/2030
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/95/builds/2018
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/20/builds/2017
> > 
> > Can you have a look at this failure please?
> 
> Sure, I will take a look.

I was looking at it now and I was able to find the issue. We need to set
the new blkid PACKAGECONFIG from patch 2 as default, because this is
needed to build bootctl. I will fix this and send a v2.

Best regards,
Hiago.

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


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

end of thread, other threads:[~2025-07-17 19:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 23:29 [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Hiago De Franco
2025-07-16 23:29 ` [PATCH 1/2] systemd: drop build dependency on util-linux Hiago De Franco
2025-07-17  9:53   ` Alexander Kanavin
     [not found]   ` <1853013D626CB3EF.8991@lists.openembedded.org>
2025-07-17  9:56     ` [OE-core] " Alexander Kanavin
2025-07-17 12:55       ` Hiago De Franco
2025-07-16 23:29 ` [PATCH 2/2] systemd: add libblkid and libfdisk PACKAGECONFIG options Hiago De Franco
2025-07-17  9:49 ` [OE-core] [PATCH 0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs Mathieu Dubois-Briand
2025-07-17 12:57   ` Hiago De Franco
2025-07-17 19:51     ` Hiago De Franco

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