mbox series

[0/2] systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs

Message ID 20250716232931.127811-1-hiagofranco@gmail.com
Headers show
Series systemd: drop libmount dependency and add blkid and fdisk PACKAGECONFIGs | expand

Message

Hiago De Franco July 16, 2025, 11:29 p.m. UTC
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

Comments

Mathieu Dubois-Briand July 17, 2025, 9:49 a.m. UTC | #1
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?
Hiago De Franco July 17, 2025, 12:57 p.m. UTC | #2
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
>
Hiago De Franco July 17, 2025, 7:51 p.m. UTC | #3
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
> >