The dbus.socket user unit file calls systemctl, and the meson.build uses
find_program() to find the path, falling back to a hardcoded value if it
cannot be found.

On the initial build the sysroot doesn't contain systemctl (as it is not
in the target systemd sysroot), however after the do_package_write_*
tasks have completed there is a systemd-systemctl-native recipe in the
sysroot which will be found and result in host paths being in the target
packages, specifically in /usr/lib/systemd/user/dbus.socket:

  
ExecStartPost=-/work/ross/build/tmp/work/core2-64-poky-linux/dbus/1.16.0/recipe-sysroot-native/usr/bin/systemctl

This can be replicated by forcing a rebuild after a forced packaging:

$ bitbake dbus -C do_package_write_ipk
$ bitbake dbus -C configure
ERROR: dbus-1.16.0-r0 do_package_qa: QA Issue: File
/usr/lib/systemd/user/dbus.socket in package dbus-common contains
reference to TMPDIR [buildpaths]

We could do the unit mask manually instead of using systemctl (as it's
just a symlink) but the hardcoded path is still wrong, so write a small
Meson cross file to specify where the binary is.

Signed-off-by: Ross Burton <ross.bur...@arm.com>
---
 meta/recipes-core/dbus/dbus_1.16.0.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/recipes-core/dbus/dbus_1.16.0.bb 
b/meta/recipes-core/dbus/dbus_1.16.0.bb
index f516273cc77..80e766f9592 100644
--- a/meta/recipes-core/dbus/dbus_1.16.0.bb
+++ b/meta/recipes-core/dbus/dbus_1.16.0.bb
@@ -124,6 +124,16 @@ pkg_postinst:dbus() {
        fi
 }
 
+# dbus uses find_program() to find systemctl, which results in a build path in 
the
+# user dbus.socket
+EXTRA_OEMESON:append:class-target = " --cross-file=${WORKDIR}/dbus.cross"
+
+do_configure:prepend:class-target() {
+    cat >${WORKDIR}/dbus.cross <<EOF
+[binaries]
+systemctl = '${bindir}/systemctl'
+EOF
+}
 
 do_install:append:class-target() {
        if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', 
d)}; then
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#210983): 
https://lists.openembedded.org/g/openembedded-core/message/210983
Mute This Topic: https://lists.openembedded.org/mt/111053946/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to