diff options
| author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:29:32 +0200 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:29:32 +0200 |
| commit | 6b4c82f4657bdb56e6b7a56651d6d4bb91a35b8f (patch) | |
| tree | 814ad3da280833de03535ca04cf5068da1d31822 /meta-eca/recipes-connectivity | |
| download | meta-eca-daisy-enea.tar.gz | |
initial commit for Enea Linux 4.0daisy-enea
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta-eca/recipes-connectivity')
21 files changed, 658 insertions, 0 deletions
diff --git a/meta-eca/recipes-connectivity/bluez5/bluez5_git.bb b/meta-eca/recipes-connectivity/bluez5/bluez5_git.bb new file mode 100644 index 0000000..f327e9c --- /dev/null +++ b/meta-eca/recipes-connectivity/bluez5/bluez5_git.bb | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | require recipes-connectivity/bluez5/bluez5.inc | ||
| 2 | |||
| 3 | SRCREV = "cdfdc6b2b6182ef09c28d49873f79c581ab04de5" | ||
| 4 | SRC_URI = "\ | ||
| 5 | git://git.kernel.org/pub/scm/bluetooth/bluez.git \ | ||
| 6 | file://bluetooth.conf \ | ||
| 7 | file://fix-udev-paths.patch \ | ||
| 8 | " | ||
| 9 | |||
| 10 | S = "${WORKDIR}/git" | ||
| 11 | PV = "5.18+git${SRCPV}" | ||
| 12 | |||
| 13 | EXTRA_OECONF += "\ | ||
| 14 | --disable-obex \ | ||
| 15 | --enable-client \ | ||
| 16 | " | ||
| 17 | |||
| 18 | do_install_append() { | ||
| 19 | # gatttool is useful to have so add it to the bluez5 package | ||
| 20 | install -m 0755 ${S}/attrib/gatttool ${D}/${bindir} | ||
| 21 | } | ||
diff --git a/meta-eca/recipes-connectivity/bluez5/files/bluetooth.conf b/meta-eca/recipes-connectivity/bluez5/files/bluetooth.conf new file mode 100644 index 0000000..0495200 --- /dev/null +++ b/meta-eca/recipes-connectivity/bluez5/files/bluetooth.conf | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | <!-- This configuration file specifies the required security policies | ||
| 2 | for Bluetooth core daemon to work. --> | ||
| 3 | |||
| 4 | <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | ||
| 5 | "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | ||
| 6 | <busconfig> | ||
| 7 | |||
| 8 | <!-- ../system.conf have denied everything, so we just punch some holes --> | ||
| 9 | |||
| 10 | <policy user="root"> | ||
| 11 | <allow own="org.bluez"/> | ||
| 12 | <allow send_destination="org.bluez"/> | ||
| 13 | <allow send_interface="org.bluez.Agent1"/> | ||
| 14 | <allow send_interface="org.bluez.MediaEndpoint1"/> | ||
| 15 | <allow send_interface="org.bluez.MediaPlayer1"/> | ||
| 16 | <allow send_interface="org.bluez.ThermometerWatcher1"/> | ||
| 17 | <allow send_interface="org.bluez.AlertAgent1"/> | ||
| 18 | <allow send_interface="org.bluez.Profile1"/> | ||
| 19 | <allow send_interface="org.bluez.HeartRateWatcher1"/> | ||
| 20 | <allow send_interface="org.bluez.CyclingSpeedWatcher1"/> | ||
| 21 | </policy> | ||
| 22 | |||
| 23 | <policy at_console="true"> | ||
| 24 | <allow send_destination="org.bluez"/> | ||
| 25 | </policy> | ||
| 26 | |||
| 27 | <!-- allow users of lp group (printing subsystem) to | ||
| 28 | communicate with bluetoothd --> | ||
| 29 | <policy group="lp"> | ||
| 30 | <allow send_destination="org.bluez"/> | ||
| 31 | </policy> | ||
| 32 | |||
| 33 | <policy context="default"> | ||
| 34 | <deny send_destination="org.bluez"/> | ||
| 35 | </policy> | ||
| 36 | |||
| 37 | </busconfig> | ||
diff --git a/meta-eca/recipes-connectivity/bluez5/files/fix-udev-paths.patch b/meta-eca/recipes-connectivity/bluez5/files/fix-udev-paths.patch new file mode 100644 index 0000000..37362f5 --- /dev/null +++ b/meta-eca/recipes-connectivity/bluez5/files/fix-udev-paths.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | Add udevdir/udevrulesdir options | ||
| 2 | |||
| 3 | Upstream-Status: Inappropriate [configuration] | ||
| 4 | Signed-off-by: Constantin Musca <constantinx.musca@intel.com> | ||
| 5 | Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> | ||
| 6 | |||
| 7 | Index: bluez-5.0/Makefile.am | ||
| 8 | =================================================================== | ||
| 9 | --- bluez-5.0.orig/Makefile.am 2012-12-24 19:46:54.000000000 +0200 | ||
| 10 | +++ bluez-5.0/Makefile.am 2013-01-30 14:33:15.760615474 +0200 | ||
| 11 | @@ -175,7 +175,7 @@ | ||
| 12 | include Makefile.obexd | ||
| 13 | |||
| 14 | if HID2HCI | ||
| 15 | -rulesdir = @UDEV_DIR@/rules.d | ||
| 16 | +rulesdir = @UDEV_RULES_DIR@ | ||
| 17 | |||
| 18 | rules_DATA = tools/97-hid2hci.rules | ||
| 19 | |||
| 20 | Index: bluez-5.0/configure.ac | ||
| 21 | =================================================================== | ||
| 22 | --- bluez-5.0.orig/configure.ac 2012-12-24 19:46:54.000000000 +0200 | ||
| 23 | +++ bluez-5.0/configure.ac 2013-01-30 14:34:59.068613895 +0200 | ||
| 24 | @@ -160,6 +160,11 @@ | ||
| 25 | AC_SUBST(UDEV_DIR, [${path_udevdir}]) | ||
| 26 | fi | ||
| 27 | |||
| 28 | +AC_ARG_WITH([udevrulesdir], | ||
| 29 | + AS_HELP_STRING([--with-udevrulesdir=DIR], [udev rules directory]), | ||
| 30 | + [], [with_udevrulesdir=/lib/udev/rules.d]) | ||
| 31 | +AC_SUBST([UDEV_RULES_DIR], [$with_udevrulesdir]) | ||
| 32 | + | ||
| 33 | AM_CONDITIONAL(HID2HCI, test "${enable_tools}" != "no" && | ||
| 34 | test "${enable_udev}" != "no" && test "${enable_usb}" != "no") | ||
| 35 | |||
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 @@ | |||
| 1 | SUMMARY = "Initialization service for ConnMan" | ||
| 2 | DESCRIPTION = "Initializes necessary ConnMan services. This is \ | ||
| 3 | needed in headless system, otherwise we might not be able to \ | ||
| 4 | connect to device after installation. This service is only run \ | ||
| 5 | once in the first boot.\ | ||
| 6 | " | ||
| 7 | LICENSE = "GPLv2" | ||
| 8 | LIC_FILES_CHKSUM = "file://connman-init-settings.sh;beginline=7;endline=18;md5=95c5d66479370ef3964c4aef9255476f" | ||
| 9 | |||
| 10 | SRC_URI = "\ | ||
| 11 | file://connman-init-settings.sh \ | ||
| 12 | file://connman-init.service \ | ||
| 13 | " | ||
| 14 | |||
| 15 | S = "${WORKDIR}" | ||
| 16 | PR = "r0" | ||
| 17 | |||
| 18 | inherit systemd | ||
| 19 | |||
| 20 | SYSTEMD_PACKAGES = "connman-init-systemd" | ||
| 21 | |||
| 22 | SYSTEMD_SERVICE_${PN} = " connman-init.service" | ||
| 23 | |||
| 24 | FILES_${PN} = " connman-init.service \ | ||
| 25 | ${libdir}/connman/connman-init-settings.sh" | ||
| 26 | |||
| 27 | do_install() { | ||
| 28 | install -d ${D}${libdir}/connman | ||
| 29 | install -d ${D}${nonarch_base_libdir}/systemd/system | ||
| 30 | install -m 0755 ${WORKDIR}/connman-init-settings.sh ${D}${libdir}/connman | ||
| 31 | install -m 0755 ${WORKDIR}/connman-init.service ${D}${nonarch_base_libdir}/systemd/system | ||
| 32 | } | ||
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 @@ | |||
| 1 | require recipes-connectivity/connman/connman.inc | ||
| 2 | |||
| 3 | # We use a known good version instead of some buggy point version. | ||
| 4 | SRCREV = "f5a441e9d636eefd98335322e79e71ca7e4f55cc" | ||
| 5 | SRC_URI = "\ | ||
| 6 | git://git.kernel.org/pub/scm/network/connman/connman.git \ | ||
| 7 | file://add_xuser_dbus_permission.patch \ | ||
| 8 | " | ||
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ | ||
| 10 | file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36 \ | ||
| 11 | " | ||
| 12 | |||
| 13 | # Enable debugging the easy way in systemd based distro. | ||
| 14 | # See 0001-doc-Debugging-in-host-that-uses-systemd.patch for usage. | ||
| 15 | SRC_URI += "\ | ||
| 16 | file://0002-systemd-Use-environment-file-for-connmand-debug-opti.patch \ | ||
| 17 | file://0003-systemd-Use-environment-file-for-connman-vpnd-debug-.patch \ | ||
| 18 | " | ||
| 19 | |||
| 20 | S = "${WORKDIR}/git" | ||
| 21 | PR = "${INC_PR}.0" | ||
| 22 | PV = "1.23+git${SRCPV}" | ||
| 23 | |||
| 24 | |||
| 25 | # Override some options from poky connman recipe | ||
| 26 | EXTRA_OECONF += "\ | ||
| 27 | --enable-loopback=builtin \ | ||
| 28 | --enable-ethernet=builtin \ | ||
| 29 | --enable-test \ | ||
| 30 | --enable-client \ | ||
| 31 | --enable-tools \ | ||
| 32 | --disable-polkit \ | ||
| 33 | --enable-pacrunner \ | ||
| 34 | --enable-wispr \ | ||
| 35 | " | ||
| 36 | |||
| 37 | |||
| 38 | # Make sure we will use bluez5 instead of older bluez4 | ||
| 39 | PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez5" | ||
| 40 | RDEPENDS_${PN} = "\ | ||
| 41 | dbus \ | ||
| 42 | ${@base_contains('PACKAGECONFIG', 'bluetooth', 'bluez5', '', d)} \ | ||
| 43 | ${@base_contains('PACKAGECONFIG', 'wifi','wpa-supplicant', '', d)} \ | ||
| 44 | ${@base_contains('PACKAGECONFIG', '3g','ofono', '', d)} \ | ||
| 45 | " | ||
| 46 | |||
| 47 | |||
| 48 | do_install_append() { | ||
| 49 | install -d ${D}${sysconfdir}/connman | ||
| 50 | install -m 0644 ${S}/src/main.conf ${D}${sysconfdir}/connman/main.conf.example | ||
| 51 | } | ||
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 @@ | |||
| 1 | From 5365d78227f3c44338079e8c9c69494d038bfa6c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 3 | Date: Wed, 13 Mar 2013 11:15:21 +0200 | ||
| 4 | Subject: [PATCH 1/3] doc: Debugging in host that uses systemd | ||
| 5 | |||
| 6 | Upstream-Status: Denied | ||
| 7 | |||
| 8 | Not accepted as distros can override the default ConnMan service file. | ||
| 9 | |||
| 10 | Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 11 | --- | ||
| 12 | README | 16 ++++++++++++++++ | ||
| 13 | 1 file changed, 16 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/README b/README | ||
| 16 | index bfb246a..e97b536 100644 | ||
| 17 | --- a/README | ||
| 18 | +++ b/README | ||
| 19 | @@ -246,6 +246,22 @@ Following environment variables can be used: | ||
| 20 | Example: | ||
| 21 | CONNMAN_WEB_DEBUG=1 src/connmand -n | ||
| 22 | |||
| 23 | +If the host is using systemd when starting ConnMan, then one can activate | ||
| 24 | +debugging easily by creating /etc/connman/connmand.env file and setting | ||
| 25 | +debug options there. By default the env file does not exist. | ||
| 26 | + | ||
| 27 | +The following example would activate debugging in src/s*.c files and | ||
| 28 | +also turn on Internet connectivity check debugging if placed into | ||
| 29 | +connmand.env file: | ||
| 30 | + DEBUG=-d src/s*.c | ||
| 31 | + CONNMAN_WEB_DEBUG=1 | ||
| 32 | + | ||
| 33 | +Note that one should not use quotation marks in env file as the systemd | ||
| 34 | +will not use shell to expand them. | ||
| 35 | + | ||
| 36 | +For connman-vpnd daemon debugging, a similiar /etc/connman/connman-vpnd.env | ||
| 37 | +file can be created. | ||
| 38 | + | ||
| 39 | |||
| 40 | Kernel configuration | ||
| 41 | ==================== | ||
| 42 | -- | ||
| 43 | 1.7.11.4 | ||
| 44 | |||
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 @@ | |||
| 1 | From 656ff42ff42da965865cc6e012404d820692cf71 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 3 | Date: Wed, 13 Mar 2013 11:16:33 +0200 | ||
| 4 | Subject: [PATCH 2/3] systemd: Use environment file for connmand debug options | ||
| 5 | |||
| 6 | Upstream-Status: Denied | ||
| 7 | |||
| 8 | Not accepted as distros can override the default ConnMan service file. | ||
| 9 | |||
| 10 | Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 11 | --- | ||
| 12 | src/connman.service.in | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/src/connman.service.in b/src/connman.service.in | ||
| 16 | index 2e9e4d5..fa57d4e 100644 | ||
| 17 | --- a/src/connman.service.in | ||
| 18 | +++ b/src/connman.service.in | ||
| 19 | @@ -6,7 +6,8 @@ After=syslog.target | ||
| 20 | Type=dbus | ||
| 21 | BusName=net.connman | ||
| 22 | Restart=on-failure | ||
| 23 | -ExecStart=@prefix@/sbin/connmand -n | ||
| 24 | +EnvironmentFile=-@sysconfdir@/connman/connmand.env | ||
| 25 | +ExecStart=@prefix@/sbin/connmand -n $DEBUG | ||
| 26 | StandardOutput=null | ||
| 27 | |||
| 28 | [Install] | ||
| 29 | -- | ||
| 30 | 1.7.11.4 | ||
| 31 | |||
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 @@ | |||
| 1 | From 5fb01b667a56d65ccb2b1174df9fe7190a5349f2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 3 | Date: Wed, 13 Mar 2013 11:17:24 +0200 | ||
| 4 | Subject: [PATCH 3/3] systemd: Use environment file for connman-vpnd debug | ||
| 5 | options | ||
| 6 | |||
| 7 | Upstream-Status: Denied | ||
| 8 | |||
| 9 | Not accepted as distros can override the default ConnMan service file. | ||
| 10 | |||
| 11 | Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 12 | --- | ||
| 13 | vpn/connman-vpn.service.in | 3 ++- | ||
| 14 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/vpn/connman-vpn.service.in b/vpn/connman-vpn.service.in | ||
| 17 | index ec02a86..2472f00 100644 | ||
| 18 | --- a/vpn/connman-vpn.service.in | ||
| 19 | +++ b/vpn/connman-vpn.service.in | ||
| 20 | @@ -5,7 +5,8 @@ After=syslog.target | ||
| 21 | [Service] | ||
| 22 | Type=dbus | ||
| 23 | BusName=net.connman.vpn | ||
| 24 | -ExecStart=@prefix@/sbin/connman-vpnd -n | ||
| 25 | +EnvironmentFile=-@sysconfdir@/connman/connman-vpnd.env | ||
| 26 | +ExecStart=@prefix@/sbin/connman-vpnd -n $DEBUG | ||
| 27 | StandardOutput=null | ||
| 28 | |||
| 29 | [Install] | ||
| 30 | -- | ||
| 31 | 1.7.11.4 | ||
| 32 | |||
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 @@ | |||
| 1 | Because Poky doesn't support at_console we need to special-case the session | ||
| 2 | user. | ||
| 3 | |||
| 4 | Upstream-Status: Inappropriate [configuration] | ||
| 5 | |||
| 6 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
| 7 | |||
| 8 | diff --git a/src/connman-dbus.conf b/src/connman-dbus.conf | ||
| 9 | index 98a773e..466809c 100644 | ||
| 10 | --- a/src/connman-dbus.conf | ||
| 11 | +++ b/src/connman-dbus.conf | ||
| 12 | @@ -8,6 +8,9 @@ | ||
| 13 | <allow send_interface="net.connman.Counter"/> | ||
| 14 | <allow send_interface="net.connman.Notification"/> | ||
| 15 | </policy> | ||
| 16 | + <policy user="xuser"> | ||
| 17 | + <allow send_destination="net.connman"/> | ||
| 18 | + </policy> | ||
| 19 | <policy at_console="true"> | ||
| 20 | <allow send_destination="net.connman"/> | ||
| 21 | </policy> | ||
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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | DAEMON=/usr/sbin/connmand | ||
| 4 | PIDFILE=/var/run/connmand.pid | ||
| 5 | DESC="Connection Manager" | ||
| 6 | |||
| 7 | if [ -f /etc/default/connman ] ; then | ||
| 8 | . /etc/default/connman | ||
| 9 | fi | ||
| 10 | |||
| 11 | set -e | ||
| 12 | |||
| 13 | nfsroot=0 | ||
| 14 | |||
| 15 | exec 9<&0 < /proc/mounts | ||
| 16 | while read dev mtpt fstype rest; do | ||
| 17 | if test $mtpt = "/" ; then | ||
| 18 | case $fstype in | ||
| 19 | nfs | nfs4) | ||
| 20 | nfsroot=1 | ||
| 21 | break | ||
| 22 | ;; | ||
| 23 | *) | ||
| 24 | ;; | ||
| 25 | esac | ||
| 26 | fi | ||
| 27 | done | ||
| 28 | |||
| 29 | do_start() { | ||
| 30 | EXTRA_PARAM="" | ||
| 31 | if test $nfsroot -eq 0 ; then | ||
| 32 | $DAEMON $EXTRA_PARAM | ||
| 33 | fi | ||
| 34 | } | ||
| 35 | |||
| 36 | do_stop() { | ||
| 37 | start-stop-daemon --stop --name connmand --quiet | ||
| 38 | } | ||
| 39 | |||
| 40 | case "$1" in | ||
| 41 | start) | ||
| 42 | echo "Starting $DESC" | ||
| 43 | do_start | ||
| 44 | ;; | ||
| 45 | stop) | ||
| 46 | echo "Stopping $DESC" | ||
| 47 | do_stop | ||
| 48 | ;; | ||
| 49 | restart|force-reload) | ||
| 50 | echo "Restarting $DESC" | ||
| 51 | do_stop | ||
| 52 | sleep 1 | ||
| 53 | do_start | ||
| 54 | ;; | ||
| 55 | *) | ||
| 56 | echo "Usage: $0 {start|stop|restart|force-reload}" >&2 | ||
| 57 | exit 1 | ||
| 58 | ;; | ||
| 59 | esac | ||
| 60 | |||
| 61 | 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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Connection Manager Init Service | ||
| 4 | # | ||
| 5 | # Copyright (C) 2012 Intel Corporation. All rights reserved. | ||
| 6 | # | ||
| 7 | # This program is free software; you can redistribute it and/or modify | ||
| 8 | # it under the terms of the GNU General Public License version 2 as | ||
| 9 | # published by the Free Software Foundation. | ||
| 10 | # | ||
| 11 | # This program is distributed in the hope that it will be useful, | ||
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | # GNU General Public License for more details. | ||
| 15 | # | ||
| 16 | # You should have received a copy of the GNU General Public License | ||
| 17 | # along with this program; if not, write to the Free Software | ||
| 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | |||
| 20 | |||
| 21 | CONNMAN_DIR=/var/lib/connman | ||
| 22 | CONNMAN_SETTINGS=$CONNMAN_DIR/settings | ||
| 23 | |||
| 24 | if [ -s $CONNMAN_SETTINGS ]; then | ||
| 25 | exit 0 | ||
| 26 | fi | ||
| 27 | |||
| 28 | if [ ! -d $CONNMAN_DIR ]; then | ||
| 29 | mkdir -p $CONNMAN_DIR | ||
| 30 | fi | ||
| 31 | |||
| 32 | TETHERING="$1" | ||
| 33 | TETHERING_AP_PASSPHRASE="$2" | ||
| 34 | TETHERING_AP_SSID="$3" | ||
| 35 | |||
| 36 | if [ -z "$TETHERING" ]; then | ||
| 37 | TETHERING="true" | ||
| 38 | fi | ||
| 39 | |||
| 40 | # Create main.conf with those values that we need | ||
| 41 | MAINCONF=/etc/connman/main.conf | ||
| 42 | cat > $MAINCONF <<EOF | ||
| 43 | [General] | ||
| 44 | TetheringTechnologies=wifi,bluetooth,gadget,ethernet | ||
| 45 | PersistentTetheringMode=true | ||
| 46 | EOF | ||
| 47 | |||
| 48 | function get_mac | ||
| 49 | { | ||
| 50 | # Get the mac address of the first network interface returned by kernel | ||
| 51 | IFACE=`head -n 3 /proc/net/dev|tail -n 1|awk '{ print $1 }'|sed 's/://'` | ||
| 52 | if [ -z "$IFACE" -o ! -d /sys/class/net/$IFACE ]; then | ||
| 53 | echo 010203040506 | ||
| 54 | else | ||
| 55 | sed 's/://g' /sys/class/net/$IFACE/address | ||
| 56 | fi | ||
| 57 | } | ||
| 58 | |||
| 59 | if [ -z "$TETHERING_AP_SSID" ]; then | ||
| 60 | MAC=`get_mac` | ||
| 61 | TETHERING_AP_SSID=eca-$MAC | ||
| 62 | fi | ||
| 63 | |||
| 64 | if [ -z "$TETHERING_AP_PASSPHRASE" ]; then | ||
| 65 | if [ -z "$MAC" ]; then | ||
| 66 | MAC=`get_mac` | ||
| 67 | fi | ||
| 68 | TETHERING_AP_PASSPHRASE=$MAC | ||
| 69 | fi | ||
| 70 | |||
| 71 | cat > $CONNMAN_SETTINGS <<EOF | ||
| 72 | [global] | ||
| 73 | OfflineMode=false | ||
| 74 | |||
| 75 | [Bluetooth] | ||
| 76 | Enable=true | ||
| 77 | |||
| 78 | [Cellular] | ||
| 79 | Enable=true | ||
| 80 | |||
| 81 | [WiFi] | ||
| 82 | Enable=true | ||
| 83 | Tethering=$TETHERING | ||
| 84 | Tethering.Identifier=$TETHERING_AP_SSID | ||
| 85 | Tethering.Passphrase=$TETHERING_AP_PASSPHRASE | ||
| 86 | |||
| 87 | |||
| 88 | [Wired] | ||
| 89 | Enable=true | ||
| 90 | EOF | ||
| 91 | |||
| 92 | if [ $? -eq 0 -a -f $CONNMAN_SETTINGS ]; then | ||
| 93 | chmod 0600 $CONNMAN_SETTINGS | ||
| 94 | fi | ||
| 95 | |||
| 96 | exit 0 | ||
diff --git a/meta-eca/recipes-connectivity/connman/files/connman-init.service b/meta-eca/recipes-connectivity/connman/files/connman-init.service new file mode 100644 index 0000000..5b9b3f0 --- /dev/null +++ b/meta-eca/recipes-connectivity/connman/files/connman-init.service | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Initialize ConnMan settings | ||
| 3 | After=syslog.target | ||
| 4 | ConditionFileNotEmpty=!/var/lib/connman/settings | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | Type=oneshot | ||
| 8 | EnvironmentFile=-/etc/connman/connmand.env | ||
| 9 | ExecStart=-/usr/lib/connman/connman-init-settings.sh $TETHERING $AP_PASSPHRASE $AP_SSID | ||
| 10 | StandardOutput=null | ||
| 11 | |||
| 12 | [Install] | ||
| 13 | WantedBy=connman.service | ||
diff --git a/meta-eca/recipes-connectivity/iproute2/files/0001-No-arpd-please.patch b/meta-eca/recipes-connectivity/iproute2/files/0001-No-arpd-please.patch new file mode 100644 index 0000000..36354d2 --- /dev/null +++ b/meta-eca/recipes-connectivity/iproute2/files/0001-No-arpd-please.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 9ff7e5aefcb72bc0c481dc777f6a50ef7503d640 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 3 | Date: Tue, 6 May 2014 12:51:09 +0300 | ||
| 4 | Subject: [PATCH] No arpd please | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [configuration] | ||
| 7 | |||
| 8 | Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> | ||
| 9 | --- | ||
| 10 | misc/Makefile | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/misc/Makefile b/misc/Makefile | ||
| 14 | index a59ff87..d0a33e8 100644 | ||
| 15 | --- a/misc/Makefile | ||
| 16 | +++ b/misc/Makefile | ||
| 17 | @@ -1,7 +1,7 @@ | ||
| 18 | SSOBJ=ss.o ssfilter.o | ||
| 19 | LNSTATOBJ=lnstat.o lnstat_util.o | ||
| 20 | |||
| 21 | -TARGETS=ss nstat ifstat rtacct arpd lnstat | ||
| 22 | +TARGETS=ss nstat ifstat rtacct lnstat | ||
| 23 | |||
| 24 | include ../Config | ||
| 25 | |||
| 26 | -- | ||
| 27 | 1.8.3.1 | ||
| 28 | |||
diff --git a/meta-eca/recipes-connectivity/iproute2/iproute2_%.bbappend b/meta-eca/recipes-connectivity/iproute2/iproute2_%.bbappend new file mode 100644 index 0000000..f4c53fe --- /dev/null +++ b/meta-eca/recipes-connectivity/iproute2/iproute2_%.bbappend | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | FILESEXTRAPATHS_append := ":${THISDIR}/files" | ||
| 2 | |||
| 3 | SRC_URI_append = " \ | ||
| 4 | file://0001-No-arpd-please.patch \ | ||
| 5 | " | ||
| 6 | |||
| 7 | # Compile also misc directory (to get ss prog) | ||
| 8 | # | ||
| 9 | EXTRA_OEMAKE_append = " SUBDIRS='lib tc ip misc'" | ||
diff --git a/meta-eca/recipes-connectivity/libpcap/libpcap_%.bbappend b/meta-eca/recipes-connectivity/libpcap/libpcap_%.bbappend new file mode 100644 index 0000000..30ffe44 --- /dev/null +++ b/meta-eca/recipes-connectivity/libpcap/libpcap_%.bbappend | |||
| @@ -0,0 +1 @@ | |||
| PACKAGECONFIG[bluetooth] = "--enable-bluetooth,--disable-bluetooth,bluez5" | |||
diff --git a/meta-eca/recipes-connectivity/neard/files/neard.service.in b/meta-eca/recipes-connectivity/neard/files/neard.service.in new file mode 100644 index 0000000..3f9cb02 --- /dev/null +++ b/meta-eca/recipes-connectivity/neard/files/neard.service.in | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=NFC service | ||
| 3 | After=syslog.target | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | Type=dbus | ||
| 7 | BusName=org.neard | ||
| 8 | Restart=on-failure | ||
| 9 | ExecStart=@installpath@/nfc/neard -n | ||
| 10 | StandardOutput=null | ||
| 11 | |||
| 12 | [Install] | ||
| 13 | WantedBy=multi-user.target | ||
diff --git a/meta-eca/recipes-connectivity/neard/neard_git.bb b/meta-eca/recipes-connectivity/neard/neard_git.bb new file mode 100644 index 0000000..ad3168b --- /dev/null +++ b/meta-eca/recipes-connectivity/neard/neard_git.bb | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | require recipes-connectivity/neard/neard.inc | ||
| 2 | |||
| 3 | SRC_URI = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git \ | ||
| 4 | file://neard.service.in \ | ||
| 5 | " | ||
| 6 | |||
| 7 | S = "${WORKDIR}/git" | ||
| 8 | SRCREV = "647f2705bebf051ea85ab74399461203c8ba900e" | ||
| 9 | PV = "0.14+git${SRCPV}" | ||
| 10 | PR = "r2" | ||
| 11 | |||
| 12 | |||
| 13 | EXTRA_OECONF += "--enable-tools \ | ||
| 14 | " | ||
| 15 | |||
| 16 | # We want to use bluez5 when doing handover | ||
| 17 | RRECOMMENDS_${PN} = "\ | ||
| 18 | ${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \ | ||
| 19 | ${@base_contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \ | ||
| 20 | " | ||
diff --git a/meta-eca/recipes-connectivity/ofono/files/ofono b/meta-eca/recipes-connectivity/ofono/files/ofono new file mode 100644 index 0000000..cc99709 --- /dev/null +++ b/meta-eca/recipes-connectivity/ofono/files/ofono | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | DAEMON=/usr/sbin/ofonod | ||
| 4 | PIDFILE=/var/run/ofonod.pid | ||
| 5 | DESC="Telephony daemon" | ||
| 6 | |||
| 7 | if [ -f /etc/default/ofono ] ; then | ||
| 8 | . /etc/default/ofono | ||
| 9 | fi | ||
| 10 | |||
| 11 | set -e | ||
| 12 | |||
| 13 | do_start() { | ||
| 14 | $DAEMON | ||
| 15 | } | ||
| 16 | |||
| 17 | do_stop() { | ||
| 18 | start-stop-daemon --stop --name ofonod --quiet | ||
| 19 | } | ||
| 20 | |||
| 21 | case "$1" in | ||
| 22 | start) | ||
| 23 | echo "Starting $DESC" | ||
| 24 | do_start | ||
| 25 | ;; | ||
| 26 | stop) | ||
| 27 | echo "Stopping $DESC" | ||
| 28 | do_stop | ||
| 29 | ;; | ||
| 30 | restart|force-reload) | ||
| 31 | echo "Restarting $DESC" | ||
| 32 | do_stop | ||
| 33 | sleep 1 | ||
| 34 | do_start | ||
| 35 | ;; | ||
| 36 | *) | ||
| 37 | echo "Usage: $0 {start|stop|restart|force-reload}" >&2 | ||
| 38 | exit 1 | ||
| 39 | ;; | ||
| 40 | esac | ||
| 41 | |||
| 42 | exit 0 | ||
diff --git a/meta-eca/recipes-connectivity/ofono/ofono_git.bb b/meta-eca/recipes-connectivity/ofono/ofono_git.bb new file mode 100644 index 0000000..110358f --- /dev/null +++ b/meta-eca/recipes-connectivity/ofono/ofono_git.bb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | require recipes-connectivity/ofono/ofono.inc | ||
| 2 | |||
| 3 | S = "${WORKDIR}/git" | ||
| 4 | SRCREV = "516165c3114471400b4551ff9b04ff9ca7c1fc25" | ||
| 5 | PV = "1.14+git${SRCPV}" | ||
| 6 | |||
| 7 | SRC_URI = "\ | ||
| 8 | git://git.kernel.org/pub/scm/network/ofono/ofono.git;protocol=git \ | ||
| 9 | file://ofono \ | ||
| 10 | " | ||
| 11 | |||
| 12 | # We want to use bluez5 | ||
| 13 | DEPENDS := "${@oe_filter_out('bluez4', '${DEPENDS}', d)}" | ||
| 14 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'bluetooth','bluez5', '', d)}" | ||
| 15 | |||
| 16 | # Test scripts use python3, the dbus module is still missing so the scripts | ||
| 17 | # do not work as expected. | ||
| 18 | RDEPENDS_${PN} = "\ | ||
| 19 | python3 \ | ||
| 20 | python3-codecs \ | ||
| 21 | python3-math \ | ||
| 22 | python3-io \ | ||
| 23 | python3-misc \ | ||
| 24 | " | ||
| 25 | |||
| 26 | do_install_append() { | ||
| 27 | # Because python3-dbus module is currently not there, just use | ||
| 28 | # python 2.x in the ofono test scripts | ||
| 29 | for PYTHSCRIPT in `grep -rIl ${bindir}/python3 ${D}${libdir}/${PN}`; do | ||
| 30 | sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT | ||
| 31 | done | ||
| 32 | } | ||
diff --git a/meta-eca/recipes-connectivity/scapy/python-scapy_2.2.0.bb b/meta-eca/recipes-connectivity/scapy/python-scapy_2.2.0.bb new file mode 100644 index 0000000..51bad53 --- /dev/null +++ b/meta-eca/recipes-connectivity/scapy/python-scapy_2.2.0.bb | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | DESCRIPTION = "Scapy is a powerful interactive packet manipulation tool, \ | ||
| 2 | packet generator, network scanner, network discovery, packet sniffer, etc. \ | ||
| 3 | It can for the moment replace hping, 85% of nmap, arpspoof, arp-sk, arping, \ | ||
| 4 | tcpdump, tethereal, p0f, ...." | ||
| 5 | SECTION = "devel/python" | ||
| 6 | HOMEPAGE = "http://www.secdev.org/projects/scapy/" | ||
| 7 | LICENSE = "GPLv2" | ||
| 8 | LIC_FILES_CHKSUM = "file://bin/scapy;beginline=3;endline=18;md5=a5be896f88f8396346f67f7a8878ee09" | ||
| 9 | PRIORITY = "optional" | ||
| 10 | SRCNAME = "scapy" | ||
| 11 | PR = "ml2" | ||
| 12 | |||
| 13 | SRC_URI = "http://www.secdev.org/projects/scapy/files/scapy-${PV}.tar.gz" | ||
| 14 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 15 | |||
| 16 | inherit distutils | ||
| 17 | |||
| 18 | RDEPENDS_${PN} = "\ | ||
| 19 | python-netclient \ | ||
| 20 | python-netserver \ | ||
| 21 | " | ||
| 22 | |||
| 23 | SRC_URI[md5sum] = "406990bd8da1f4958b354b4b6fc4b3eb" | ||
| 24 | SRC_URI[sha256sum] = "c5363b224df0efbd78d7dc4d8a518e5518b2e7affc2e5f1fcecd4efa3ab815af" | ||
diff --git a/meta-eca/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-eca/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend new file mode 100644 index 0000000..22e8311 --- /dev/null +++ b/meta-eca/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" | ||
| 2 | |||
| 3 | # Remove unnecessary stuff from depends | ||
| 4 | DEPENDS := "${@oe_filter_out('wpa-supplicant-cli', '${DEPENDS}', d)}" | ||
| 5 | DEPENDS := "${@oe_filter_out('wpa-supplicant-passphrase', '${DEPENDS}', d)}" | ||
| 6 | DEPENDS := "${@oe_filter_out('wpa-supplicant-doc', '${DEPENDS}', d)}" | ||
| 7 | |||
| 8 | do_configure_append () { | ||
| 9 | # Activate config options needed by connman and tethering | ||
| 10 | echo "CONFIG_WPS=y" >> wpa_supplicant/.config | ||
| 11 | echo "CONFIG_AP=y" >> wpa_supplicant/.config | ||
| 12 | echo "CONFIG_CTRL_IFACE_DBUS_NEW=y" >> wpa_supplicant/.config | ||
| 13 | echo "CONFIG_BGSCAN_SIMPLE=y" >> wpa_supplicant/.config | ||
| 14 | echo "CONFIG_AUTOSCAN_EXPONENTIAL=y" >> wpa_supplicant/.config | ||
| 15 | } | ||
