RPM ships a systemd inhibit plugin, that will tell systemd to inhibit a
reboot or sleep during a package upgrades.

For native RPM this is entirely useless, and for target it's only useful
if you're using systemd+logind+rpm.

This plugin uses DBus which means it depends on expat -> cmake-native ->
libarchive-native curl-native, which is quite a dependency tree to need
in early build (required to build packages via rpm-native).

It was previously forcibly disabled for native packages but the build
dependency on DBus remained.  Remove that logic and add a PACKAGECONFIG
for the plugin that is only enabled for target builds with systemd and
explicitly disabled for native/nativesdk builds.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/recipes-devtools/rpm/rpm_4.15.1.bb | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-devtools/rpm/rpm_4.15.1.bb 
b/meta/recipes-devtools/rpm/rpm_4.15.1.bb
index 71e2c033fd..a5b811087b 100644
--- a/meta/recipes-devtools/rpm/rpm_4.15.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.15.1.bb
@@ -49,7 +49,7 @@ SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3"
 
 S = "${WORKDIR}/git"
 
-DEPENDS = "openssl db file popt xz bzip2 dbus elfutils python3"
+DEPENDS = "openssl db file popt xz bzip2 elfutils python3"
 DEPENDS_append_class-native = " file-replacement-native 
bzip2-replacement-native"
 
 inherit autotools gettext pkgconfig python3native
@@ -62,18 +62,19 @@ EXTRA_OECONF_append = " --without-lua --enable-python 
--with-crypto=openssl"
 EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp"
 
 # --sysconfdir prevents rpm from attempting to access machine-specific 
configuration in sysroot/etc; we need to have it in rootfs
-#
 # --localstatedir prevents rpm from writing its database to native sysroot 
when building images
-#
-# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via 
session dbus even when plugins support is enabled.
-# Also disable plugins by default for native.
-EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var 
--disable-plugins"
-EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins"
+EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var"
+EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc"
 
 BBCLASSEXTEND = "native nativesdk"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'inhibit', '', d)}"
+# The inhibit plugin serves no purpose outside of the target
+PACKAGECONFIG_remove_class-native = "inhibit"
+PACKAGECONFIG_remove_class-nativesdk = "inhibit"
+
 PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
+PACKAGECONFIG[inhibit] = 
"--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
 PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
 
 ASNEEDED = ""
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#142867): 
https://lists.openembedded.org/g/openembedded-core/message/142867
Mute This Topic: https://lists.openembedded.org/mt/77177694/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to