Provide automatic DHCP configuration for Ethernet adapters 31/5331/2
authorManuel Bachmann <mbc@iot.bzh>
Thu, 28 Jan 2016 02:35:16 +0000 (02:35 +0000)
committerManuel Bachmann <mbc@iot.bzh>
Tue, 2 Feb 2016 15:17:17 +0000 (15:17 +0000)
systemd now provides the logic necessary to obtain IP
connectivity with its networkd/resolved daemons.

Let us enable this feature for wired adapters : that is,
those prefixed with "eth*" (Renesas R-Car) or "en*" (QEMU).

Change-Id: I8e71b8d1f22364ffa8ee0c33769a8dba9e21f71a
Signed-off-by: Manuel Bachmann <mbc@iot.bzh>
meta-agl/recipes-core/systemd/systemd/wired.network [new file with mode: 0644]
meta-agl/recipes-core/systemd/systemd_%.bbappend

diff --git a/meta-agl/recipes-core/systemd/systemd/wired.network b/meta-agl/recipes-core/systemd/systemd/wired.network
new file mode 100644 (file)
index 0000000..3559b01
--- /dev/null
@@ -0,0 +1,5 @@
+[Match]
+Name=eth* en*
+
+[Network]
+DHCP=yes
index 4e0d5d4..96ca6c6 100644 (file)
@@ -1,13 +1,17 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-SRC_URI += " file://e2fsck.conf "
+SRC_URI += "file://e2fsck.conf \
+            file://wired.network \
+           "
 
 
-# enable networkd support
-PACKAGECONFIG_append_pn-systemd = " networkd"
+# enable networkd/resolved support
+PACKAGECONFIG_append_pn-systemd = " networkd resolved"
 
 do_install_append() {
     # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
 
 do_install_append() {
     # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
-    install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}/etc/e2fsck.conf
+    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
 }
 
 }
 
-FILES_${PN} += " /etc/e2fsck.conf "
+FILES_${PN} += "${sysconfdir}/e2fsck.conf "