Patchwork [1/5] connman: Upgrade to version 0.75

login
register
mail settings
Submitter Dongxiao Xu
Date June 21, 2011, 8:08 a.m.
Message ID <42f214f6550292a92714dc3e0d29eaf8d2e5d250.1308642976.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/6163/
State New, archived
Headers show

Comments

Dongxiao Xu - June 21, 2011, 8:08 a.m.
Enable ofono plugin.
Adopt some logic in meta-oe on connman plugin runtime dependency.
Remove the fix-shutdown-ap-disconnect.patch since the original logic no longer exists.
Add Upstream-Status information for patches.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 .../connman-0.65/fix-shutdown-ap-disconnect.patch  |   42 --------------------
 .../add_xuser_dbus_permission.patch                |    2 +
 .../connman/{connman-0.65 => connman-0.75}/connman |    0
 .../{connman-0.65 => connman-0.75}/dbusperms.patch |    2 +
 meta/recipes-connectivity/connman/connman.inc      |   16 ++++++-
 .../connman/{connman_0.65.bb => connman_0.75.bb}   |    8 ++--
 6 files changed, 21 insertions(+), 49 deletions(-)
 delete mode 100644 meta/recipes-connectivity/connman/connman-0.65/fix-shutdown-ap-disconnect.patch
 rename meta/recipes-connectivity/connman/{connman-0.65 => connman-0.75}/add_xuser_dbus_permission.patch (94%)
 rename meta/recipes-connectivity/connman/{connman-0.65 => connman-0.75}/connman (100%)
 rename meta/recipes-connectivity/connman/{connman-0.65 => connman-0.75}/dbusperms.patch (91%)
 rename meta/recipes-connectivity/connman/{connman_0.65.bb => connman_0.75.bb} (74%)
Phil Blundell - June 21, 2011, 9:12 a.m.
On Tue, 2011-06-21 at 16:08 +0800, Dongxiao Xu wrote:
> -DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
> -RDEPENDS_${PN} = "wpa-supplicant resolvconf"
> +DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"

What does the dependency stack for ofono look like?  If it's non-trivial
then I am not sure it is a good idea to add ofono to DEPENDS
unconditionally.

Ditto bluez4, I don't think that should be in there unless
DISTRO_FEATURES requested it.

p.
Koen Kooi - June 21, 2011, 9:20 a.m.
Op 21 jun 2011, om 11:12 heeft Phil Blundell het volgende geschreven:

> On Tue, 2011-06-21 at 16:08 +0800, Dongxiao Xu wrote:
>> -DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
>> -RDEPENDS_${PN} = "wpa-supplicant resolvconf"
>> +DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"
> 
> What does the dependency stack for ofono look like?  If it's non-trivial
> then I am not sure it is a good idea to add ofono to DEPENDS
> unconditionally.

dbus, glib-2.0 and udev, so that's not too bad. Only udev is "new", but connman already requires it since it dumped hal eons ago.

So the line should actually look like this:

>> DEPENDS  = "libgdbus dbus glib-2.0 udev iptables ofono wpa-supplicant resolvconf bluez4"
Anders Darander - June 21, 2011, 9:34 a.m.
On Tue, Jun 21, 2011 at 11:12, Phil Blundell <pb@pbcl.net> wrote:
> On Tue, 2011-06-21 at 16:08 +0800, Dongxiao Xu wrote:
>> -DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
>> -RDEPENDS_${PN} = "wpa-supplicant resolvconf"
>> +DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"
>
> What does the dependency stack for ofono look like?  If it's non-trivial
> then I am not sure it is a good idea to add ofono to DEPENDS
> unconditionally.

Although Koen showed that the dependcies were quite trivial, I'd
prefer to not build ofono if it is possible.

> Ditto bluez4, I don't think that should be in there unless
> DISTRO_FEATURES requested it.

Yes, I certainly agree with you on bluez4. If we don't have bluetooth
enabled for our machine/distro, I definitely prefere to not build it.

To me it's not only about the risk that we increase the rootfs, but
also about build-times. Even if we have quite fast machines today, it
is a waste of CPU cycles to build lots of SW that aren't going to be
used...

Adding a dependency etc is easily done in a bbappen-file, which makes
the reversed desire quite easy. I'm not sure if there is an easy way
of removing item from e.g. DEPENDS and EXTRA_OECONF etc.

Regards,
Anders
Koen Kooi - June 21, 2011, 9:54 a.m.
Op 21 jun 2011, om 11:34 heeft Anders Darander het volgende geschreven:

> On Tue, Jun 21, 2011 at 11:12, Phil Blundell <pb@pbcl.net> wrote:
>> On Tue, 2011-06-21 at 16:08 +0800, Dongxiao Xu wrote:
>>> -DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
>>> -RDEPENDS_${PN} = "wpa-supplicant resolvconf"
>>> +DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"
>> 
>> What does the dependency stack for ofono look like?  If it's non-trivial
>> then I am not sure it is a good idea to add ofono to DEPENDS
>> unconditionally.
> 
> Although Koen showed that the dependcies were quite trivial, I'd
> prefer to not build ofono if it is possible.
> 
>> Ditto bluez4, I don't think that should be in there unless
>> DISTRO_FEATURES requested it.
> 
> Yes, I certainly agree with you on bluez4. If we don't have bluetooth
> enabled for our machine/distro, I definitely prefere to not build it.
> 
> To me it's not only about the risk that we increase the rootfs, but
> also about build-times. Even if we have quite fast machines today, it
> is a waste of CPU cycles to build lots of SW that aren't going to be
> used...
> 
> Adding a dependency etc is easily done in a bbappen-file, which makes
> the reversed desire quite easy. I'm not sure if there is an easy way
> of removing item from e.g. DEPENDS and EXTRA_OECONF etc.

I'd trade extra build time over not having to use bbappends anytime. Especially where upstream has proper plugin support like connman.
Anders Darander - June 21, 2011, 10:39 a.m.
On Tue, Jun 21, 2011 at 11:54, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 21 jun 2011, om 11:34 heeft Anders Darander het volgende geschreven:
>
>> On Tue, Jun 21, 2011 at 11:12, Phil Blundell <pb@pbcl.net> wrote:
>>> On Tue, 2011-06-21 at 16:08 +0800, Dongxiao Xu wrote:
>>>> -DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
>>>> -RDEPENDS_${PN} = "wpa-supplicant resolvconf"
>>>> +DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"
>>>
>>> What does the dependency stack for ofono look like?  If it's non-trivial
>>> then I am not sure it is a good idea to add ofono to DEPENDS
>>> unconditionally.
>>
>> Although Koen showed that the dependcies were quite trivial, I'd
>> prefer to not build ofono if it is possible.
>>
>>> Ditto bluez4, I don't think that should be in there unless
>>> DISTRO_FEATURES requested it.
>>
>> Yes, I certainly agree with you on bluez4. If we don't have bluetooth
>> enabled for our machine/distro, I definitely prefere to not build it.
>>
>> To me it's not only about the risk that we increase the rootfs, but
>> also about build-times. Even if we have quite fast machines today, it
>> is a waste of CPU cycles to build lots of SW that aren't going to be
>> used...
>>
>> Adding a dependency etc is easily done in a bbappen-file, which makes
>> the reversed desire quite easy. I'm not sure if there is an easy way
>> of removing item from e.g. DEPENDS and EXTRA_OECONF etc.
>
> I'd trade extra build time over not having to use bbappends anytime. Especially where upstream has proper plugin support like connman.

In cases like connman (with proper plugin-support, and a good
packaging), yes, then it is only about build time. And sure, in some
cases I completely agree with you.

However, occasionally when building a really tiny image adding a small
package could result in a complete build of X and lots of other stuff.
In such cases it's not always that funny. (Sorry, it was a long time
ago on .dev that this happened, so I don't remember what package it
was). Apart from these kind of situations, it's normally not a big
problem, unless you're in a development stage where you need frequent
clean rebuilds...

(Another drawback, although it is really only on the first build, is
that building lots of unnecessary packages increases the risk of
build/fetch problems.)

Currently I can't access cgit.openembedded.org (probably the local
network), so I can't check it. But isn't e.g. bluetooth found
somewhere in either DISTRO_FEATURES or MACHINE_FEATURES? If so, bluez4
and configure options should probably be set conditionally.

/Anders

Patch

diff --git a/meta/recipes-connectivity/connman/connman-0.65/fix-shutdown-ap-disconnect.patch b/meta/recipes-connectivity/connman/connman-0.65/fix-shutdown-ap-disconnect.patch
deleted file mode 100644
index a0ad099..0000000
--- a/meta/recipes-connectivity/connman/connman-0.65/fix-shutdown-ap-disconnect.patch
+++ /dev/null
@@ -1,42 +0,0 @@ 
-Schedule delayed scan when being disconnected from an AP
-
-When being disconnected from an AP, a delayed scan is scheduled to make
-sure the AP is still there. wpa_supplicant removes a BSS from its bss list
-when it disappears from the scan results twice in a row.
-
-Author: Samuel Ortiz <sameo@linux.intel.com>
-Ported by Dongxiao Xu <dongxiao.xu@intel.com>
-
-diff -ruN connman-0.56-orig/plugins/supplicant.c connman-0.56/plugins/supplicant.c
---- connman-0.56-orig/plugins/supplicant.c	2010-09-25 15:08:21.242927383 +0800
-+++ connman-0.56/plugins/supplicant.c	2010-09-25 15:12:46.346136858 +0800
-@@ -2184,6 +2184,15 @@
- 				scanning == TRUE ? "started" : "finished");
- }
- 
-+static gboolean delayed_scan(gpointer user_data)
-+{
-+	struct supplicant_task *task = user_data;
-+
-+	supplicant_scan(task->device);
-+
-+	return FALSE;
-+}
-+
- static void state_change(struct supplicant_task *task, DBusMessage *msg)
- {
- 	DBusError error;
-@@ -2277,7 +2286,13 @@
- 				task_connect(task);
- 			} else
- 				task->network = NULL;
-+		} else {
-+			if (task->state == WPA_DISCONNECTED)
-+				g_timeout_add_seconds(10, delayed_scan, task);
-+
-+			remove_network(task);
- 		}
-+
- 		break;
- 
- 	default:
diff --git a/meta/recipes-connectivity/connman/connman-0.65/add_xuser_dbus_permission.patch b/meta/recipes-connectivity/connman/connman-0.75/add_xuser_dbus_permission.patch
similarity index 94%
rename from meta/recipes-connectivity/connman/connman-0.65/add_xuser_dbus_permission.patch
rename to meta/recipes-connectivity/connman/connman-0.75/add_xuser_dbus_permission.patch
index 787d49b..764c689 100644
--- a/meta/recipes-connectivity/connman/connman-0.65/add_xuser_dbus_permission.patch
+++ b/meta/recipes-connectivity/connman/connman-0.75/add_xuser_dbus_permission.patch
@@ -1,6 +1,8 @@ 
 Some platform (like atom-pc) enables rootless X,
 thus we need to add the xuser in the list.
 
+Upstream-Status: Inappropriate [configuration]
+
 Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
 
 diff -ruN connman-0.65-orig/src/connman-dbus.conf connman-0.65/src/connman-dbus.conf
diff --git a/meta/recipes-connectivity/connman/connman-0.65/connman b/meta/recipes-connectivity/connman/connman-0.75/connman
similarity index 100%
rename from meta/recipes-connectivity/connman/connman-0.65/connman
rename to meta/recipes-connectivity/connman/connman-0.75/connman
diff --git a/meta/recipes-connectivity/connman/connman-0.65/dbusperms.patch b/meta/recipes-connectivity/connman/connman-0.75/dbusperms.patch
similarity index 91%
rename from meta/recipes-connectivity/connman/connman-0.65/dbusperms.patch
rename to meta/recipes-connectivity/connman/connman-0.75/dbusperms.patch
index 100af03..c331654 100644
--- a/meta/recipes-connectivity/connman/connman-0.65/dbusperms.patch
+++ b/meta/recipes-connectivity/connman/connman-0.75/dbusperms.patch
@@ -1,3 +1,5 @@ 
+Upstream-Status: Inappropriate [configuration]
+
 Index: git/src/connman-dbus.conf
 ===================================================================
 --- git.orig/src/connman-dbus.conf	2009-05-26 00:34:35.000000000 +0100
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index fb970ed..0f33deb 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -13,8 +13,7 @@  LICENSE  = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
                     file://src/main.c;beginline=1;endline=20;md5=4b55b550fa6b33cc2055ef30dd262b3e"
 
-DEPENDS  = "libgdbus dbus glib-2.0 hal iptables"
-RDEPENDS_${PN} = "wpa-supplicant resolvconf"
+DEPENDS  = "libgdbus dbus glib-2.0 hal iptables ofono wpa-supplicant resolvconf bluez4"
 
 INITSCRIPT_NAME = "connman"
 INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
@@ -40,7 +39,18 @@  FILES_${PN}-dbg += "${libdir}/connman/plugins/.debug \
                     ${libdir}/connman/scripts/.debug"
 
 python populate_packages_prepend() {
+	depmap = dict( wifi="wpa-supplicant", resolvconf="resolvconf", bluetooth="bluez4", ofono="ofono" )
+	packages = []
+	hook = lambda file,pkg,b,c,d:packages.append((file,pkg))
+
 	plugin_dir = bb.data.expand('${libdir}/connman/plugins/', d)
 	plugin_name = bb.data.expand('${PN}-plugin-%s', d)
-	do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, '${PN} plugin for %s', extra_depends='' )
+
+	do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, '${PN} plugin for %s', extra_depends='', hook=hook )
+
+	for (file, package) in packages:
+		plugintype = package.split( '-' )[-1]
+		if plugintype in depmap:
+			bb.note( "Adding rdependency on %s to package %s" % ( depmap[plugintype], package ) )
+			bb.data.setVar("RDEPENDS_%s" % package, depmap[plugintype], d)
 }
diff --git a/meta/recipes-connectivity/connman/connman_0.65.bb b/meta/recipes-connectivity/connman/connman_0.75.bb
similarity index 74%
rename from meta/recipes-connectivity/connman/connman_0.65.bb
rename to meta/recipes-connectivity/connman/connman_0.75.bb
index 852f8dc..75ef5b5 100644
--- a/meta/recipes-connectivity/connman/connman_0.65.bb
+++ b/meta/recipes-connectivity/connman/connman_0.75.bb
@@ -1,5 +1,5 @@ 
 require connman.inc
-PR = "r1"
+PR = "r0"
 
 EXTRA_OECONF += "\
   ac_cv_path_WPASUPPLICANT=/usr/sbin/wpa_supplicant \
@@ -16,14 +16,14 @@  EXTRA_OECONF += "\
   --disable-udev \
   --disable-polkit \
   --enable-client \
+  --enable-ofono \
   --prefix=/usr --sysconfdir=/etc --localstatedir=/var"
 
 SRC_URI  = "\
   ${KERNELORG_MIRROR}/linux/network/connman/connman-${PV}.tar.gz \
-  file://fix-shutdown-ap-disconnect.patch \
   file://add_xuser_dbus_permission.patch \
   file://connman \
 "
 
-SRC_URI[md5sum] = "bd714da295ed2d2d91a49539f4c4fa3a"
-SRC_URI[sha256sum] = "a1c1d93da6bb4c2d8ae53293b06f237e02f5e796d2bba73ec639a466d05259c3"
+SRC_URI[md5sum] = "9973cb89a11fff6b51fc85b51c13b711"
+SRC_URI[sha256sum] = "b15361237f7ec8092fb0e55d4585550ab35491485edaf10ddd032d6e36299db7"