From ffda68f5e31bcda8bba80cef332713e9443e587e5302b7f2937813f4f623e029 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 25 Sep 2012 09:12:42 +0000 Subject: [PATCH 1/2] Accepting request 127057 from home:tiwai:branches:Base:System - Add a check of running systemd (bnc#769570) OBS-URL: https://build.opensuse.org/request/show/127057 OBS-URL: https://build.opensuse.org/package/show/Base:System/udisks2?expand=0&rev=12 --- systemd-dynamic-check.diff | 20 ++++++++++++++++++++ udisks2.changes | 5 +++++ udisks2.spec | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 systemd-dynamic-check.diff diff --git a/systemd-dynamic-check.diff b/systemd-dynamic-check.diff new file mode 100644 index 0000000..944f537 --- /dev/null +++ b/systemd-dynamic-check.diff @@ -0,0 +1,20 @@ +--- + src/udisksdaemonutil.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/src/udisksdaemonutil.c ++++ b/src/udisksdaemonutil.c +@@ -899,7 +899,12 @@ udisks_daemon_util_on_same_seat (UDisksD + + /* If we don't know the seat of the caller, we assume the device is always on another seat */ + if (seat == NULL) +- goto out; ++ { ++ /* no systemd running? */ ++ if (access("/sys/fs/cgroup/systemd", R_OK)) ++ ret = TRUE; ++ goto out; ++ } + + drive_seat = udisks_drive_get_seat (drive); + if (g_strcmp0 (seat, drive_seat) == 0) diff --git a/udisks2.changes b/udisks2.changes index 4565ef7..31bb590 100644 --- a/udisks2.changes +++ b/udisks2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 3 15:39:33 CEST 2012 - tiwai@suse.de + +- Add a check of running systemd (bnc#769570) + ------------------------------------------------------------------- Tue Jun 26 18:18:09 UTC 2012 - gber@opensuse.org diff --git a/udisks2.spec b/udisks2.spec index ebc6c91..4d99e31 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -27,6 +27,8 @@ Url: http://www.freedesktop.org/wiki/Software/udisks Source: http://udisks.freedesktop.org/releases/%{_name}-%{version}.tar.bz2 # PATCH-FIX-UPSTREAM udisks-hide-lvm-raid-partitions.patch fdo#51439 bnc#737038 gber@opensuse.org -- Hide partitions marked as containing LVM and RAID. This is only useful for encrypted partitions. Patch0: udisks-hide-lvm-raid-partitions.patch +# PATCH-FIX-OPENSUSE systemd-dynamic-check.diff bnc#769570 tiwai@suse.de -- Add a check of running systemd so that it still works with sysvinit +Patch1: systemd-dynamic-check.diff # Needed to build the man pages BuildRequires: docbook-xsl-stylesheets BuildRequires: gobject-introspection-devel @@ -92,6 +94,7 @@ for managing disks and storage devices. %prep %setup -q -n %{_name}-%{version} %patch0 -p1 +%patch1 -p1 %build export V=1 From c2b5d3b8339f52324948aedf1432ff429716c1e4d1aeadfbff6a05b9ee99a06f Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 25 Sep 2012 09:19:16 +0000 Subject: [PATCH 2/2] Accepting request 135840 from home:vuntz:branches:Base:System Update patch with the one sent upstream OBS-URL: https://build.opensuse.org/request/show/135840 OBS-URL: https://build.opensuse.org/package/show/Base:System/udisks2?expand=0&rev=13 --- systemd-dynamic-check.diff | 59 ++++++++++++++++++++++++++++---------- udisks2.changes | 10 ++++++- udisks2.spec | 6 +++- 3 files changed, 58 insertions(+), 17 deletions(-) diff --git a/systemd-dynamic-check.diff b/systemd-dynamic-check.diff index 944f537..538d152 100644 --- a/systemd-dynamic-check.diff +++ b/systemd-dynamic-check.diff @@ -1,20 +1,49 @@ ---- - src/udisksdaemonutil.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) +commit ce5a67127223e99ffdbf9cb697537c689e2fe364 +Author: Vincent Untz +Date: Tue Sep 25 10:55:31 2012 +0200 + Fix same seat detection if built with systemd, but not booted with it + + If we haven't booted with systemd, then we can only assume it's always + the same seat. + + Based on patch by Takashi Iwai . + + https://bugzilla.novell.com/show_bug.cgi?id=769570 + +diff --git a/configure.ac b/configure.ac +index 994fd1a..93c715e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -145,7 +145,7 @@ AC_SUBST(LIBATASMART_CFLAGS) + AC_SUBST(LIBATASMART_LIBS) + + PKG_CHECK_MODULES(LIBSYSTEMD_LOGIN, +- [libsystemd-login >= 44], ++ [libsystemd-login >= 44 libsystemd-daemon], + have_libsystemd_login=yes, + have_libsystemd_login=no) + AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, test x$have_libsystemd_login = xyes) +diff --git a/src/udisksdaemonutil.c b/src/udisksdaemonutil.c +index ef925f5..69cd8a5 100644 --- a/src/udisksdaemonutil.c +++ b/src/udisksdaemonutil.c -@@ -899,7 +899,12 @@ udisks_daemon_util_on_same_seat (UDisksD +@@ -42,6 +42,7 @@ + #include "udiskslinuxdriveobject.h" - /* If we don't know the seat of the caller, we assume the device is always on another seat */ - if (seat == NULL) -- goto out; -+ { -+ /* no systemd running? */ -+ if (access("/sys/fs/cgroup/systemd", R_OK)) -+ ret = TRUE; -+ goto out; -+ } + #if defined(HAVE_LIBSYSTEMD_LOGIN) ++#include + #include + #endif - drive_seat = udisks_drive_get_seat (drive); - if (g_strcmp0 (seat, drive_seat) == 0) +@@ -1021,6 +1022,10 @@ udisks_daemon_util_on_same_seat (UDisksDaemon *daemon, + UDisksObject *drive_object = NULL; + UDisksDrive *drive = NULL; + ++ /* if we haven't booted with systemd, assume it's always the same seat */ ++ if (sd_booted () <= 0) ++ return TRUE; ++ + if (UDISKS_IS_LINUX_BLOCK_OBJECT (object)) + { + UDisksLinuxBlockObject *linux_block_object; diff --git a/udisks2.changes b/udisks2.changes index 31bb590..8082381 100644 --- a/udisks2.changes +++ b/udisks2.changes @@ -1,7 +1,15 @@ +------------------------------------------------------------------- +Tue Sep 25 09:14:34 UTC 2012 - vuntz@opensuse.org + +- Update systemd-dynamic-check.diff with patch sent upstream. +- Add gnome-common BuildRequires and call to gnome-autogen.sh, as + needed by the patch now. + ------------------------------------------------------------------- Tue Jul 3 15:39:33 CEST 2012 - tiwai@suse.de -- Add a check of running systemd (bnc#769570) +- Add systemd-dynamic-check.diff: add a check of running systemd + (bnc#769570) ------------------------------------------------------------------- Tue Jun 26 18:18:09 UTC 2012 - gber@opensuse.org diff --git a/udisks2.spec b/udisks2.spec index 4d99e31..c04412b 100644 --- a/udisks2.spec +++ b/udisks2.spec @@ -27,10 +27,12 @@ Url: http://www.freedesktop.org/wiki/Software/udisks Source: http://udisks.freedesktop.org/releases/%{_name}-%{version}.tar.bz2 # PATCH-FIX-UPSTREAM udisks-hide-lvm-raid-partitions.patch fdo#51439 bnc#737038 gber@opensuse.org -- Hide partitions marked as containing LVM and RAID. This is only useful for encrypted partitions. Patch0: udisks-hide-lvm-raid-partitions.patch -# PATCH-FIX-OPENSUSE systemd-dynamic-check.diff bnc#769570 tiwai@suse.de -- Add a check of running systemd so that it still works with sysvinit +# PATCH-FIX-UPSTREAM systemd-dynamic-check.diff fdo#55309 bnc#769570 tiwai@suse.de -- Add a check of running systemd so that it still works with sysvinit Patch1: systemd-dynamic-check.diff # Needed to build the man pages BuildRequires: docbook-xsl-stylesheets +# needed for patch1 +BuildRequires: gnome-common BuildRequires: gobject-introspection-devel BuildRequires: intltool BuildRequires: libacl-devel @@ -98,6 +100,8 @@ for managing disks and storage devices. %build export V=1 +# needed for patch1 +NOCONFIGURE=1 gnome-autogen.sh %configure \ --disable-static make %{?_smp_mflags}