From 0176020fa5f8dfcc2dc537aff61726248b2a26d0bc7a43ebd4b1ed6a3f3bf4e5 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 12 Mar 2014 15:08:08 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=550 --- systemd-big-endian-reply-matching.patch | 36 +++++++++++++++++++ systemd-mini.spec | 12 +++++-- systemd.spec | 2 +- ...rect-size-4-reply_cookie-4-bigendian.patch | 18 ---------- 4 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 systemd-big-endian-reply-matching.patch delete mode 100644 use-correct-size-4-reply_cookie-4-bigendian.patch diff --git a/systemd-big-endian-reply-matching.patch b/systemd-big-endian-reply-matching.patch new file mode 100644 index 00000000..bc456567 --- /dev/null +++ b/systemd-big-endian-reply-matching.patch @@ -0,0 +1,36 @@ +From: Olaf Kirch +Date: Date: Wed, 12 Mar 2014 13:52:50 +0000 +Subject: [PATCH] systemd big endian reply matching + +Reply matching on big endian architectures is broken in the dbus code. + +The hashmap functions, which are used to store and retrieves the reply_callback +structures of asynchronous calls, take a uint64_t pointer for the key argument. +However, the reply_cookie of the sd_bus_message is stored in a 32bit variable. + +This works nicely on x86-64, because (a) it's little endian, and (b) the struct +is padded to the next 8 byte boundary because reply_cookie is wedged between +two pointers. + +On s390x, this fails badly thanks to being big endian. + +Unfortunately, this results in complete failure of any communication +between systemd daemons and the dbus-daemon, because it never gets +past the initial Hello handshake - which is sent as an asynchronous +message. + +Signed-off-by: Olaf Kirch + +Index: systemd-210/src/libsystemd/sd-bus/bus-message.h +=================================================================== +--- systemd-210/src/libsystemd/sd-bus/bus-message.h ++++ systemd-210/src/libsystemd/sd-bus/bus-message.h +@@ -84,7 +84,7 @@ struct sd_bus_message { + + sd_bus *bus; + +- uint32_t reply_cookie; ++ uint64_t reply_cookie; + + const char *path; + const char *interface; diff --git a/systemd-mini.spec b/systemd-mini.spec index fb852850..83eed948 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -43,7 +43,6 @@ BuildRequires: audit-devel BuildRequires: binutils-gold %endif %if ! 0%{?bootstrap} -BuildRequires: dbus-1 BuildRequires: docbook-xsl-stylesheets %endif BuildRequires: fdupes @@ -204,7 +203,7 @@ Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin Patch46: use-usr-sbin-sulogin-for-emergency-service.patch # PATCH-FIX-OPENSUSE Make systemd talk with dbus-daemon even on big endian -Patch47: use-correct-size-4-reply_cookie-4-bigendian.patch +Patch47: systemd-big-endian-reply-matching.patch # PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) Patch84: make-emergency.service-conflict-with-syslog.socket.patch # PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch @@ -658,6 +657,10 @@ export V=1 %configure \ --docdir=%{_docdir}/systemd \ --with-pamlibdir=/%{_lib}/security \ + --with-dbuspolicydir=%{_sysconfdir}/dbus-1/system.d \ + --with-dbussessionservicedir=%{_datadir}/dbus-1/services \ + --with-dbussystemservicedir=%{_datadir}/dbus-1/system-services \ + --with-dbusinterfacedir=%{_datadir}/dbus-1/interfaces \ %if 0%{?bootstrap} --disable-gudev \ --disable-myhostname \ @@ -1178,7 +1181,12 @@ exit 0 %dir %{_sysconfdir}/systemd/system %dir %{_sysconfdir}/systemd/user %dir %{_sysconfdir}/xdg/systemd +%dir %{_sysconfdir}/dbus-1 +%dir %{_sysconfdir}/dbus-1/system.d %{_sysconfdir}/xdg/systemd/user +%dir %{_datadir}/dbus-1 +%dir %{_datadir}/dbus-1/services +%dir %{_datadir}/dbus-1/system-services %config(noreplace) %{_sysconfdir}/systemd/bootchart.conf %config(noreplace) %{_sysconfdir}/systemd/system.conf %config(noreplace) %{_sysconfdir}/systemd/logind.conf diff --git a/systemd.spec b/systemd.spec index 31955fda..1797e01e 100644 --- a/systemd.spec +++ b/systemd.spec @@ -198,7 +198,7 @@ Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin Patch46: use-usr-sbin-sulogin-for-emergency-service.patch # PATCH-FIX-OPENSUSE Make systemd talk with dbus-daemon even on big endian -Patch47: use-correct-size-4-reply_cookie-4-bigendian.patch +Patch47: systemd-big-endian-reply-matching.patch # PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) Patch84: make-emergency.service-conflict-with-syslog.socket.patch # PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch diff --git a/use-correct-size-4-reply_cookie-4-bigendian.patch b/use-correct-size-4-reply_cookie-4-bigendian.patch deleted file mode 100644 index 6021f601..00000000 --- a/use-correct-size-4-reply_cookie-4-bigendian.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Olaf Kirch -Date: Date: Wed, 12 Mar 2014 13:52:50 +0000 -Subject: [PATCH] Let systemd talk with dbus-daemon even on big endian - -Related to bug #866732 that is to help systemd to talk with dbus-daemon -on s390x. - ---- systemd-210/src/libsystemd/sd-bus/bus-message.h -+++ systemd-210/src/libsystemd/sd-bus/bus-message.h 2014-03-12 14:06:54.862235499 +0000 -@@ -84,7 +84,7 @@ struct sd_bus_message { - - sd_bus *bus; - -- uint32_t reply_cookie; -+ uint64_t reply_cookie; - - const char *path; - const char *interface;