From 6e9c599f8c7408b7ffa719649b03524683898e9c Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 5 Mar 2019 18:02:10 +0100 Subject: Replace connman with systemd-networkd on qemux86-64 Signed-off-by: Laurent Bonnans --- classes/sota_qemux86-64.bbclass | 2 +- .../networkd-dhcp-conf/files/20-wired-dhcp.network | 5 +++++ .../networkd-dhcp-conf/networkd-dhcp-conf.bb | 23 ++++++++++++++++++++++ recipes-test/images/secondary-image.bb | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network create mode 100644 recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 4a1f628..8dae0c5 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -13,4 +13,4 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655 # fix for u-boot/swig build issue HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" -IMAGE_INSTALL_append_sota = " connman connman-client" +IMAGE_INSTALL_append_sota = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'networkd-dhcp-conf', '', d)} " diff --git a/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network new file mode 100644 index 0000000..aec1849 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network @@ -0,0 +1,5 @@ +[Match] +Name=en* + +[Network] +DHCP=yes diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb new file mode 100644 index 0000000..60eae44 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -0,0 +1,23 @@ +SUMMARY = "systemd-networkd config to setup wired interface with dhcp" +DESCRIPTION = "Provides automatic dhcp network configuration for wired \ +interfaces through systemd-networkd" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +inherit systemd + +SRC_URI_append = " file://20-wired-dhcp.network" +PR = "r1" + +RDEPENDS_${PN} = "systemd" + +S = "${WORKDIR}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} = "${systemd_unitdir}/network/*" + +do_install() { + install -d ${D}/${systemd_unitdir}/network + install -m 0644 ${WORKDIR}/20-wired-dhcp.network ${D}/${systemd_unitdir}/network +} diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 1a41169..371d517 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -17,6 +17,7 @@ IMAGE_INSTALL_remove = " \ aktualizr-uboot-env-rollback \ connman \ connman-client \ + networkd-dhcp-conf \ " IMAGE_INSTALL_append = " \ -- cgit v1.2.3-54-g00ecf