Select networking manager with VIRTUAL-RUNTIME_net_manager at distro level 21/5521/5
authorStephane Desneux <stephane.desneux@iot.bzh>
Wed, 13 Apr 2016 15:58:12 +0000 (15:58 +0000)
committerGerrit Code Review <gerrit@172.30.200.200>
Thu, 14 Apr 2016 16:32:18 +0000 (16:32 +0000)
This variable allows to select the network manager daemon to use
in the distro. Possible values are: systemd, connman. Later, it's
possible to add other network daemons as well.

Change-Id: I4085b4459d3ea110513f6ca9b921c5da92a7d745
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
meta-agl/conf/distro/poky-agl.conf
meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb [new file with mode: 0644]
meta-agl/recipes-core/packagegroups/packagegroup-agl-core-connectivity.bb
meta-agl/recipes-core/systemd/systemd_%.bbappend

index b631f87..1be2a96 100644 (file)
@@ -17,6 +17,9 @@ PREFERRED_PROVIDER_udev-utils ?= "systemd"
 VIRTUAL-RUNTIME_init_manager = "systemd"
 VIRTUAL-RUNTIME_initscripts = ""
 
+# network manager to use (possible values: systemd, connman)
+VIRTUAL-RUNTIME_net_manager = "connman" 
+
 # Override these in poky based distros
 AGL_DEFAULT_DISTRO_FEATURES = "systemd opengl wayland pam bluetooth bluez5"
 AGL_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
diff --git a/meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb b/meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb
new file mode 100644 (file)
index 0000000..02afef7
--- /dev/null
@@ -0,0 +1,26 @@
+SUMMARY = "A simple ncurses interface for connman"
+DESCRIPTION = "A simple ncurses interface for connman"
+HOMEPAGE = "https://gitlab.com/iotbzh/connman-json-client"
+
+SECTION = "console/network"
+
+DEPENDS = "dbus ncurses connman json-c"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8c16666ae6c159876a0ba63099614381"
+
+SRC_URI = "git://gitlab.com/iotbzh/connman-json-client.git;protocol=https;rev=ad4261a2f87c914667b1f6841c913f6b08d373e2"
+
+inherit autotools pkgconfig
+
+EXTRA_AUTORECONF += " -i"
+EXTRA_OECONF += " --disable-optimization --enable-debug"
+
+S = "${WORKDIR}/git"
+
+do_install () {
+    install -dm755 ${D}${bindir}
+    install -Dm755 connman_ncurses ${D}${bindir}
+}
+
+FILES_${PN} = "${bindir}/connman_ncurses"
index 54a154d..e909d5e 100644 (file)
@@ -11,4 +11,5 @@ ALLOW_EMPTY_${PN} = "1"
 
 RDEPENDS_${PN} += "\
     dhcp-server \
+    ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','connman','connman connman-client connman-tests connman-tools connman-ncurses','',d)} \
     "
index 96ca6c6..ef877c0 100644 (file)
@@ -1,17 +1,22 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
 SRC_URI += "file://e2fsck.conf \
-            file://wired.network \
+            ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \
            "
 
 # enable networkd/resolved support
-PACKAGECONFIG_append_pn-systemd = " networkd resolved"
+PACKAGECONFIG_append_pn-systemd = " \
+   ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','networkd resolved','',d)} \
+"
 
 do_install_append() {
     # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
     install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}${sysconfdir}/e2fsck.conf
-    # Install DHCP configuration for Ethernet adapters
-    install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
+
+    if ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','true','false',d)}; then
+       # Install DHCP configuration for Ethernet adapters
+       install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
+    fi
 }
 
 FILES_${PN} += "${sysconfdir}/e2fsck.conf "