summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-connectivity/connman/connman-conf.bb17
-rw-r--r--meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf3
-rw-r--r--meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup16
-rw-r--r--meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config8
-rw-r--r--meta/recipes-connectivity/connman/connman/connman3
5 files changed, 37 insertions, 10 deletions
diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
index 7c7ef263ce..7b999533f1 100644
--- a/meta/recipes-connectivity/connman/connman-conf.bb
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -1,18 +1,21 @@
1#connman config to ignore wired interfaces on qemu machines 1#connman config to setup wired interface on qemu machines
2 2
3LICENSE = "GPLv2" 3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" 4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
5 5
6SRC_URI_append_qemuall = " file://main.conf" 6SRC_URI_append_qemuall = "file://wired.config \
7 7 file://wired-setup \
8PR = "r0" 8 "
9PR = "r1"
9 10
10PACKAGE_ARCH = "${MACHINE_ARCH}" 11PACKAGE_ARCH = "${MACHINE_ARCH}"
11 12
12do_install() { 13do_install() {
13 #Blacklist ethn network interface in case of qemu* machines 14 #Configure Wired network interface in case of qemu* machines
14 if test -e ${WORKDIR}/main.conf; then 15 if test -e ${WORKDIR}/wired.config && test -e ${WORKDIR}/wired-setup; then
16 install -d ${D}${localstatedir}/lib/connman
17 install -m 0644 ${WORKDIR}/wired.config ${D}${localstatedir}/lib/connman
15 install -d ${D}${sysconfdir}/connman 18 install -d ${D}${sysconfdir}/connman
16 install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/connman 19 install -m 0755 ${WORKDIR}/wired-setup ${D}${sysconfdir}/connman
17 fi 20 fi
18} 21}
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf b/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
deleted file mode 100644
index 01973e7f71..0000000000
--- a/meta/recipes-connectivity/connman/connman-conf/qemuall/main.conf
+++ /dev/null
@@ -1,3 +0,0 @@
1[General]
2
3NetworkInterfaceBlacklist = eth
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
new file mode 100644
index 0000000000..135a6c19ac
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3CONFIGF=/var/lib/connman/wired.config
4
5# Extract wired network config from /proc/cmdline
6NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'`
7
8# Check if eth0 is already set via kernel cmdline
9if [ "x$NET_CONF" = "x" ]; then
10 # Wired interface is not configured via kernel cmdline
11 # Remove connman config file template
12 rm ${CONFIGF}
13else
14 # Setup a connman config accordingly
15 sed -i -e "s|^\(IPv4 =\)|\1 ${NET_CONF}|" ${CONFIGF}
16fi
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
new file mode 100644
index 0000000000..996e429e72
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
@@ -0,0 +1,8 @@
1[global]
2Name = Wired
3Description = Wired network configuration
4
5[service_ethernet]
6Type = ethernet
7IPv4 =
8MAC = 52:54:00:12:34:56
diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
index aed4a792db..ffd7fac547 100644
--- a/meta/recipes-connectivity/connman/connman/connman
+++ b/meta/recipes-connectivity/connman/connman/connman
@@ -32,6 +32,9 @@ do_start() {
32 ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` 32 ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
33 EXTRA_PARAM="-I $ethn" 33 EXTRA_PARAM="-I $ethn"
34 fi 34 fi
35 if [ -f /etc/connman/wired-setup ] ; then
36 . /etc/connman/wired-setup
37 fi
35 $DAEMON $EXTRA_PARAM 38 $DAEMON $EXTRA_PARAM
36} 39}
37 40