From 6b4c82f4657bdb56e6b7a56651d6d4bb91a35b8f Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:29:32 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- .../connman/connman-init-systemd.bb | 32 ++++++++ .../recipes-connectivity/connman/connman_git.bb | 51 ++++++++++++ ...1-doc-Debugging-in-host-that-uses-systemd.patch | 44 ++++++++++ ...-environment-file-for-connmand-debug-opti.patch | 31 +++++++ ...-environment-file-for-connman-vpnd-debug-.patch | 32 ++++++++ .../connman/files/add_xuser_dbus_permission.patch | 21 +++++ .../recipes-connectivity/connman/files/connman | 61 ++++++++++++++ .../connman/files/connman-init-settings.sh | 96 ++++++++++++++++++++++ .../connman/files/connman-init.service | 13 +++ 9 files changed, 381 insertions(+) create mode 100644 meta-eca/recipes-connectivity/connman/connman-init-systemd.bb create mode 100644 meta-eca/recipes-connectivity/connman/connman_git.bb create mode 100644 meta-eca/recipes-connectivity/connman/files/0001-doc-Debugging-in-host-that-uses-systemd.patch create mode 100644 meta-eca/recipes-connectivity/connman/files/0002-systemd-Use-environment-file-for-connmand-debug-opti.patch create mode 100644 meta-eca/recipes-connectivity/connman/files/0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch create mode 100644 meta-eca/recipes-connectivity/connman/files/add_xuser_dbus_permission.patch create mode 100644 meta-eca/recipes-connectivity/connman/files/connman create mode 100755 meta-eca/recipes-connectivity/connman/files/connman-init-settings.sh create mode 100644 meta-eca/recipes-connectivity/connman/files/connman-init.service (limited to 'meta-eca/recipes-connectivity/connman') diff --git a/meta-eca/recipes-connectivity/connman/connman-init-systemd.bb b/meta-eca/recipes-connectivity/connman/connman-init-systemd.bb new file mode 100644 index 0000000..822a4a4 --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/connman-init-systemd.bb @@ -0,0 +1,32 @@ +SUMMARY = "Initialization service for ConnMan" +DESCRIPTION = "Initializes necessary ConnMan services. This is \ +needed in headless system, otherwise we might not be able to \ +connect to device after installation. This service is only run \ +once in the first boot.\ +" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://connman-init-settings.sh;beginline=7;endline=18;md5=95c5d66479370ef3964c4aef9255476f" + +SRC_URI = "\ + file://connman-init-settings.sh \ + file://connman-init.service \ +" + +S = "${WORKDIR}" +PR = "r0" + +inherit systemd + +SYSTEMD_PACKAGES = "connman-init-systemd" + +SYSTEMD_SERVICE_${PN} = " connman-init.service" + +FILES_${PN} = " connman-init.service \ + ${libdir}/connman/connman-init-settings.sh" + +do_install() { + install -d ${D}${libdir}/connman + install -d ${D}${nonarch_base_libdir}/systemd/system + install -m 0755 ${WORKDIR}/connman-init-settings.sh ${D}${libdir}/connman + install -m 0755 ${WORKDIR}/connman-init.service ${D}${nonarch_base_libdir}/systemd/system +} diff --git a/meta-eca/recipes-connectivity/connman/connman_git.bb b/meta-eca/recipes-connectivity/connman/connman_git.bb new file mode 100644 index 0000000..0f4274c --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/connman_git.bb @@ -0,0 +1,51 @@ +require recipes-connectivity/connman/connman.inc + +# We use a known good version instead of some buggy point version. +SRCREV = "f5a441e9d636eefd98335322e79e71ca7e4f55cc" +SRC_URI = "\ + git://git.kernel.org/pub/scm/network/connman/connman.git \ + file://add_xuser_dbus_permission.patch \ +" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36 \ +" + +# Enable debugging the easy way in systemd based distro. +# See 0001-doc-Debugging-in-host-that-uses-systemd.patch for usage. +SRC_URI += "\ + file://0002-systemd-Use-environment-file-for-connmand-debug-opti.patch \ + file://0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch \ +" + +S = "${WORKDIR}/git" +PR = "${INC_PR}.0" +PV = "1.23+git${SRCPV}" + + +# Override some options from poky connman recipe +EXTRA_OECONF += "\ + --enable-loopback=builtin \ + --enable-ethernet=builtin \ + --enable-test \ + --enable-client \ + --enable-tools \ + --disable-polkit \ + --enable-pacrunner \ + --enable-wispr \ +" + + +# Make sure we will use bluez5 instead of older bluez4 +PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez5" +RDEPENDS_${PN} = "\ + dbus \ + ${@base_contains('PACKAGECONFIG', 'bluetooth', 'bluez5', '', d)} \ + ${@base_contains('PACKAGECONFIG', 'wifi','wpa-supplicant', '', d)} \ + ${@base_contains('PACKAGECONFIG', '3g','ofono', '', d)} \ + " + + +do_install_append() { + install -d ${D}${sysconfdir}/connman + install -m 0644 ${S}/src/main.conf ${D}${sysconfdir}/connman/main.conf.example +} diff --git a/meta-eca/recipes-connectivity/connman/files/0001-doc-Debugging-in-host-that-uses-systemd.patch b/meta-eca/recipes-connectivity/connman/files/0001-doc-Debugging-in-host-that-uses-systemd.patch new file mode 100644 index 0000000..421beba --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/0001-doc-Debugging-in-host-that-uses-systemd.patch @@ -0,0 +1,44 @@ +From 5365d78227f3c44338079e8c9c69494d038bfa6c Mon Sep 17 00:00:00 2001 +From: Jukka Rissanen +Date: Wed, 13 Mar 2013 11:15:21 +0200 +Subject: [PATCH 1/3] doc: Debugging in host that uses systemd + +Upstream-Status: Denied + +Not accepted as distros can override the default ConnMan service file. + +Signed-off-by: Jukka Rissanen +--- + README | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/README b/README +index bfb246a..e97b536 100644 +--- a/README ++++ b/README +@@ -246,6 +246,22 @@ Following environment variables can be used: + Example: + CONNMAN_WEB_DEBUG=1 src/connmand -n + ++If the host is using systemd when starting ConnMan, then one can activate ++debugging easily by creating /etc/connman/connmand.env file and setting ++debug options there. By default the env file does not exist. ++ ++The following example would activate debugging in src/s*.c files and ++also turn on Internet connectivity check debugging if placed into ++connmand.env file: ++ DEBUG=-d src/s*.c ++ CONNMAN_WEB_DEBUG=1 ++ ++Note that one should not use quotation marks in env file as the systemd ++will not use shell to expand them. ++ ++For connman-vpnd daemon debugging, a similiar /etc/connman/connman-vpnd.env ++file can be created. ++ + + Kernel configuration + ==================== +-- +1.7.11.4 + diff --git a/meta-eca/recipes-connectivity/connman/files/0002-systemd-Use-environment-file-for-connmand-debug-opti.patch b/meta-eca/recipes-connectivity/connman/files/0002-systemd-Use-environment-file-for-connmand-debug-opti.patch new file mode 100644 index 0000000..8a683d6 --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/0002-systemd-Use-environment-file-for-connmand-debug-opti.patch @@ -0,0 +1,31 @@ +From 656ff42ff42da965865cc6e012404d820692cf71 Mon Sep 17 00:00:00 2001 +From: Jukka Rissanen +Date: Wed, 13 Mar 2013 11:16:33 +0200 +Subject: [PATCH 2/3] systemd: Use environment file for connmand debug options + +Upstream-Status: Denied + +Not accepted as distros can override the default ConnMan service file. + +Signed-off-by: Jukka Rissanen +--- + src/connman.service.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/connman.service.in b/src/connman.service.in +index 2e9e4d5..fa57d4e 100644 +--- a/src/connman.service.in ++++ b/src/connman.service.in +@@ -6,7 +6,8 @@ After=syslog.target + Type=dbus + BusName=net.connman + Restart=on-failure +-ExecStart=@prefix@/sbin/connmand -n ++EnvironmentFile=-@sysconfdir@/connman/connmand.env ++ExecStart=@prefix@/sbin/connmand -n $DEBUG + StandardOutput=null + + [Install] +-- +1.7.11.4 + diff --git a/meta-eca/recipes-connectivity/connman/files/0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch b/meta-eca/recipes-connectivity/connman/files/0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch new file mode 100644 index 0000000..31d5bc8 --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch @@ -0,0 +1,32 @@ +From 5fb01b667a56d65ccb2b1174df9fe7190a5349f2 Mon Sep 17 00:00:00 2001 +From: Jukka Rissanen +Date: Wed, 13 Mar 2013 11:17:24 +0200 +Subject: [PATCH 3/3] systemd: Use environment file for connman-vpnd debug + options + +Upstream-Status: Denied + +Not accepted as distros can override the default ConnMan service file. + +Signed-off-by: Jukka Rissanen +--- + vpn/connman-vpn.service.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/vpn/connman-vpn.service.in b/vpn/connman-vpn.service.in +index ec02a86..2472f00 100644 +--- a/vpn/connman-vpn.service.in ++++ b/vpn/connman-vpn.service.in +@@ -5,7 +5,8 @@ After=syslog.target + [Service] + Type=dbus + BusName=net.connman.vpn +-ExecStart=@prefix@/sbin/connman-vpnd -n ++EnvironmentFile=-@sysconfdir@/connman/connman-vpnd.env ++ExecStart=@prefix@/sbin/connman-vpnd -n $DEBUG + StandardOutput=null + + [Install] +-- +1.7.11.4 + diff --git a/meta-eca/recipes-connectivity/connman/files/add_xuser_dbus_permission.patch b/meta-eca/recipes-connectivity/connman/files/add_xuser_dbus_permission.patch new file mode 100644 index 0000000..707b3ca --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/add_xuser_dbus_permission.patch @@ -0,0 +1,21 @@ +Because Poky doesn't support at_console we need to special-case the session +user. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Ross Burton + +diff --git a/src/connman-dbus.conf b/src/connman-dbus.conf +index 98a773e..466809c 100644 +--- a/src/connman-dbus.conf ++++ b/src/connman-dbus.conf +@@ -8,6 +8,9 @@ + + + ++ ++ ++ + + + diff --git a/meta-eca/recipes-connectivity/connman/files/connman b/meta-eca/recipes-connectivity/connman/files/connman new file mode 100644 index 0000000..4a0017f --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/connman @@ -0,0 +1,61 @@ +#!/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 0 ; then + $DAEMON $EXTRA_PARAM + fi +} + +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/meta-eca/recipes-connectivity/connman/files/connman-init-settings.sh b/meta-eca/recipes-connectivity/connman/files/connman-init-settings.sh new file mode 100755 index 0000000..9b4f040 --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/connman-init-settings.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# +# Connection Manager Init Service +# +# Copyright (C) 2012 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 + + +CONNMAN_DIR=/var/lib/connman +CONNMAN_SETTINGS=$CONNMAN_DIR/settings + +if [ -s $CONNMAN_SETTINGS ]; then + exit 0 +fi + +if [ ! -d $CONNMAN_DIR ]; then + mkdir -p $CONNMAN_DIR +fi + +TETHERING="$1" +TETHERING_AP_PASSPHRASE="$2" +TETHERING_AP_SSID="$3" + +if [ -z "$TETHERING" ]; then + TETHERING="true" +fi + +# Create main.conf with those values that we need +MAINCONF=/etc/connman/main.conf +cat > $MAINCONF < $CONNMAN_SETTINGS <