diff options
Diffstat (limited to 'recipes-connectivity')
28 files changed, 1819 insertions, 390 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, ðernet_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" diff --git a/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch b/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch index 7446006..09c9061 100644 --- a/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch +++ b/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch @@ -1,15 +1,15 @@ -Upstream-Status: Inappropriate [configuration]
-
-diff --git a/configure.in b/configure.in
-index f5d54fb..c105988 100644
---- a/configure.in
-+++ b/configure.in
-@@ -1,7 +1,7 @@
- # -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
-
--AC_PREREQ([2.66])
-+AC_PREREQ([2.65])
- AC_INIT([libnfsidmap],[0.24],[linux-nfs@vger.kernel.org])
- AC_CONFIG_SRCDIR([nfsidmap.h])
- AC_CONFIG_MACRO_DIR([m4])
+Upstream-Status: Inappropriate [configuration] + +diff --git a/configure.in b/configure.in +index f5d54fb..c105988 100644 +--- a/configure.in ++++ b/configure.in +@@ -1,7 +1,7 @@ + # -*- Autoconf -*- + # Process this file with autoconf to produce a configure script. + +-AC_PREREQ([2.66]) ++AC_PREREQ([2.65]) + AC_INIT([libnfsidmap],[0.24],[linux-nfs@vger.kernel.org]) + AC_CONFIG_SRCDIR([nfsidmap.h]) + AC_CONFIG_MACRO_DIR([m4]) diff --git a/recipes-connectivity/nfs-utils/libnfsidmap_0.24.bb b/recipes-connectivity/nfs-utils/libnfsidmap_0.24.bb index 967977e..eff75ec 100644 --- a/recipes-connectivity/nfs-utils/libnfsidmap_0.24.bb +++ b/recipes-connectivity/nfs-utils/libnfsidmap_0.24.bb @@ -1,19 +1,19 @@ -SUMMARY = "NFS id mapping library"
-DESCRIPTION = "NFS id mapping library"
-HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
-SECTION = "libs"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
-PR = "r0"
-
-SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \
- file://fix-ac-prereq.patch \
- "
-
-SRC_URI[md5sum] = "d71a1ee9881d5b5814ff3ec41256937d"
-SRC_URI[sha256sum] = "59501432e683336d7a290da13767e92afb5b86f42ea4254041225fe218e8dd47"
-
-inherit autotools
-
-EXTRA_OECONF = "--disable-ldap"
+SUMMARY = "NFS id mapping library" +DESCRIPTION = "NFS id mapping library" +HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/" +SECTION = "libs" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37" +PR = "r0" + +SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \ + file://fix-ac-prereq.patch \ + " + +SRC_URI[md5sum] = "d71a1ee9881d5b5814ff3ec41256937d" +SRC_URI[sha256sum] = "59501432e683336d7a290da13767e92afb5b86f42ea4254041225fe218e8dd47" + +inherit autotools + +EXTRA_OECONF = "--disable-ldap" diff --git a/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch b/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch index 3c8f9fb..6d46d3a 100644 --- a/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch +++ b/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch @@ -1,22 +1,22 @@ -Upstream-Status: Inappropriate [embedded specific]
-
-Index: nfs-utils-1.2.3/support/nfs/svc_socket.c
-===================================================================
---- nfs-utils-1.2.3.orig/support/nfs/svc_socket.c
-+++ nfs-utils-1.2.3/support/nfs/svc_socket.c
-@@ -67,6 +67,7 @@ svc_socket (u_long number, int type, int
- memset (&addr, 0, sizeof (addr));
- addr.sin_family = AF_INET;
-
-+#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
- ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata,
- &rpcp);
- if (ret == 0 && rpcp != NULL)
-@@ -100,6 +101,7 @@ svc_socket (u_long number, int type, int
- }
- }
- else
-+#endif
- {
- addr.sin_port = 0;
- if (bind (sock, (struct sockaddr *) &addr, len) < 0)
+Upstream-Status: Inappropriate [embedded specific] + +Index: nfs-utils-1.2.3/support/nfs/svc_socket.c +=================================================================== +--- nfs-utils-1.2.3.orig/support/nfs/svc_socket.c ++++ nfs-utils-1.2.3/support/nfs/svc_socket.c +@@ -67,6 +67,7 @@ svc_socket (u_long number, int type, int + memset (&addr, 0, sizeof (addr)); + addr.sin_family = AF_INET; + ++#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */ + ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata, + &rpcp); + if (ret == 0 && rpcp != NULL) +@@ -100,6 +101,7 @@ svc_socket (u_long number, int type, int + } + } + else ++#endif + { + addr.sin_port = 0; + if (bind (sock, (struct sockaddr *) &addr, len) < 0) diff --git a/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch b/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch index b42111e..465144a 100644 --- a/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch +++ b/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch @@ -1,26 +1,26 @@ -[PATCH] fix build with uClibc
-
-uClibc doesn't have/need libio.h, so don't include it from sockaddr.h
-
-Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- support/include/sockaddr.h | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-Upstream-Status: Pending
-
-Index: nfs-utils-1.2.3/support/include/sockaddr.h
-===================================================================
---- nfs-utils-1.2.3.orig/support/include/sockaddr.h
-+++ nfs-utils-1.2.3/support/include/sockaddr.h
-@@ -20,7 +20,10 @@
- #ifndef NFS_UTILS_SOCKADDR_H
- #define NFS_UTILS_SOCKADDR_H
-
-+/* uClibc doesn't have/need libio.h */
-+#ifndef __UCLIBC__
- #include <libio.h>
-+#endif
- #include <stdbool.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
+[PATCH] fix build with uClibc + +uClibc doesn't have/need libio.h, so don't include it from sockaddr.h + +Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> +--- + support/include/sockaddr.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +Upstream-Status: Pending + +Index: nfs-utils-1.2.3/support/include/sockaddr.h +=================================================================== +--- nfs-utils-1.2.3.orig/support/include/sockaddr.h ++++ nfs-utils-1.2.3/support/include/sockaddr.h +@@ -20,7 +20,10 @@ + #ifndef NFS_UTILS_SOCKADDR_H + #define NFS_UTILS_SOCKADDR_H + ++/* uClibc doesn't have/need libio.h */ ++#ifndef __UCLIBC__ + #include <libio.h> ++#endif + #include <stdbool.h> + #include <sys/socket.h> + #include <netinet/in.h> diff --git a/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/recipes-connectivity/nfs-utils/nfs-utils/nfsserver new file mode 100644 index 0000000..69c8718 --- /dev/null +++ b/recipes-connectivity/nfs-utils/nfs-utils/nfsserver @@ -0,0 +1,161 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: nfs-kernel-server +# Required-Start: $remote_fs $portmap hwclock +# Required-Stop: $remote_fs $portmap hwclock +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Kernel NFS server support +# Description: NFS is a popular protocol for file sharing across +# TCP/IP networks. This service provides NFS server +# functionality, which is configured via the +# /etc/exports file. +### END INIT INFO +# +# Startup script for nfs-utils +# +# +# The environment variable NFS_SERVERS may be set in /etc/default/nfsd +# Other control variables may be overridden here too +test -r /etc/default/nfsd && . /etc/default/nfsd +# +# Location of executables: +test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd +test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd +test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd +# +# The user mode program must also exist (it just starts the kernel +# threads using the kernel module code). +test -x "$NFS_MOUNTD" || exit 0 +test -x "$NFS_NFSD" || exit 0 +# +# Default is 8 threads, value is settable between 1 and the truely +# ridiculous 99 +test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 +# +# The default state directory is /var/lib/nfs +test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs +# +#---------------------------------------------------------------------- +# Startup and shutdown functions. +# Actual startup/shutdown is at the end of this file. +#directories +create_directories(){ + echo -n 'creating NFS state directory: ' + mkdir -p "$NFS_STATEDIR" + ( cd "$NFS_STATEDIR" + umask 077 + mkdir -p sm sm.bak + test -w sm/state || { + rm -f sm/state + :>sm/state + } + umask 022 + for file in xtab etab smtab rmtab + do + test -w "$file" || { + rm -f "$file" + :>"$file" + } + done + ) + echo done +} +#mountd +start_mountd(){ + echo -n 'starting mountd: ' + start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@" + echo done +} +stop_mountd(){ + echo -n 'stopping mountd: ' + start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD" + echo done +} +# +#nfsd +start_nfsd(){ + echo -n "starting $1 nfsd kernel threads: " + start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" + echo done +} +delay_nfsd(){ + for delay in 0 1 2 3 4 5 6 7 8 9 + do + if pidof nfsd >/dev/null + then + echo -n . + sleep 1 + else + return 0 + fi + done + return 1 +} +stop_nfsd(){ + # WARNING: this kills any process with the executable + # name 'nfsd'. + echo -n 'stopping nfsd: ' + start-stop-daemon --stop --quiet --signal 1 --name nfsd + if delay_nfsd || { + echo failed + echo ' using signal 9: ' + start-stop-daemon --stop --quiet --signal 9 --name nfsd + delay_nfsd + } + then + echo done + # This will remove, recursively, dependencies + echo -n 'removing nfsd kernel module: ' + if modprobe -r nfsd + then + echo done + else + echo failed + fi + else + echo failed + fi +} + +#statd +start_statd(){ + echo -n "starting statd: " + start-stop-daemon --start --exec "$NFS_STATD" + echo done +} +stop_statd(){ + # WARNING: this kills any process with the executable + # name 'statd'. + echo -n 'stopping statd: ' + start-stop-daemon --stop --quiet --signal 1 --name statd + echo done +} +#---------------------------------------------------------------------- +# +# supported options: +# start +# stop +# reload: reloads the exports file +# restart: stops and starts mountd +#FIXME: need to create the /var/lib/nfs/... directories +case "$1" in +start) create_directories + start_nfsd "$NFS_SERVERS" + start_mountd + start_statd + test -r /etc/exports && exportfs -a;; +stop) exportfs -ua + stop_statd + stop_mountd + stop_nfsd;; +reload) test -r /etc/exports && exportfs -r;; +restart)exportfs -ua + stop_mountd + stop_statd + # restart does not restart the kernel threads, + # only the user mode processes + start_mountd + start_statd + test -r /etc/exports && exportfs -a;; +esac diff --git a/recipes-connectivity/nfs-utils/nfs-utils_1.2.3.bb b/recipes-connectivity/nfs-utils/nfs-utils_1.2.3.bb new file mode 100644 index 0000000..acc1139 --- /dev/null +++ b/recipes-connectivity/nfs-utils/nfs-utils_1.2.3.bb @@ -0,0 +1,61 @@ +SUMMARY = "userspace utilities for kernel nfs" +DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \ +NFS server and related tools." +HOMEPAGE = "http://nfs.sourceforge.net/" +SECTION = "console/network" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +# util-linux for libblkid +DEPENDS = "libcap libnfsidmap libevent util-linux tcp-wrappers" +RDEPENDS_${PN} = "portmap" +RRECOMMENDS_${PN} = "kernel-module-nfsd" + +PR = "r3" + +SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.bz2 \ + file://nfs-utils-1.0.6-uclibc.patch \ + file://nfs-utils-1.2.3-uclibc-libio.h.patch \ + file://nfsserver" + +SRC_URI[md5sum] = "1131dc5f27c4f3905a6e7ee0d594fd4d" +SRC_URI[sha256sum] = "5575ece941097cbfa67fbe0d220dfa11b73f5e6d991e7939c9339bd72259ff19" + +PARALLEL_MAKE = "" + +# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will +# pull in the remainder of the dependencies. + +#INITSCRIPT_NAME = "nfsserver" +# The server has no dependencies at the user run levels, so just put +# it in at the default levels. It must be terminated before the network +# in the shutdown levels, but that works fine. +#INITSCRIPT_PARAMS = "defaults" + +inherit autotools + +# --enable-uuid is need for cross-compiling +EXTRA_OECONF = "--with-statduser=nobody \ + --enable-nfsv41 \ + --enable-uuid \ + --disable-gss \ + --disable-tirpc \ + --with-statedir=/var/lib/nfs" + +INHIBIT_AUTO_STAGE = "1" + +PACKAGES =+ "${PN}-client ${PN}-stats" +FILES_${PN}-client = "${base_sbindir}/*mount.nfs*" +FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat" +RDEPENDS_${PN}-stats = "python" + +do_install_append () { + #install -d ${D}${sysconfdir}/init.d + #install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver + + # the following are built by CC_FOR_BUILD + rm -f ${D}${sbindir}/rpcdebug + rm -f ${D}${sbindir}/rpcgen + rm -f ${D}${sbindir}/locktest +} diff --git a/recipes-connectivity/openssh/openssh-5.9p1/init b/recipes-connectivity/openssh/openssh-5.9p1/init new file mode 100644 index 0000000..055dd22 --- /dev/null +++ b/recipes-connectivity/openssh/openssh-5.9p1/init @@ -0,0 +1,92 @@ +#! /bin/sh +set -e + +# /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon + +test -x /usr/sbin/sshd || exit 0 +( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 + +if test -f /etc/default/ssh; then + . /etc/default/ssh +fi + +check_for_no_start() { + # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists + if [ -e /etc/ssh/sshd_not_to_be_run ]; then + echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" + exit 0 + fi +} + +check_privsep_dir() { + # Create the PrivSep empty dir if necessary + if [ ! -d /var/run/sshd ]; then + mkdir /var/run/sshd + chmod 0755 /var/run/sshd + fi +} + +check_config() { + /usr/sbin/sshd -t || exit 1 +} + +check_keys() { + # create keys if necessary + if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + echo " generating ssh RSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa + fi + if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then + echo " generating ssh ECDSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa + fi + if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then + echo " generating ssh DSA key..." + ssh-keygen -q -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa + fi +} + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" + +case "$1" in + start) + check_for_no_start + echo "Starting OpenBSD Secure Shell server: sshd" + check_keys + check_privsep_dir + start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS + echo "done." + ;; + stop) + echo -n "Stopping OpenBSD Secure Shell server: sshd" + start-stop-daemon -K -x /usr/sbin/sshd + echo "." + ;; + + reload|force-reload) + check_for_no_start + check_keys + check_config + echo -n "Reloading OpenBSD Secure Shell server's configuration" + start-stop-daemon -K -s 1 -x /usr/sbin/sshd + echo "." + ;; + + restart) + check_keys + check_config + echo -n "Restarting OpenBSD Secure Shell server: sshd" + start-stop-daemon -K -x /usr/sbin/sshd + check_for_no_start + check_privsep_dir + sleep 2 + start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS + echo "." + ;; + + *) + echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" + exit 1 +esac + +exit 0 diff --git a/recipes-connectivity/openssh/openssh-5.9p1/nostrip.patch b/recipes-connectivity/openssh/openssh-5.9p1/nostrip.patch index 663df5c..33111f5 100644 --- a/recipes-connectivity/openssh/openssh-5.9p1/nostrip.patch +++ b/recipes-connectivity/openssh/openssh-5.9p1/nostrip.patch @@ -1,20 +1,20 @@ -Disable stripping binaries during make install.
-
-Upstream-Status: Inappropriate [configuration]
-
-Build system specific.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-diff -ur openssh-5.6p1.orig/Makefile.in openssh-5.6p1/Makefile.in
---- openssh-5.6p1.orig/Makefile.in 2010-05-11 23:51:39.000000000 -0700
-+++ openssh-5.6p1/Makefile.in 2010-08-30 16:49:54.000000000 -0700
-@@ -29,7 +29,7 @@
- RAND_HELPER=$(libexecdir)/ssh-rand-helper
- PRIVSEP_PATH=@PRIVSEP_PATH@
- SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
--STRIP_OPT=@STRIP_OPT@
-+STRIP_OPT=
-
- PATHS= -DSSHDIR=\"$(sysconfdir)\" \
- -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
+Disable stripping binaries during make install. + +Upstream-Status: Inappropriate [configuration] + +Build system specific. + +Signed-off-by: Scott Garman <scott.a.garman@intel.com> + +diff -ur openssh-5.6p1.orig/Makefile.in openssh-5.6p1/Makefile.in +--- openssh-5.6p1.orig/Makefile.in 2010-05-11 23:51:39.000000000 -0700 ++++ openssh-5.6p1/Makefile.in 2010-08-30 16:49:54.000000000 -0700 +@@ -29,7 +29,7 @@ + RAND_HELPER=$(libexecdir)/ssh-rand-helper + PRIVSEP_PATH=@PRIVSEP_PATH@ + SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ +-STRIP_OPT=@STRIP_OPT@ ++STRIP_OPT= + + PATHS= -DSSHDIR=\"$(sysconfdir)\" \ + -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ diff --git a/recipes-connectivity/openssh/openssh-5.9p1/ssh_config b/recipes-connectivity/openssh/openssh-5.9p1/ssh_config new file mode 100644 index 0000000..4a4a649 --- /dev/null +++ b/recipes-connectivity/openssh/openssh-5.9p1/ssh_config @@ -0,0 +1,46 @@ +# $OpenBSD: ssh_config,v 1.25 2009/02/17 01:28:32 djm Exp $ + +# This is the ssh client system-wide configuration file. See +# ssh_config(5) for more information. This file provides defaults for +# users, and the values can be changed in per-user configuration files +# or on the command line. + +# Configuration data is parsed as follows: +# 1. command line options +# 2. user-specific file +# 3. system-wide file +# Any configuration value is only changed the first time it is set. +# Thus, host-specific definitions should be at the beginning of the +# configuration file, and defaults at the end. + +# Site-wide defaults for some commonly used options. For a comprehensive +# list of available options, their meanings and defaults, please see the +# ssh_config(5) man page. + +Host * + ForwardAgent yes + ForwardX11 yes +# RhostsRSAAuthentication no +# RSAAuthentication yes +# PasswordAuthentication yes +# HostbasedAuthentication no +# GSSAPIAuthentication no +# GSSAPIDelegateCredentials no +# BatchMode no +# CheckHostIP yes +# AddressFamily any +# ConnectTimeout 0 +# StrictHostKeyChecking ask +# IdentityFile ~/.ssh/identity +# IdentityFile ~/.ssh/id_rsa +# IdentityFile ~/.ssh/id_dsa +# Port 22 +# Protocol 2,1 +# Cipher 3des +# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc +# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 +# EscapeChar ~ +# Tunnel no +# TunnelDevice any:any +# PermitLocalCommand no +# VisualHostKey no diff --git a/recipes-connectivity/openssh/openssh-5.9p1/sshd b/recipes-connectivity/openssh/openssh-5.9p1/sshd index b843e37..4882e58 100644 --- a/recipes-connectivity/openssh/openssh-5.9p1/sshd +++ b/recipes-connectivity/openssh/openssh-5.9p1/sshd @@ -1,10 +1,10 @@ -#%PAM-1.0
-
-auth include common-auth
-account required pam_nologin.so
-account include common-account
-password include common-password
-session optional pam_keyinit.so force revoke
-session include common-session
-session required pam_loginuid.so
-
+#%PAM-1.0 + +auth include common-auth +account required pam_nologin.so +account include common-account +password include common-password +session optional pam_keyinit.so force revoke +session include common-session +session required pam_loginuid.so + diff --git a/recipes-connectivity/openssh/openssh-5.9p1/sshd.service b/recipes-connectivity/openssh/openssh-5.9p1/sshd.service index 1f1ca08..3efa9ee 100644..100755 --- a/recipes-connectivity/openssh/openssh-5.9p1/sshd.service +++ b/recipes-connectivity/openssh/openssh-5.9p1/sshd.service @@ -1,16 +1,16 @@ -[Unit]
-Description=SSH Secure Shell Service
-After=connman.service
-Requires=connman.service
-
-[Service]
-ExecStartPre=/lib/systemd/scripts/sshdgenkeys
-ExecStart=/usr/sbin/sshd -D
-
-[Install]
-WantedBy=multi-user.target
-
-# Note that this is the service file for running a single SSH server for all
-# incoming connections, suitable only for systems with a large amount of SSH
-# traffic. In almost all other cases it is a better idea to use sshd.socket +
-# sshd@.service.
+[Unit] +Description=SSH Secure Shell Service +After=connman.service +Requires=connman.service + +[Service] +ExecStartPre=/lib/systemd/scripts/sshdgenkeys +ExecStart=/usr/sbin/sshd -D + +[Install] +WantedBy=multi-user.target + +# Note that this is the service file for running a single SSH server for all +# incoming connections, suitable only for systems with a large amount of SSH +# traffic. In almost all other cases it is a better idea to use sshd.socket + +# sshd@.service. diff --git a/recipes-connectivity/openssh/openssh-5.9p1/sshd_config b/recipes-connectivity/openssh/openssh-5.9p1/sshd_config new file mode 100644 index 0000000..4f9b626 --- /dev/null +++ b/recipes-connectivity/openssh/openssh-5.9p1/sshd_config @@ -0,0 +1,119 @@ +# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ + +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options change a +# default value. + +#Port 22 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +# Disable legacy (protocol version 1) support in the server for new +# installations. In future the default will change to require explicit +# activation of protocol 1 +Protocol 2 + +# HostKey for protocol version 1 +#HostKey /etc/ssh/ssh_host_key +# HostKeys for protocol version 2 +#HostKey /etc/ssh/ssh_host_rsa_key +#HostKey /etc/ssh/ssh_host_dsa_key + +# Lifetime and size of ephemeral version 1 server key +#KeyRegenerationInterval 1h +#ServerKeyBits 1024 + +# Logging +# obsoletes QuietMode and FascistLogging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin yes +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +#RSAAuthentication yes +#PubkeyAuthentication yes +#AuthorizedKeysFile .ssh/authorized_keys + +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts +#RhostsRSAAuthentication no +# similar for protocol version 2 +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# RhostsRSAAuthentication and HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +# Change to no to disable s/key passwords +#ChallengeResponseAuthentication yes + +# Kerberos options +#KerberosAuthentication no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes +#KerberosGetAFSToken no + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +#UsePAM no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#X11Forwarding no +#X11DisplayOffset 10 +#X11UseLocalhost yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +UsePrivilegeSeparation yes +#PermitUserEnvironment no +Compression no +ClientAliveInterval 15 +ClientAliveCountMax 4 +#UseDNS yes +#PidFile /var/run/sshd.pid +#MaxStartups 10 +#PermitTunnel no +#ChrootDirectory none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp /usr/libexec/sftp-server + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# ForceCommand cvs server diff --git a/recipes-connectivity/openssh/openssh-5.9p1/sshdgenkeys b/recipes-connectivity/openssh/openssh-5.9p1/sshdgenkeys index 61709b1..0fca8a7 100644 --- a/recipes-connectivity/openssh/openssh-5.9p1/sshdgenkeys +++ b/recipes-connectivity/openssh/openssh-5.9p1/sshdgenkeys @@ -1,26 +1,26 @@ -#!/bin/sh
-
-# This script
-# generates host keys
-# check /var/run/sshd nad creates it if not already created
-
-
-if ! [ -f /etc/ssh/ssh_host_ecdsa_key ]; then
- /usr/bin/ssh-keygen -q -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key || exit 1
-fi
-
-if ! [ -f /etc/ssh/ssh_host_rsa_key ]; then
- /usr/bin/ssh-keygen -q -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key || exit 1
-fi
-
-if ! [ -f /etc/ssh/ssh_host_dsa_key ]; then
- /usr/bin/ssh-keygen -q -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key || exit 1
-fi
-
-if [ ! -d /var/run/sshd ]; then
- mkdir /var/run/sshd || exit 1
- chmod 0755 /var/run/sshd || exit 1
-fi
-
-# `test' returns non-zero when it fails. Don't let this hold up ExecStart.
+#!/bin/sh + +# This script +# generates host keys +# check /var/run/sshd nad creates it if not already created + + +if ! [ -f /etc/ssh/ssh_host_ecdsa_key ]; then + /usr/bin/ssh-keygen -q -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key || exit 1 +fi + +if ! [ -f /etc/ssh/ssh_host_rsa_key ]; then + /usr/bin/ssh-keygen -q -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key || exit 1 +fi + +if ! [ -f /etc/ssh/ssh_host_dsa_key ]; then + /usr/bin/ssh-keygen -q -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key || exit 1 +fi + +if [ ! -d /var/run/sshd ]; then + mkdir /var/run/sshd || exit 1 + chmod 0755 /var/run/sshd || exit 1 +fi + +# `test' returns non-zero when it fails. Don't let this hold up ExecStart. exit 0
\ No newline at end of file diff --git a/recipes-connectivity/openssh/openssh_5.9p1.bb b/recipes-connectivity/openssh/openssh_5.9p1.bb new file mode 100644 index 0000000..d499fcb --- /dev/null +++ b/recipes-connectivity/openssh/openssh_5.9p1.bb @@ -0,0 +1,146 @@ +SUMMARY = "Secure rlogin/rsh/rcp/telnet replacement" +DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \ +Ssh (Secure Shell) is a program for logging into a remote machine \ +and for executing commands on a remote machine." +HOMEPAGE = "http://openssh.org" +SECTION = "console/network" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENCE;md5=bae9a689be41581503bcf95d8fb42c4e" + +PR = "r3" + +DEPENDS = "zlib openssl" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +RPROVIDES = "ssh sshd" + +CONFLICTS_${PN} = "dropbear" +RCONFLICTS_${PN}-sshd = "dropbear" +RCONFLICTS_${PN}-keygen = "ssh-keygen" + +SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \ + file://nostrip.patch \ + file://sshd_config \ + file://ssh_config \ + file://init \ + file://sshd.service \ + file://sshdgenkeys \ + ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" + +PAM_SRC_URI = "file://sshd" +SRC_URI[md5sum] = "afe17eee7e98d3b8550cc349834a85d0" +SRC_URI[sha256sum] = "8d3e8b6b6ff04b525a6dfa6fdeb6a99043ccf6c3310cc32eba84c939b07777d5" + +#inherit useradd update-rc.d +inherit useradd + +USERADD_PACKAGES = "${PN}-sshd" +USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" + +#INITSCRIPT_PACKAGES = "${PN}-sshd" +#INITSCRIPT_NAME_${PN}-sshd = "sshd" +#INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" + +inherit autotools + +# LFS support: +CFLAGS += "-D__FILE_OFFSET_BITS=64" +export LD = "${CC}" + +EXTRA_OECONF = "--with-rand-helper=no \ + ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \ + --without-zlib-version-check \ + --with-privsep-path=/var/run/sshd \ + --sysconfdir=${sysconfdir}/ssh \ + --with-xauth=/usr/bin/xauth" + +# This is a workaround for uclibc because including stdio.h +# pulls in pthreads.h and causes conflicts in function prototypes. +# This results in compilation failure, so unless this is fixed, +# disable pam for uclibc. +EXTRA_OECONF_append_libc-uclibc=" --without-pam" + +do_configure_prepend () { + if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then + cp aclocal.m4 acinclude.m4 + fi +} + +do_compile_append () { + install -m 0644 ${WORKDIR}/sshd_config ${S}/ + install -m 0644 ${WORKDIR}/ssh_config ${S}/ +} + +do_install_append () { + for i in ${DISTRO_FEATURES}; + do + if [ ${i} = "pam" ]; then + install -d ${D}${sysconfdir}/pam.d + install -m 0755 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd + fi + done +# install -d ${D}${sysconfdir}/init.d +# install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd + mv ${D}${bindir}/scp ${D}${bindir}/scp.${PN} + mv ${D}${bindir}/ssh ${D}${bindir}/ssh.${PN} + rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin + rmdir ${D}/var/run/sshd ${D}/var/run ${D}/var + install -d ${D}/run/sshd + chmod 0755 ${D}/run/sshd + + install -d -m 0755 ${D}/lib/systemd/system/multi-user.target.wants/ + install -m 0755 ${WORKDIR}/sshd.service ${D}/lib/systemd/system/sshd.service + ln -s ../sshd.service ${D}/lib/systemd/system/multi-user.target.wants/sshd.service + install -d -m 0755 ${D}/lib/systemd/scripts/ + install -m 0755 ${WORKDIR}/sshdgenkeys ${D}/lib/systemd/scripts/sshdgenkeys + +} + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server" +FILES_${PN}-scp = "${bindir}/scp.${PN}" +FILES_${PN}-ssh = "${bindir}/ssh.${PN} ${sysconfdir}/ssh/ssh_config" +#FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd" +FILES_${PN}-sshd = "${sbindir}/sshd \ + /run/sshd \ + /lib/systemd \ + " +FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/*" +FILES_${PN}-sftp = "${bindir}/sftp" +FILES_${PN}-sftp-server = "${libexecdir}/sftp-server" +FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*" +FILES_${PN}-keygen = "${bindir}/ssh-keygen" + +RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen" +DEPENDS_${PN}-sshd += "update-rc.d" +RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen" + +pkg_postinst_${PN}-scp () { + update-alternatives --install ${bindir}/scp scp scp.${PN} 90 +} + +pkg_postinst_${PN}-ssh () { + update-alternatives --install ${bindir}/ssh ssh ssh.${PN} 90 +} + +# Generate host keys at do_rootfs +pkg_postinst_${PN}-sshd () { + ssh-keygen -q -f ${D}/etc/ssh/ssh_host_rsa_key -N '' -t rsa + ssh-keygen -q -f ${D}/etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa + ssh-keygen -q -f ${D}/etc/ssh/ssh_host_dsa_key -N '' -t dsa +} + +pkg_postrm_${PN}-ssh () { + update-alternatives --remove ${bindir}/ssh ssh.${PN} +} + +pkg_postrm_${PN}-scp () { + update-alternatives --remove ${bindir}/scp scp.${PN} +} + +CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" +CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" + +# Skip unsafe-references-in-scripts QA test to avoid useless warnings +WARN_QA = "ldflags useless-rpaths rpaths unsafe-references-in-binaries staticdev" diff --git a/recipes-connectivity/portmap/portmap-6.0/destdir-no-strip.patch b/recipes-connectivity/portmap/portmap-6.0/destdir-no-strip.patch new file mode 100644 index 0000000..2fbf784 --- /dev/null +++ b/recipes-connectivity/portmap/portmap-6.0/destdir-no-strip.patch @@ -0,0 +1,46 @@ +Upstream-Status: Backport + +From: Mike Frysinger <vapier@gentoo.org> +Date: Sun, 13 May 2007 21:15:12 +0000 (-0400) +Subject: respect DESTDIR and dont use -s with install +X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=603c59b978c04df2354f68d4a2dc676a758ff46d + +respect DESTDIR and dont use -s with install + +$(DESTDIR) is the standard for installing into other trees, not $(BASEDIR) ... +so I've converted the Makefile to use that. I've also left in $(BASEDIR) as a +default to support old installs; not sure if you'd just cut it. + +Stripping should be left to the person to handle, not automatically done by +the install step. Also, `install -s` always calls `strip` which is +wrong/undesired in cross-compiling scenarios. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Neil Brown <neilb@suse.de> +--- + +diff --git a/Makefile b/Makefile +index 9e9a4b4..5343428 100644 +--- a/Makefile ++++ b/Makefile +@@ -135,13 +135,14 @@ from_local: CPPFLAGS += -DTEST + portmap.man : portmap.8 + sed $(MAN_SED) < portmap.8 > portmap.man + ++DESTDIR = $(BASEDIR) + install: all +- install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin +- install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin +- install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin +- install -o root -g root -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8 +- install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8 +- install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8 ++ install -o root -g root -m 0755 portmap $(DESTDIR)/sbin ++ install -o root -g root -m 0755 pmap_dump $(DESTDIR)/sbin ++ install -o root -g root -m 0755 pmap_set $(DESTDIR)/sbin ++ install -o root -g root -m 0644 portmap.man $(DESTDIR)/usr/share/man/man8/portmap.8 ++ install -o root -g root -m 0644 pmap_dump.8 $(DESTDIR)/usr/share/man/man8 ++ install -o root -g root -m 0644 pmap_set.8 $(DESTDIR)/usr/share/man/man8 + + clean: + rm -f *.o portmap pmap_dump pmap_set from_local \ diff --git a/recipes-connectivity/portmap/portmap-6.0/tcpd-config.patch b/recipes-connectivity/portmap/portmap-6.0/tcpd-config.patch index f07ba0a..2f25058 100644 --- a/recipes-connectivity/portmap/portmap-6.0/tcpd-config.patch +++ b/recipes-connectivity/portmap/portmap-6.0/tcpd-config.patch @@ -1,30 +1,30 @@ -Upstream-Status: Backport
-
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 13 May 2007 21:17:32 +0000 (-0400)
-Subject: fix building with tcpd support disabled
-X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=7847207aed1b44faf077eed14a9ac9c68244eba5
-
-fix building with tcpd support disabled
-
-Make sure pmap_check.c only includes tcpd.h when HOSTS_ACCESS is defined.
-
-Signed-off-by: Timothy Redaelli <drizzt@gentoo.org>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-Signed-off-by: Neil Brown <neilb@suse.de>
----
-
-diff --git a/pmap_check.c b/pmap_check.c
-index 84f2c12..443a822 100644
---- a/pmap_check.c
-+++ b/pmap_check.c
-@@ -44,7 +44,9 @@
- #include <netinet/in.h>
- #include <rpc/rpcent.h>
- #endif
-+#ifdef HOSTS_ACCESS
- #include <tcpd.h>
-+#endif
- #include <arpa/inet.h>
- #include <grp.h>
-
+Upstream-Status: Backport + +From: Mike Frysinger <vapier@gentoo.org> +Date: Sun, 13 May 2007 21:17:32 +0000 (-0400) +Subject: fix building with tcpd support disabled +X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=7847207aed1b44faf077eed14a9ac9c68244eba5 + +fix building with tcpd support disabled + +Make sure pmap_check.c only includes tcpd.h when HOSTS_ACCESS is defined. + +Signed-off-by: Timothy Redaelli <drizzt@gentoo.org> +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Neil Brown <neilb@suse.de> +--- + +diff --git a/pmap_check.c b/pmap_check.c +index 84f2c12..443a822 100644 +--- a/pmap_check.c ++++ b/pmap_check.c +@@ -44,7 +44,9 @@ + #include <netinet/in.h> + #include <rpc/rpcent.h> + #endif ++#ifdef HOSTS_ACCESS + #include <tcpd.h> ++#endif + #include <arpa/inet.h> + #include <grp.h> + diff --git a/recipes-connectivity/portmap/portmap.inc b/recipes-connectivity/portmap/portmap.inc index 7271fb2..bf7fcb4 100644 --- a/recipes-connectivity/portmap/portmap.inc +++ b/recipes-connectivity/portmap/portmap.inc @@ -1,31 +1,31 @@ -DESCRIPTION = "RPC program number mapper."
-HOMEPAGE = "http://neil.brown.name/portmap/"
-SECTION = "console/network"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://portmap.c;beginline=2;endline=31;md5=51ff67e66ec84b2009b017b1f94afbf4 \
- file://from_local.c;beginline=9;endline=35;md5=1bec938a2268b8b423c58801ace3adc1"
-DEPENDS = "virtual/fakeroot-native"
-
-SRC_URI = "${DEBIAN_MIRROR}/main/p/portmap/portmap_5.orig.tar.gz \
- ${DEBIAN_MIRROR}/main/p/portmap/portmap_${PV}.diff.gz \
- file://portmap.init \
- file://make.patch;apply=yes"
-S = "${WORKDIR}/portmap_5beta"
-
-INITSCRIPT_NAME = "portmap"
-INITSCRIPT_PARAMS = "start 43 S . start 32 0 6 . stop 81 1 ."
-
-#inherit update-rc.d
-
-sbindir = "/sbin"
-
-fakeroot do_install() {
-# install -d ${D}${sysconfdir}/init.d
- install -d ${D}${base_sbindir}
-# install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
- oe_runmake 'docdir=${docdir}/portmap' 'DESTDIR=${D}' install
-}
-
-PACKAGES =+ "portmap-utils"
-FILES_portmap-utils = "/sbin/pmap_set /sbin/pmap_dump"
-FILES_${PN}-doc += "${docdir}"
+DESCRIPTION = "RPC program number mapper." +HOMEPAGE = "http://neil.brown.name/portmap/" +SECTION = "console/network" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://portmap.c;beginline=2;endline=31;md5=51ff67e66ec84b2009b017b1f94afbf4 \ + file://from_local.c;beginline=9;endline=35;md5=1bec938a2268b8b423c58801ace3adc1" +DEPENDS = "virtual/fakeroot-native" + +SRC_URI = "${DEBIAN_MIRROR}/main/p/portmap/portmap_5.orig.tar.gz \ + ${DEBIAN_MIRROR}/main/p/portmap/portmap_${PV}.diff.gz \ + file://portmap.init \ + file://make.patch;apply=yes" +S = "${WORKDIR}/portmap_5beta" + +INITSCRIPT_NAME = "portmap" +INITSCRIPT_PARAMS = "start 43 S . start 32 0 6 . stop 81 1 ." + +#inherit update-rc.d + +sbindir = "/sbin" + +fakeroot do_install() { +# install -d ${D}${sysconfdir}/init.d + install -d ${D}${base_sbindir} +# install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap + oe_runmake 'docdir=${docdir}/portmap' 'DESTDIR=${D}' install +} + +PACKAGES =+ "portmap-utils" +FILES_portmap-utils = "/sbin/pmap_set /sbin/pmap_dump" +FILES_${PN}-doc += "${docdir}" diff --git a/recipes-connectivity/portmap/portmap/portmap.init b/recipes-connectivity/portmap/portmap/portmap.init new file mode 100755 index 0000000..e46513e --- /dev/null +++ b/recipes-connectivity/portmap/portmap/portmap.init @@ -0,0 +1,59 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: portmap +# Required-Start: $network +# Required-Stop: $network +# Default-Start: S 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: The RPC portmapper +# Description: Portmap is a server that converts RPC (Remote +# Procedure Call) program numbers into DARPA +# protocol port numbers. It must be running in +# order to make RPC calls. Services that use +# RPC include NFS and NIS. +### END INIT INFO + +test -f /sbin/portmap || exit 0 + +case "$1" in + start) + echo "Starting portmap daemon..." + start-stop-daemon --start --quiet --exec /sbin/portmap + + if [ -f /var/run/portmap.upgrade-state ]; then + echo "Restoring old RPC service information..." + sleep 1 # needs a short pause or pmap_set won't work. :( + pmap_set </var/run/portmap.upgrade-state + rm -f /var/run/portmap.upgrade-state + echo "done." + fi + + ;; + stop) + echo "Stopping portmap daemon..." + start-stop-daemon --stop --quiet --exec /sbin/portmap + ;; + reload) + ;; + force-reload) + $0 restart + ;; + restart) + pmap_dump >/var/run/portmap.state + $0 stop + $0 start + if [ ! -f /var/run/portmap.upgrade-state ]; then + sleep 1 + pmap_set </var/run/portmap.state + fi + rm -f /var/run/portmap.state + ;; + *) + echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}" + exit 1 + ;; +esac + +exit 0 + diff --git a/recipes-connectivity/portmap/portmap_6.0.bb b/recipes-connectivity/portmap/portmap_6.0.bb index ebebd85..c84e5e3 100644 --- a/recipes-connectivity/portmap/portmap_6.0.bb +++ b/recipes-connectivity/portmap/portmap_6.0.bb @@ -1,24 +1,24 @@ -require portmap.inc
-
-DEPENDS += "tcp-wrappers"
-PR = "r7"
-
-SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \
- file://destdir-no-strip.patch \
- file://tcpd-config.patch \
- file://portmap.init"
-
-SRC_URI[md5sum] = "ac108ab68bf0f34477f8317791aaf1ff"
-SRC_URI[sha256sum] = "02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de"
-
-S = "${WORKDIR}/${BPN}_${PV}/"
-
-CPPFLAGS += "-DFACILITY=LOG_DAEMON -DENABLE_DNS -DHOSTS_ACCESS"
-CFLAGS += "-Wall -Wstrict-prototypes -fPIC"
-
-fakeroot do_install() {
- #install -d ${D}${mandir}/man8/ ${D}${base_sbindir} ${D}${sysconfdir}/init.d
- install -d ${D}${mandir}/man8/ ${D}${base_sbindir}
- #install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
- oe_runmake install DESTDIR=${D}
-}
+require portmap.inc + +DEPENDS += "tcp-wrappers" +PR = "r7" + +SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \ + file://destdir-no-strip.patch \ + file://tcpd-config.patch \ + file://portmap.init" + +SRC_URI[md5sum] = "ac108ab68bf0f34477f8317791aaf1ff" +SRC_URI[sha256sum] = "02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de" + +S = "${WORKDIR}/${BPN}_${PV}/" + +CPPFLAGS += "-DFACILITY=LOG_DAEMON -DENABLE_DNS -DHOSTS_ACCESS" +CFLAGS += "-Wall -Wstrict-prototypes -fPIC" + +fakeroot do_install() { + #install -d ${D}${mandir}/man8/ ${D}${base_sbindir} ${D}${sysconfdir}/init.d + install -d ${D}${mandir}/man8/ ${D}${base_sbindir} + #install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap + oe_runmake install DESTDIR=${D} +} |