From: <kai.kang@windriver.com>
To: <alex.kiernan@gmail.com>, <raj.khem@gmail.com>
Cc: paul.eggleton@linux.intel.com, openembedded-core@lists.openembedded.org
Subject: [PATCH v2 1/1] systemd-conf: configure wired network with dhcp
Date: Tue, 21 May 2019 05:22:49 -0400 [thread overview]
Message-ID: <20190521092249.175461-2-kai.kang@windriver.com> (raw)
In-Reply-To: <20190521092249.175461-1-kai.kang@windriver.com>
From: Kai Kang <kai.kang@windriver.com>
Add a configure file for systemd.networkd to configure wired network
interfaces with dhcp. It works with common network interfaces such eth0
and eno1.
Refer to
https://github.com/YoeDistro/meta-yoe/tree/master/recipes-core/systemd
[YOCTO #13057]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
meta/recipes-core/systemd/systemd-conf/dhcp.network | 9 +++++++++
meta/recipes-core/systemd/systemd-conf_242.bb | 5 +++++
2 files changed, 14 insertions(+)
create mode 100644 meta/recipes-core/systemd/systemd-conf/dhcp.network
diff --git a/meta/recipes-core/systemd/systemd-conf/dhcp.network b/meta/recipes-core/systemd/systemd-conf/dhcp.network
new file mode 100644
index 0000000000..253aee9382
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-conf/dhcp.network
@@ -0,0 +1,9 @@
+[Match]
+Name=en* eth*
+
+[Network]
+DHCP=yes
+
+[DHCP]
+RouteMetric=10
+ClientIdentifier=mac
diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb b/meta/recipes-core/systemd/systemd-conf_242.bb
index 96beea53a7..105ee3ceed 100644
--- a/meta/recipes-core/systemd/systemd-conf_242.bb
+++ b/meta/recipes-core/systemd/systemd-conf_242.bb
@@ -10,12 +10,16 @@ SRC_URI = "\
file://logind.conf \
file://system.conf \
file://system.conf-qemuall \
+ file://dhcp.network \
"
do_install() {
install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
+ if ${@bb.utils.contains('OVERRIDES', 'qemuall', 'false', 'true', d)}; then
+ install -D -m0644 ${WORKDIR}/dhcp.network ${D}${systemd_unitdir}/network/80-dhcp.network
+ fi
}
# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
@@ -29,4 +33,5 @@ FILES_${PN} = "\
${systemd_unitdir}/journald.conf.d/ \
${systemd_unitdir}/logind.conf.d/ \
${systemd_unitdir}/system.conf.d/ \
+ ${systemd_unitdir}/network/ \
"
--
2.20.0
next prev parent reply other threads:[~2019-05-21 9:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 9:22 [PATCH v2 0/1] Configure wired network interface with dhcp for systemd kai.kang
2019-05-21 9:22 ` kai.kang [this message]
2019-05-21 12:09 ` [PATCH v2 1/1] systemd-conf: configure wired network with dhcp Richard Purdie
2019-05-23 1:47 ` Kang Kai
2019-05-21 17:37 ` Khem Raj
2019-05-22 2:11 ` Kang Kai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190521092249.175461-2-kai.kang@windriver.com \
--to=kai.kang@windriver.com \
--cc=alex.kiernan@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
--cc=raj.khem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.