aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/connman
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/connman')
-rw-r--r--recipes-connectivity/connman/connman-gnome/3g.patch507
-rw-r--r--recipes-connectivity/connman/connman-gnome/security-type.patch41
-rw-r--r--recipes-connectivity/connman/connman-gnome_0.5.bb66
-rw-r--r--recipes-connectivity/connman/connman.inc105
-rw-r--r--recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch46
-rw-r--r--recipes-connectivity/connman/connman/connman124
-rw-r--r--recipes-connectivity/connman/connman/disable_alg-test.patch46
-rw-r--r--recipes-connectivity/connman/connman/ethernet_default.patch44
-rw-r--r--recipes-connectivity/connman/connman_0.78.bb24
9 files changed, 851 insertions, 152 deletions
diff --git a/recipes-connectivity/connman/connman-gnome/3g.patch b/recipes-connectivity/connman/connman-gnome/3g.patch
new file mode 100644
index 0000000..58fa5e6
--- /dev/null
+++ b/recipes-connectivity/connman/connman-gnome/3g.patch
@@ -0,0 +1,507 @@
+Upstream-Status: Pending
+
+commit 15852e826b0b47f577718ada4b68b63515387f4d
+Author: dongxiao <dongxiao@dongxiao-osel.(none)>
+Date: Wed Jun 1 14:56:16 2011 +0800
+
+ connman-gnome: Add cellular network config option.
+
+ Add cellular network config option in connman-gnome.
+
+ Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff --git a/common/connman-client.c b/common/connman-client.c
+index e907cc2..d6be363 100644
+--- a/common/connman-client.c
++++ b/common/connman-client.c
+@@ -112,9 +112,10 @@ static void connman_client_init(ConnmanClient *client)
+ G_TYPE_STRING, /* address */
+ G_TYPE_STRING, /* netmask */
+ G_TYPE_STRING, /* gateway */
+- G_TYPE_BOOLEAN, /* gateway */
+- G_TYPE_BOOLEAN, /* gateway */
+- G_TYPE_BOOLEAN);/* gateway */
++ G_TYPE_BOOLEAN, /* ethernet enabled */
++ G_TYPE_BOOLEAN, /* wifi enabled */
++ G_TYPE_BOOLEAN, /* cellular enabled */
++ G_TYPE_BOOLEAN);/* offline */
+
+ g_object_set_data(G_OBJECT(priv->store),
+ "State", g_strdup("unavailable"));
+@@ -218,6 +219,7 @@ static gboolean device_filter(GtkTreeModel *model,
+ switch (type) {
+ case CONNMAN_TYPE_LABEL_ETHERNET:
+ case CONNMAN_TYPE_LABEL_WIFI:
++ case CONNMAN_TYPE_LABEL_CELLULAR:
+ case CONNMAN_TYPE_SYSCONFIG:
+ return TRUE;
+ }
+diff --git a/common/connman-client.h b/common/connman-client.h
+index 37e86d0..15fa098 100644
+--- a/common/connman-client.h
++++ b/common/connman-client.h
+@@ -117,6 +117,7 @@ enum {
+
+ CONNMAN_COLUMN_ETHERNET_ENABLED,/* G_TYPE_STRING */
+ CONNMAN_COLUMN_WIFI_ENABLED, /* G_TYPE_STRING */
++ CONNMAN_COLUMN_CELLULAR_ENABLED,/* G_TYPE_STRING */
+ CONNMAN_COLUMN_OFFLINEMODE, /* G_TYPE_STRING */
+
+ _CONNMAN_NUM_COLUMNS
+@@ -132,6 +133,7 @@ enum {
+
+ CONNMAN_TYPE_LABEL_ETHERNET,
+ CONNMAN_TYPE_LABEL_WIFI,
++ CONNMAN_TYPE_LABEL_CELLULAR,
+ CONNMAN_TYPE_SYSCONFIG,
+
+ _CONNMAN_NUM_TYPE,
+diff --git a/common/connman-dbus.c b/common/connman-dbus.c
+index b5a635c..0f4e1db 100644
+--- a/common/connman-dbus.c
++++ b/common/connman-dbus.c
+@@ -208,6 +208,8 @@ static const gchar *type2icon(guint type)
+ case CONNMAN_TYPE_WIFI:
+ case CONNMAN_TYPE_WIMAX:
+ return "network-wireless";
++ case CONNMAN_TYPE_CELLULAR:
++ return "network-cellular";
+ case CONNMAN_TYPE_BLUETOOTH:
+ return "bluetooth";
+ }
+@@ -220,6 +222,7 @@ static void enabled_technologies_changed(GtkTreeStore *store, GValue *value)
+ GtkTreeIter iter;
+ gboolean ethernet_enabled_prev, ethernet_enabled = FALSE;
+ gboolean wifi_enabled_prev, wifi_enabled = FALSE;
++ gboolean cellular_enabled_prev, cellular_enabled = FALSE;
+ gchar **tech = g_value_get_boxed (value);
+ guint i;
+
+@@ -227,10 +230,13 @@ static void enabled_technologies_changed(GtkTreeStore *store, GValue *value)
+ return;
+
+ for (i = 0; i < g_strv_length(tech); i++) {
++ DBG("technology: %s", *(tech+i));
+ if (g_str_equal("ethernet", *(tech + i)))
+ ethernet_enabled = TRUE;
+ else if (g_str_equal ("wifi", *(tech + i)))
+ wifi_enabled = TRUE;
++ else if (g_str_equal ("cellular", *(tech + i)))
++ cellular_enabled = TRUE;
+ }
+
+ get_iter_from_type(store, &iter, CONNMAN_TYPE_LABEL_ETHERNET);
+@@ -246,6 +252,13 @@ static void enabled_technologies_changed(GtkTreeStore *store, GValue *value)
+ if (wifi_enabled_prev != wifi_enabled)
+ gtk_tree_store_set(store, &iter,
+ CONNMAN_COLUMN_WIFI_ENABLED, wifi_enabled, -1);
++
++ get_iter_from_type(store, &iter, CONNMAN_TYPE_LABEL_CELLULAR);
++ gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
++ CONNMAN_COLUMN_CELLULAR_ENABLED, &cellular_enabled_prev, -1);
++ if (cellular_enabled_prev != cellular_enabled)
++ gtk_tree_store_set(store, &iter,
++ CONNMAN_COLUMN_CELLULAR_ENABLED, cellular_enabled, -1);
+ }
+
+ static void enabled_technologies_properties(GtkTreeStore *store, DBusGProxy *proxy, GValue *value)
+@@ -253,14 +266,18 @@ static void enabled_technologies_properties(GtkTreeStore *store, DBusGProxy *pro
+ GtkTreeIter iter;
+ gboolean ethernet_enabled = FALSE;
+ gboolean wifi_enabled = FALSE;
++ gboolean cellular_enabled = FALSE;
+ gchar **tech = g_value_get_boxed (value);
+ guint i;
+
+ for (i = 0; i < g_strv_length (tech); i++) {
++ DBG("technology: %s", *(tech+i));
+ if (g_str_equal("ethernet", *(tech + i)))
+ ethernet_enabled = TRUE;
+ else if (g_str_equal ("wifi", *(tech + i)))
+ wifi_enabled = TRUE;
++ else if (g_str_equal ("cellular", *(tech + i)))
++ cellular_enabled = TRUE;
+ }
+
+ if (get_iter_from_type(store, &iter, CONNMAN_TYPE_LABEL_ETHERNET) == FALSE)
+@@ -280,6 +297,15 @@ static void enabled_technologies_properties(GtkTreeStore *store, DBusGProxy *pro
+ CONNMAN_COLUMN_WIFI_ENABLED, wifi_enabled,
+ CONNMAN_COLUMN_TYPE, CONNMAN_TYPE_LABEL_WIFI,
+ -1);
++
++ if (get_iter_from_type(store, &iter, CONNMAN_TYPE_LABEL_CELLULAR) == FALSE)
++ gtk_tree_store_append(store, &iter, NULL);
++
++ gtk_tree_store_set(store, &iter,
++ CONNMAN_COLUMN_PROXY, proxy,
++ CONNMAN_COLUMN_CELLULAR_ENABLED, cellular_enabled,
++ CONNMAN_COLUMN_TYPE, CONNMAN_TYPE_LABEL_CELLULAR,
++ -1);
+ }
+
+ static void offline_mode_changed(GtkTreeStore *store, GValue *value)
+@@ -497,6 +523,9 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
+ case CONNMAN_TYPE_WIFI:
+ label_type = CONNMAN_TYPE_LABEL_WIFI;
+ break;
++ case CONNMAN_TYPE_CELLULAR:
++ label_type = CONNMAN_TYPE_LABEL_CELLULAR;
++ break;
+ default:
+ label_type = CONNMAN_TYPE_UNKNOWN;
+ break;
+diff --git a/icons/connman-type-cellular.png b/icons/connman-type-cellular.png
+new file mode 100644
+index 0000000..386abd5
+Binary files /dev/null and b/icons/connman-type-cellular.png differ
+diff --git a/properties/Makefile.am b/properties/Makefile.am
+index fc1b8c6..30ae442 100644
+--- a/properties/Makefile.am
++++ b/properties/Makefile.am
+@@ -1,7 +1,7 @@
+
+ bin_PROGRAMS = connman-properties
+
+-connman_properties_SOURCES = main.c advanced.h ethernet.c wifi.c
++connman_properties_SOURCES = main.c advanced.h ethernet.c wifi.c cellular.c
+
+ connman_properties_LDADD = $(top_builddir)/common/libcommon.a \
+ @GTK_LIBS@ @DBUS_LIBS@
+diff --git a/properties/advanced.h b/properties/advanced.h
+index 79a1c3c..d8f4117 100644
+--- a/properties/advanced.h
++++ b/properties/advanced.h
+@@ -59,10 +59,18 @@ struct config_data {
+ GtkWidget *disconnect;
+ } wifi;
+
++ struct {
++ GtkWidget *name;
++ GtkWidget *strength;
++ GtkWidget *connect_info;
++ GtkWidget *connect;
++ GtkWidget *disconnect;
++ } cellular;
++
+ GtkWidget *ethernet_button;
+ GtkWidget *wifi_button;
+-
+ GtkWidget *scan_button;
++ GtkWidget *cellular_button;
+ GtkWidget *offline_button;
+ };
+
+@@ -88,8 +96,11 @@ void update_ethernet_ipv4(struct config_data *data, guint policy);
+ void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data);
+ void update_wifi_policy(struct config_data *data, guint policy);
+
++void add_cellular_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data);
+ void add_ethernet_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
+ struct config_data *data);
+
+ void add_wifi_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
+ struct config_data *data);
++void add_cellular_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
++ struct config_data *data);
+diff --git a/properties/cellular.c b/properties/cellular.c
+new file mode 100644
+index 0000000..7bbfb89
+--- /dev/null
++++ b/properties/cellular.c
+@@ -0,0 +1,175 @@
++/*
++ *
++ * Connection Manager
++ *
++ * Copyright (C) 2011 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ *
++ */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <dbus/dbus-glib.h>
++#include <glib/gi18n.h>
++#include <gtk/gtk.h>
++
++#include "connman-client.h"
++
++#include "advanced.h"
++
++static void connect_reply_cb(DBusGProxy *proxy, GError *error,
++ gpointer user_data)
++{
++ if (error)
++ g_error_free(error);
++}
++
++static void connect_callback(GtkWidget *editable, gpointer user_data)
++{
++ struct config_data *data = user_data;
++
++ connman_client_connect_async(data->client, data->device, connect_reply_cb, data);
++}
++
++
++static void disconnect_callback(GtkWidget *editable, gpointer user_data)
++{
++ struct config_data *data = user_data;
++
++ connman_client_disconnect(data->client, data->device);
++}
++
++static void switch_callback(GtkWidget *editable, gpointer user_data)
++{
++ struct config_data *data = user_data;
++ const gchar *label = gtk_button_get_label(GTK_BUTTON(data->cellular_button));
++
++ if (g_str_equal(label, "Disable"))
++ connman_client_disable_technology(data->client, data->device, "cellular");
++ else
++ connman_client_enable_technology(data->client, data->device, "cellular");
++}
++
++void add_cellular_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
++ struct config_data *data)
++{
++ GtkWidget *vbox;
++ GtkWidget *table;
++ GtkWidget *label;
++ GtkWidget *buttonbox;
++ GtkWidget *button;
++ gboolean cellular_enabled;
++
++ gtk_tree_model_get(data->model, iter,
++ CONNMAN_COLUMN_CELLULAR_ENABLED, &cellular_enabled,
++ -1);
++
++ vbox = gtk_vbox_new(TRUE, 0);
++ gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
++ gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
++
++ table = gtk_table_new(1, 1, TRUE);
++ gtk_table_set_row_spacings(GTK_TABLE(table), 10);
++ gtk_table_set_col_spacings(GTK_TABLE(table), 10);
++ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
++
++ label = gtk_label_new(_("Configure Cellular Networks."));
++ gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
++
++ buttonbox = gtk_hbutton_box_new();
++ gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonbox), GTK_BUTTONBOX_CENTER);
++ gtk_box_pack_start(GTK_BOX(mainbox), buttonbox, FALSE, FALSE, 0);
++
++ button = gtk_button_new();
++ data->cellular_button = button;
++
++ if (cellular_enabled)
++ gtk_button_set_label(GTK_BUTTON(button), _("Disable"));
++ else
++ gtk_button_set_label(GTK_BUTTON(button), _("Enable"));
++
++ gtk_container_add(GTK_CONTAINER(buttonbox), button);
++ g_signal_connect(G_OBJECT(button), "clicked",
++ G_CALLBACK(switch_callback), data);
++}
++
++void add_cellular_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data)
++{
++ GtkWidget *vbox;
++ GtkWidget *table;
++ GtkWidget *label;
++ GtkWidget *button;
++
++ const char *name, *icon, *state;
++ guint strength;
++
++ gtk_tree_model_get(data->model, iter,
++ CONNMAN_COLUMN_NAME, &name,
++ CONNMAN_COLUMN_ICON, &icon,
++ CONNMAN_COLUMN_STATE, &state,
++ CONNMAN_COLUMN_STRENGTH, &strength,
++ -1);
++
++ if (g_str_equal(state, "failure") == TRUE)
++ connman_client_remove(data->client, data->device);
++
++ vbox = gtk_vbox_new(TRUE, 0);
++ gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
++ gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
++
++ table = gtk_table_new(4, 8, TRUE);
++ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
++ data->table = table;
++
++ label = gtk_label_new(_("Access Point:"));
++ gtk_table_attach_defaults(GTK_TABLE(table), label, 3, 4, 0, 1);
++
++ label = gtk_label_new(_(name));
++ gtk_table_attach_defaults(GTK_TABLE(table), label, 4, 5, 0, 1);
++ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
++ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
++ data->cellular.name = label;
++
++ label = gtk_label_new(_(""));
++ gtk_table_attach_defaults(GTK_TABLE(table), label, 3, 5, 2, 3);
++ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
++ gtk_widget_hide(label);
++ data->cellular.connect_info = label;
++
++ button = gtk_button_new_with_label(_("Connect"));
++ gtk_table_attach_defaults(GTK_TABLE(table), button, 3, 5, 3, 4);
++ g_signal_connect(G_OBJECT(button), "clicked",
++ G_CALLBACK(connect_callback), data);
++ gtk_widget_set_no_show_all(button, TRUE);
++ data->cellular.connect = button;
++
++ button = gtk_button_new_with_label(_("Disconnect"));
++ gtk_table_attach_defaults(GTK_TABLE(table), button, 3, 5, 3, 4);
++ g_signal_connect(G_OBJECT(button), "clicked",
++ G_CALLBACK(disconnect_callback), data);
++ data->cellular.disconnect = button;
++ gtk_widget_set_no_show_all(button, TRUE);
++
++ if (g_str_equal(state, "failure") == TRUE
++ || g_str_equal(state, "idle") == TRUE) {
++ gtk_widget_show(data->cellular.connect);
++ gtk_widget_hide(data->cellular.disconnect);
++ } else {
++ gtk_widget_hide(data->cellular.connect);
++ gtk_widget_show(data->cellular.disconnect);
++ }
++}
+diff --git a/properties/main.c b/properties/main.c
+index a09c721..ec36aef 100644
+--- a/properties/main.c
++++ b/properties/main.c
+@@ -42,6 +42,7 @@ static void status_update(GtkTreeModel *model, GtkTreePath *path,
+ const char *name = NULL, *_name = NULL, *state = NULL;
+ gboolean ethernet_enabled;
+ gboolean wifi_enabled;
++ gboolean cellular_enabled;
+ gboolean offline_mode;
+
+ gtk_tree_model_get(model, iter,
+@@ -50,6 +51,7 @@ static void status_update(GtkTreeModel *model, GtkTreePath *path,
+ CONNMAN_COLUMN_TYPE, &type,
+ CONNMAN_COLUMN_ETHERNET_ENABLED, &ethernet_enabled,
+ CONNMAN_COLUMN_WIFI_ENABLED, &wifi_enabled,
++ CONNMAN_COLUMN_CELLULAR_ENABLED, &cellular_enabled,
+ CONNMAN_COLUMN_OFFLINEMODE, &offline_mode,
+ -1);
+
+@@ -75,6 +77,29 @@ static void status_update(GtkTreeModel *model, GtkTreePath *path,
+ gtk_widget_hide(data->wifi.connect);
+ gtk_widget_show(data->wifi.disconnect);
+ }
++ } else if (type == CONNMAN_TYPE_CELLULAR) {
++ if (data->cellular.name)
++ _name = gtk_label_get_text(GTK_LABEL(data->cellular.name));
++
++ if (!(name && _name && g_str_equal(name, _name)))
++ return;
++
++ if (g_str_equal(state, "failure") == TRUE) {
++ gtk_label_set_text(GTK_LABEL(data->cellular.connect_info),
++ _("connection failed"));
++ gtk_widget_show(data->cellular.connect_info);
++ gtk_widget_show(data->cellular.connect);
++ gtk_widget_hide(data->cellular.disconnect);
++ } else if (g_str_equal(state, "idle") == TRUE) {
++ gtk_widget_hide(data->cellular.connect_info);
++ gtk_widget_show(data->cellular.connect);
++ gtk_widget_hide(data->cellular.disconnect);
++ } else {
++ gtk_widget_hide(data->cellular.connect_info);
++ gtk_widget_hide(data->cellular.connect);
++ gtk_widget_show(data->cellular.disconnect);
++ }
++
+ } else if (type == CONNMAN_TYPE_LABEL_ETHERNET) {
+ if (!data->ethernet_button)
+ return;
+@@ -92,6 +117,13 @@ static void status_update(GtkTreeModel *model, GtkTreePath *path,
+ gtk_button_set_label(GTK_BUTTON(data->wifi_button), _("Enable"));
+ gtk_widget_set_sensitive(data->scan_button, 0);
+ }
++ } else if (type == CONNMAN_TYPE_LABEL_CELLULAR) {
++ if (!data->cellular_button)
++ return;
++ if (cellular_enabled)
++ gtk_button_set_label(GTK_BUTTON(data->cellular_button), _("Disable"));
++ else
++ gtk_button_set_label(GTK_BUTTON(data->cellular_button), _("Enable"));
+ } else if (type == CONNMAN_TYPE_SYSCONFIG) {
+ if (!data->offline_button)
+ return;
+@@ -100,7 +132,6 @@ static void status_update(GtkTreeModel *model, GtkTreePath *path,
+ else
+ gtk_button_set_label(GTK_BUTTON(data->offline_button), _("OfflineMode"));
+ }
+-
+ }
+
+ static void set_offline_callback(GtkWidget *button, gpointer user_data)
+@@ -207,12 +238,18 @@ static struct config_data *create_config(GtkTreeModel *model,
+ case CONNMAN_TYPE_WIFI:
+ add_wifi_service(mainbox, iter, data);
+ break;
++ case CONNMAN_TYPE_CELLULAR:
++ add_cellular_service(mainbox, iter, data);
++ break;
+ case CONNMAN_TYPE_LABEL_ETHERNET:
+ add_ethernet_switch_button(mainbox, iter, data);
+ break;
+ case CONNMAN_TYPE_LABEL_WIFI:
+ add_wifi_switch_button(mainbox, iter, data);
+ break;
++ case CONNMAN_TYPE_LABEL_CELLULAR:
++ add_cellular_switch_button(mainbox, iter, data);
++ break;
+ case CONNMAN_TYPE_SYSCONFIG:
+ add_system_config(mainbox, iter, data);
+ break;
+@@ -295,6 +332,7 @@ static void device_to_text(GtkTreeViewColumn *column, GtkCellRenderer *cell,
+ markup = g_strdup_printf(" %s\n", title);
+ break;
+ case CONNMAN_TYPE_WIFI:
++ case CONNMAN_TYPE_CELLULAR:
+ /* Show the AP name */
+ title = N_(name);
+ if (g_str_equal(state, "association") == TRUE)
+@@ -324,6 +362,10 @@ static void device_to_text(GtkTreeViewColumn *column, GtkCellRenderer *cell,
+ title = N_("Wireless Networks");
+ markup = g_strdup_printf("<b>\n%s\n</b>", title);
+ break;
++ case CONNMAN_TYPE_LABEL_CELLULAR:
++ title = N_("Cellular Networks");
++ markup = g_strdup_printf("<b>\n%s\n</b>", title);
++ break;
+ case CONNMAN_TYPE_SYSCONFIG:
+ title = N_("System Configuration");
+ markup = g_strdup_printf("<b>\n%s\n</b>", title);
+@@ -362,6 +404,10 @@ static void type_to_icon(GtkTreeViewColumn *column, GtkCellRenderer *cell,
+ g_object_set(cell, "icon-name", "network-wireless",
+ "stock-size", 4, NULL);
+ break;
++ case CONNMAN_TYPE_LABEL_CELLULAR:
++ g_object_set(cell, "icon-name", "network-cellular",
++ "stock-size", 4, NULL);
++ break;
+ default:
+ g_object_set(cell, "icon-name", NULL, NULL);
+ break;
diff --git a/recipes-connectivity/connman/connman-gnome/security-type.patch b/recipes-connectivity/connman/connman-gnome/security-type.patch
new file mode 100644
index 0000000..a75d696
--- /dev/null
+++ b/recipes-connectivity/connman/connman-gnome/security-type.patch
@@ -0,0 +1,41 @@
+From ec36df9d1fbb6dcbf0d1e79245ffe213049ecd5a Mon Sep 17 00:00:00 2001
+From: Dongxiao Xu <dongxiao.xu@intel.com>
+Date: Wed, 3 Aug 2011 14:33:07 +0800
+Subject: [PATCH] connman-dbus: fix security type mismatch
+
+Latest connman change the Security type to be array{String}, fix
+connman-gnome accordingly.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+---
+ common/connman-dbus.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+Upstream-Status: Pending
+
+diff --git a/common/connman-dbus.c b/common/connman-dbus.c
+index 0f4e1db..0ac8ed5 100644
+--- a/common/connman-dbus.c
++++ b/common/connman-dbus.c
+@@ -384,7 +384,8 @@ static void service_changed(DBusGProxy *proxy, const char *property,
+ gtk_tree_store_set(store, &iter,
+ CONNMAN_COLUMN_FAVORITE, favorite, -1);
+ } else if (g_str_equal(property, "Security") == TRUE) {
+- const char *security = value ? g_value_get_string(value) : NULL;
++ const char **array = value ? g_value_get_boxed(value) : NULL;
++ const char *security = g_strjoinv(" ", array);
+ gtk_tree_store_set(store, &iter,
+ CONNMAN_COLUMN_SECURITY, security,
+ -1);
+@@ -487,7 +488,7 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
+ strength = value ? g_value_get_uchar(value) : 0;
+
+ value = g_hash_table_lookup(hash, "Security");
+- security = value ? g_value_get_string(value) : NULL;
++ security = value ? g_strjoinv(" ", g_value_get_boxed(value)) : NULL;
+
+ value = g_hash_table_lookup(hash, "PassPhrase");
+ passphrase = value ? g_value_get_string(value) : NULL;
+--
+1.7.1
+
diff --git a/recipes-connectivity/connman/connman-gnome_0.5.bb b/recipes-connectivity/connman/connman-gnome_0.5.bb
index 026ca45..3fde66d 100644
--- a/recipes-connectivity/connman/connman-gnome_0.5.bb
+++ b/recipes-connectivity/connman/connman-gnome_0.5.bb
@@ -1,33 +1,33 @@
-DESCRIPTION = "gtk frontend for connman"
-HOMEPAGE = "http://connman.net/"
-SECTION = "libs/network"
-LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
- file://properties/main.c;beginline=1;endline=20;md5=50c77c81871308b033ab7a1504626afb \
- file://common/connman-dbus.c;beginline=1;endline=20;md5=de6b485c0e717a0236402d220187717a"
-
-DEPENDS = "gtk+ dbus"
-
-PR = "r8"
-
-SRCREV = "78d3c39db6f3f7977b466305110faa8ca5f74ec8"
-SRC_URI = "git://github.com/connectivity/connman-gnome.git;protocol=git \
- file://3g.patch \
- file://security-type.patch"
-
-S = "${WORKDIR}/git"
-
-inherit autotools gtk-icon-cache
-
-RRECOMMENDS_${PN} = "python \
- python-dbus \
- connman \
- connman-plugin-ethernet \
- connman-plugin-loopback \
- connman-plugin-udhcp \
- connman-plugin-wifi \
- connman-plugin-fake \
- connman-plugin-bluetooth \
- connman-plugin-dnsproxy \
- connman-plugin-ofono \
- "
+DESCRIPTION = "gtk frontend for connman"
+HOMEPAGE = "http://connman.net/"
+SECTION = "libs/network"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://properties/main.c;beginline=1;endline=20;md5=50c77c81871308b033ab7a1504626afb \
+ file://common/connman-dbus.c;beginline=1;endline=20;md5=de6b485c0e717a0236402d220187717a"
+
+DEPENDS = "gtk+ dbus"
+
+PR = "r8"
+
+SRCREV = "78d3c39db6f3f7977b466305110faa8ca5f74ec8"
+SRC_URI = "git://github.com/connectivity/connman-gnome.git;protocol=git \
+ file://3g.patch \
+ file://security-type.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools gtk-icon-cache
+
+RRECOMMENDS_${PN} = "python \
+ python-dbus \
+ connman \
+ connman-plugin-ethernet \
+ connman-plugin-loopback \
+ connman-plugin-udhcp \
+ connman-plugin-wifi \
+ connman-plugin-fake \
+ connman-plugin-bluetooth \
+ connman-plugin-dnsproxy \
+ connman-plugin-ofono \
+ "
diff --git a/recipes-connectivity/connman/connman.inc b/recipes-connectivity/connman/connman.inc
new file mode 100644
index 0000000..143df4b
--- /dev/null
+++ b/recipes-connectivity/connman/connman.inc
@@ -0,0 +1,105 @@
+SUMMARY = "A daemon for managing internet connections within embedded devices"
+DESCRIPTION = "The ConnMan project provides a daemon for managing \
+internet connections within embedded devices running the Linux \
+operating system. The Connection Manager is designed to be slim and \
+to use as few resources as possible, so it can be easily integrated. \
+It is a fully modular system that can be extended, through plug-ins, \
+to support all kinds of wired or wireless technologies. Also, \
+configuration methods, like DHCP and domain name resolving, are \
+implemented using plug-ins."
+HOMEPAGE = "http://connman.net/"
+BUGTRACKER = "http://bugs.meego.com/buglist.cgi?quicksearch=connman"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://src/main.c;beginline=1;endline=20;md5=4b55b550fa6b33cc2055ef30dd262b3e"
+
+# we need to define the depends here, the dynamic stuff is too late
+DEPENDS = "dbus glib-2.0 ppp iptables gnutls \
+ ${@base_contains('DISTRO_FEATURES', 'bluetooth','bluez4', '', d)} \
+ ${@base_contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
+ systemd \
+ "
+
+EXTRA_OECONF += "\
+ ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
+ ac_cv_path_PPPD=${sbindir}/pppd \
+ --disable-gtk-doc \
+ --enable-debug \
+ --enable-threads \
+ --enable-loopback \
+ --enable-ethernet \
+ ${@base_contains('DISTRO_FEATURES', 'wifi','--enable-wifi', '--disable-wifi', d)} \
+ ${@base_contains('DISTRO_FEATURES', 'bluetooth','--enable-bluetooth', '--disable-bluetooth', d)} \
+ --enable-dnsproxy \
+ --enable-ofono \
+ --enable-tools \
+ --enable-test \
+ --disable-polkit \
+ --enable-client \
+ --enable-fake \
+ --disable-ntpd \
+"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home \
+ --shell /bin/false --groups video,tty,audio \
+ --user-group xuser"
+
+inherit autotools pkgconfig useradd
+
+do_compile_append() {
+ sed -i -e s:deny:allow:g src/connman-dbus.conf
+}
+
+do_install_append() {
+ #install -d ${D}${sysconfdir}/init.d
+ #install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
+
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/tools/*-test ${D}${bindir}
+ install -m 0755 ${S}/tools/wispr ${D}${bindir}
+
+ # We don't need to package an empty directory
+ rmdir ${D}${libdir}/connman/scripts
+}
+
+PACKAGES_DYNAMIC = "${PN}-plugin-*"
+
+python populate_packages_prepend() {
+ depmap = dict( pppd="ppp",
+ wifi="wpa-supplicant",
+ bluetooth="bluez4",
+ ofono="ofono" )
+ packages = []
+ multilib_prefix = (d.getVar("MLPREFIX", True) or "")
+ 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='', hook=hook )
+ for (file, package) in packages:
+ plugintype = package.split( '-' )[-1]
+ if plugintype in depmap:
+ rdepends = map(lambda x: multilib_prefix + x, depmap[plugintype].split())
+ bb.note( "Adding rdependency on %s to %s" % ( rdepends, package ) )
+ d.setVar("RDEPENDS_%s" % package, " ".join(rdepends))
+}
+
+PACKAGES =+ "${PN}-tools ${PN}-tests"
+
+FILES_${PN}-tools = "${bindir}/wispr"
+
+FILES_${PN}-tests = "${bindir}/*-test ${libdir}/${PN}/test/*"
+RDEPENDS_${PN}-tests = "python-dbus"
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
+ ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+ ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
+ ${datadir}/pixmaps ${datadir}/applications \
+ ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
+ ${libdir}/bonobo/servers \
+ ${datadir}/dbus-1/system-services/* \
+ ${base_libdir}/systemd/*"
+
+FILES_${PN}-dbg += "${libdir}/connman/*/.debug"
+
+FILES_${PN}-dev += "${libdir}/connman/*/*.la"
diff --git a/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch b/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch
index 36e7456..764c689 100644
--- a/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch
+++ b/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch
@@ -1,23 +1,23 @@
-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
---- connman-0.65-orig/src/connman-dbus.conf 2011-03-04 09:34:49.000000000 +0800
-+++ connman-0.65/src/connman-dbus.conf 2011-03-04 09:35:21.000000000 +0800
-@@ -7,6 +7,12 @@
- <allow send_interface="net.connman.Agent"/>
- <allow send_interface="net.connman.Counter"/>
- </policy>
-+ <policy user="xuser">
-+ <allow own="net.connman"/>
-+ <allow send_destination="net.connman"/>
-+ <allow send_interface="net.connman.Agent"/>
-+ <allow send_interface="net.connman.Counter"/>
-+ </policy>
- <policy at_console="true">
- <allow send_destination="net.connman"/>
- </policy>
+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
+--- connman-0.65-orig/src/connman-dbus.conf 2011-03-04 09:34:49.000000000 +0800
++++ connman-0.65/src/connman-dbus.conf 2011-03-04 09:35:21.000000000 +0800
+@@ -7,6 +7,12 @@
+ <allow send_interface="net.connman.Agent"/>
+ <allow send_interface="net.connman.Counter"/>
+ </policy>
++ <policy user="xuser">
++ <allow own="net.connman"/>
++ <allow send_destination="net.connman"/>
++ <allow send_interface="net.connman.Agent"/>
++ <allow send_interface="net.connman.Counter"/>
++ </policy>
+ <policy at_console="true">
+ <allow send_destination="net.connman"/>
+ </policy>
diff --git a/recipes-connectivity/connman/connman/connman b/recipes-connectivity/connman/connman/connman
index b8cf2c9..f01bf37 100644
--- a/recipes-connectivity/connman/connman/connman
+++ b/recipes-connectivity/connman/connman/connman
@@ -1,62 +1,62 @@
-#!/bin/sh
-
-DAEMON=/usr/sbin/connmand
-PIDFILE=/var/run/connmand.pid
-DESC="Connection Manager"
-
-if [ -f /etc/default/connman ] ; then
- . /etc/default/connman
-fi
-
-set -e
-
-nfsroot=0
-
-exec 9<&0 < /proc/mounts
-while read dev mtpt fstype rest; do
- if test $mtpt = "/" ; then
- case $fstype in
- nfs | nfs4)
- nfsroot=1
- break
- ;;
- *)
- ;;
- esac
- fi
-done
-
-do_start() {
- EXTRA_PARAM=""
- if test $nfsroot -eq 1 ; then
- EXTRA_PARAM="-P ethernet"
- fi
- $DAEMON $EXTRA_PARAM
-}
-
-do_stop() {
- start-stop-daemon --stop --name connmand --quiet
-}
-
-case "$1" in
- start)
- echo "Starting $DESC"
- do_start
- ;;
- stop)
- echo "Stopping $DESC"
- do_stop
- ;;
- restart|force-reload)
- echo "Restarting $DESC"
- do_stop
- sleep 1
- do_start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
+#!/bin/sh
+
+DAEMON=/usr/sbin/connmand
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+ . /etc/default/connman
+fi
+
+set -e
+
+nfsroot=0
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+
+do_start() {
+ EXTRA_PARAM=""
+ if test $nfsroot -eq 1 ; then
+ EXTRA_PARAM="-P ethernet"
+ fi
+ $DAEMON $EXTRA_PARAM
+}
+
+do_stop() {
+ start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC"
+ do_start
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ do_stop
+ ;;
+ restart|force-reload)
+ echo "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes-connectivity/connman/connman/disable_alg-test.patch b/recipes-connectivity/connman/connman/disable_alg-test.patch
new file mode 100644
index 0000000..44ad768
--- /dev/null
+++ b/recipes-connectivity/connman/connman/disable_alg-test.patch
@@ -0,0 +1,46 @@
+From b9a20c8eb61b600ced284646a1bea588fdd8a5ea Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 16 Dec 2011 19:31:59 -0200
+Subject: [PATCH] Disable building of alg-test
+
+alg-test utility depends on linux/if_alg.h header that is only
+available on kernels >= 2.6.39.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ Makefile.am | 2 +-
+ configure.ac | 3 ---
+ 2 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index d5a76f9..d42a766 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -144,7 +144,7 @@ noinst_PROGRAMS += tools/wispr tools/supplicant-test \
+ tools/dbus-test tools/polkit-test \
+ tools/iptables-test tools/tap-test tools/wpad-test \
+ tools/stats-tool tools/private-network-test \
+- tools/alg-test unit/test-session
++ unit/test-session
+
+ tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
+ tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
+diff --git a/configure.ac b/configure.ac
+index f63fea8..67bfe85 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -437,9 +437,6 @@ if (test "${enable_tools}" = "yes"); then
+ AC_MSG_ERROR(GnuTLS library is required))
+ AC_SUBST(GNUTLS_CFLAGS)
+ AC_SUBST(GNUTLS_LIBS)
+-
+- AC_CHECK_HEADERS(linux/if_alg.h, dummy=yes,
+- AC_MSG_ERROR(User-space algorithm header files are required))
+ fi
+ AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
+
+--
+1.7.7.3
+
diff --git a/recipes-connectivity/connman/connman/ethernet_default.patch b/recipes-connectivity/connman/connman/ethernet_default.patch
index e948e56..6dae2aa 100644
--- a/recipes-connectivity/connman/connman/ethernet_default.patch
+++ b/recipes-connectivity/connman/connman/ethernet_default.patch
@@ -1,22 +1,22 @@
-Default to enabling the ethernet interface. If we don't do this, connman
-will shut down all the networking when it starts without any configuration
-which is usualy not what the users expects. This is particularly
-problematic with our qemu images and runtime testing using qemu.
-
-Upstream-Status: Inappropriate [Configuration]
-
-RP 2011/12/12
-
-Index: git/src/storage.c
-===================================================================
---- git.orig/src/storage.c 2011-12-12 16:14:10.892316565 +0000
-+++ git/src/storage.c 2011-12-12 16:14:13.788316431 +0000
-@@ -367,7 +367,7 @@
- "Enable", FALSE);
-
- g_key_file_set_boolean(keyfile, "Wired",
-- "Enable", FALSE);
-+ "Enable", TRUE);
-
- g_key_file_set_boolean(keyfile, "3G",
- "Enable", FALSE);
+Default to enabling the ethernet interface. If we don't do this, connman
+will shut down all the networking when it starts without any configuration
+which is usualy not what the users expects. This is particularly
+problematic with our qemu images and runtime testing using qemu.
+
+Upstream-Status: Inappropriate [Configuration]
+
+RP 2011/12/12
+
+Index: git/src/storage.c
+===================================================================
+--- git.orig/src/storage.c 2011-12-12 16:14:10.892316565 +0000
++++ git/src/storage.c 2011-12-12 16:14:13.788316431 +0000
+@@ -367,7 +367,7 @@
+ "Enable", FALSE);
+
+ g_key_file_set_boolean(keyfile, "Wired",
+- "Enable", FALSE);
++ "Enable", TRUE);
+
+ g_key_file_set_boolean(keyfile, "3G",
+ "Enable", FALSE);
diff --git a/recipes-connectivity/connman/connman_0.78.bb b/recipes-connectivity/connman/connman_0.78.bb
index 963232e..c73cad9 100644
--- a/recipes-connectivity/connman/connman_0.78.bb
+++ b/recipes-connectivity/connman/connman_0.78.bb
@@ -1,12 +1,12 @@
-require connman.inc
-
-PR = "r6"
-
-# 0.78 tag
-SRCREV = "02f5d5fe2d7c71514a6387ba2b772b42d8e8d297"
-SRC_URI = "git://git.kernel.org/pub/scm/network/connman/connman.git \
- file://add_xuser_dbus_permission.patch \
- file://ethernet_default.patch \
- file://disable_alg-test.patch \
- file://connman"
-S = "${WORKDIR}/git"
+require connman.inc
+
+PR = "r6"
+
+# 0.78 tag
+SRCREV = "02f5d5fe2d7c71514a6387ba2b772b42d8e8d297"
+SRC_URI = "git://git.kernel.org/pub/scm/network/connman/connman.git \
+ file://add_xuser_dbus_permission.patch \
+ file://ethernet_default.patch \
+ file://disable_alg-test.patch \
+ file://connman"
+S = "${WORKDIR}/git"