diff mbox series

[v2,2/2] systemd: add libblkid and libfdisk PACKAGECONFIG options

Message ID 20250717211621.7122-3-hiagofranco@gmail.com
State Accepted, archived
Commit 4ec67113e1e7e1ecea9cde33ef4d3962dad5f2ad
Headers show
Series systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs | expand

Commit Message

Hiago De Franco July 17, 2025, 9:16 p.m. UTC
From: Hiago De Franco <hiago.franco@toradex.com>

Introduce new PACKAGECONFIG options in systemd for both libblkid and
libfdisk [1][2].

Set blkid as enabled by default because the bootctl command depends
on it to be built. For example, images like core-image-sato-sdk rely on
bootctl and have specific tests for it.

Previously this worked implicitly because the upstream Meson option
defaulted to auto, which enabled the dependency if libblkid was present.
Now, without explicitly enabling it via PACKAGECONFIG, the feature would
be disabled, which triggers testimage errors.

[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>
---
v1->2:
- blkid set as default PACKAGECONFIG to fix an error where bootctl is
  not built anymore.
- commit description updated with blkid information.
---
 meta/recipes-core/systemd/systemd_257.6.bb | 3 +++
 1 file changed, 3 insertions(+)

Comments

Quentin Schulz July 21, 2025, 9:32 a.m. UTC | #1
Hi Hiago,

On 7/17/25 11:16 PM, Hiago De Franco via lists.openembedded.org wrote:
> From: Hiago De Franco <hiago.franco@toradex.com>
> 
> Introduce new PACKAGECONFIG options in systemd for both libblkid and
> libfdisk [1][2].
> 
> Set blkid as enabled by default because the bootctl command depends
> on it to be built. For example, images like core-image-sato-sdk rely on
> bootctl and have specific tests for it.
> 
> Previously this worked implicitly because the upstream Meson option
> defaulted to auto, which enabled the dependency if libblkid was present.
> Now, without explicitly enabling it via PACKAGECONFIG, the feature would
> be disabled, which triggers testimage errors.
> 

This seems important enough to be its own commit without the new fdisk 
PACKAGECONFIG so that it can be backported to stable release(s) if 
needed? I believe this is the result of commit 43abc59a275e ("meson: Use 
feature options") present in v255 (presnet in oe-core up to scarthgap 
apparently)?

Cheers,
Quentin
Hiago De Franco July 21, 2025, 1:50 p.m. UTC | #2
Hi Quentin,

On Mon, Jul 21, 2025 at 11:32:55AM +0200, Quentin Schulz wrote:
> Hi Hiago,
> 
> On 7/17/25 11:16 PM, Hiago De Franco via lists.openembedded.org wrote:
> > From: Hiago De Franco <hiago.franco@toradex.com>
> > 
> > Introduce new PACKAGECONFIG options in systemd for both libblkid and
> > libfdisk [1][2].
> > 
> > Set blkid as enabled by default because the bootctl command depends
> > on it to be built. For example, images like core-image-sato-sdk rely on
> > bootctl and have specific tests for it.
> > 
> > Previously this worked implicitly because the upstream Meson option
> > defaulted to auto, which enabled the dependency if libblkid was present.
> > Now, without explicitly enabling it via PACKAGECONFIG, the feature would
> > be disabled, which triggers testimage errors.
> > 
> 
> This seems important enough to be its own commit without the new fdisk
> PACKAGECONFIG so that it can be backported to stable release(s) if needed? I
> believe this is the result of commit 43abc59a275e ("meson: Use feature
> options") present in v255 (presnet in oe-core up to scarthgap apparently)?

I agree this does make sense, yes. I can send a v3 to separate fdisk and
blkid so we can later backport this to scarthgap. I will make a test
first and then send the patch later, if everything goes well.

> 
> Cheers,
> Quentin

Best regards,
Hiago.
Ross Burton July 22, 2025, 1:05 p.m. UTC | #3
On 17 Jul 2025, at 22:16, Hiago De Franco via lists.openembedded.org <hiagofranco=gmail.com@lists.openembedded.org> wrote:
> Introduce new PACKAGECONFIG options in systemd for both libblkid and
> libfdisk [1][2].
> 
> Set blkid as enabled by default because the bootctl command depends
> on it to be built. For example, images like core-image-sato-sdk rely on
> bootctl and have specific tests for it.
> 
> Previously this worked implicitly because the upstream Meson option
> defaulted to auto, which enabled the dependency if libblkid was present.
> Now, without explicitly enabling it via PACKAGECONFIG, the feature would
> be disabled, which triggers testimage errors.

Before this commit:

Run-time dependency fdisk found: YES 2.41.0
Run-time dependency blkid found: YES 2.41.0

So fdisk should be enabled too.

Further digging reveals that systemd itself will no longer call the blkid and fdisk binaries and simply uses the libraries, so the util-linux-blkid and util-linux-fdisk RDEPENDS are redundant.

Also, systemd links against libblkid and libfdisk directly so there’s no need to add RDEPENDS for those, especially not to just the systemd package when the actual linkage is in other places such as libsystemd.

I’ve sent a revert pending an iteration on these patches.

Ross
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
index d73c0cfe0d8b..0f358ea88f38 100644
--- a/meta/recipes-core/systemd/systemd_257.6.bb
+++ b/meta/recipes-core/systemd/systemd_257.6.bb
@@ -76,6 +76,7 @@  PACKAGECONFIG ??= " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit', 'link-udev-shared', d)} \
     backlight \
     binfmt \
+    blkid \
     gshadow \
     hibernate \
     hostnamed \
@@ -137,6 +138,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 +154,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"