From 4cee2fc84541399c153d0231af3c79e6affa6611 Mon Sep 17 00:00:00 2001 From: Jerry Wan Date: Fri, 21 Jan 2022 10:00:10 +0800 Subject: meta-quanta: s6q: Add bonding feature to network interface Add network bonding configuration and name resolution configuration for S6Q. Tested: There are two interfaces eth0 and eth1 bonded to bond0. Bonding details can be found at /proc/net/bonding/bond0. Signed-off-by: Jerry Wan Change-Id: Ic11fbc3a8ea3ac4859e60a62288e9c2e03f6f41e --- meta-quanta/meta-s6q/conf/machine/s6q.conf | 1 + .../systemd/systemd-conf/10-bmc-bond0.netdev | 3 +++ .../systemd/systemd-conf/bond-eth0.conf | 2 ++ .../systemd/systemd-conf/bond-eth1.conf | 4 ++++ .../systemd/systemd-conf/s6q-resolv.conf | 3 +++ .../recipes-core/systemd/systemd-conf_%.bbappend | 24 ++++++++++++++++++++++ 6 files changed, 37 insertions(+) create mode 100644 meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/10-bmc-bond0.netdev create mode 100644 meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth0.conf create mode 100644 meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth1.conf create mode 100644 meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/s6q-resolv.conf create mode 100644 meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend (limited to 'meta-quanta') diff --git a/meta-quanta/meta-s6q/conf/machine/s6q.conf b/meta-quanta/meta-s6q/conf/machine/s6q.conf index d32ac7a83e..b57652f752 100644 --- a/meta-quanta/meta-s6q/conf/machine/s6q.conf +++ b/meta-quanta/meta-s6q/conf/machine/s6q.conf @@ -18,6 +18,7 @@ MACHINE_FEATURES += "\ obmc-phosphor-chassis-mgmt \ obmc-phosphor-fan-mgmt \ obmc-phosphor-flash-mgmt \ + bonding \ " VIRTUAL-RUNTIME_obmc-inventory-manager = "entity-manager" diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/10-bmc-bond0.netdev b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/10-bmc-bond0.netdev new file mode 100644 index 0000000000..f1dc3f728c --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/10-bmc-bond0.netdev @@ -0,0 +1,3 @@ +[NetDev] +Name=bond0 +Kind=bond diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth0.conf b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth0.conf new file mode 100644 index 0000000000..c6ff6f12f4 --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth0.conf @@ -0,0 +1,2 @@ +[Network] +Bond=bond0 diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth1.conf b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth1.conf new file mode 100644 index 0000000000..f1374ed3ef --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond-eth1.conf @@ -0,0 +1,4 @@ +[Network] +Bond=bond0 +[Link] +ActivationPolicy=always-down diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/s6q-resolv.conf b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/s6q-resolv.conf new file mode 100644 index 0000000000..9eabae1d9e --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/s6q-resolv.conf @@ -0,0 +1,3 @@ +[Resolve] +LLMNR=no +MulticastDNS=resolve diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 0000000000..519ca8d8c2 --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,24 @@ +FILESEXTRAPATHS:prepend:s6q := "${THISDIR}/${PN}:" + +SRC_URI:append:s6q = "file://s6q-resolv.conf" +SRC_URI:append:s6q = "${@bb.utils.contains('MACHINE_FEATURES', 'bonding', ' file://10-bmc-bond0.netdev', '', d)}" +SRC_URI:append:s6q = "${@bb.utils.contains('MACHINE_FEATURES', 'bonding', ' file://bond-eth0.conf', '', d)}" +SRC_URI:append:s6q = "${@bb.utils.contains('MACHINE_FEATURES', 'bonding', ' file://bond-eth1.conf', '', d)}" + +FILES:${PN}:append:s6q = "${sysconfdir_native}/systemd/resolved.conf.d/s6q-resolv.conf" +FILES:${PN}:append:s6q = "${@bb.utils.contains("MACHINE_FEATURES", "bonding", " ${sysconfdir_native}/systemd/network/10-bmc-bond0.netdev", "", d)}" +FILES:${PN}:append:s6q = "${@bb.utils.contains("MACHINE_FEATURES", "bonding", " ${sysconfdir_native}/systemd/network/00-bmc-eth0.network.d/bond-eth0.conf", "", d)}" +FILES:${PN}:append:s6q = "${@bb.utils.contains("MACHINE_FEATURES", "bonding", " ${sysconfdir_native}/systemd/network/00-bmc-eth1.network.d/bond-eth1.conf", "", d)}" + +do_install:append:s6q() { + install -d ${D}${sysconfdir_native}/systemd/resolved.conf.d/ + install -m 0644 ${WORKDIR}/s6q-resolv.conf ${D}${sysconfdir_native}/systemd/resolved.conf.d/ + if ${@bb.utils.contains('MACHINE_FEATURES', 'bonding', 'true', 'false', d)}; then + install -d ${D}${sysconfdir_native}/systemd/network/ + install -d ${D}${sysconfdir_native}/systemd/network/00-bmc-eth0.network.d/ + install -d ${D}${sysconfdir_native}/systemd/network/00-bmc-eth1.network.d/ + install -m 0644 ${WORKDIR}/bond-eth0.conf ${D}${sysconfdir_native}/systemd/network/00-bmc-eth0.network.d/ + install -m 0644 ${WORKDIR}/bond-eth1.conf ${D}${sysconfdir_native}/systemd/network/00-bmc-eth1.network.d/ + install -m 0644 ${WORKDIR}/10-bmc-bond0.netdev ${D}${sysconfdir_native}/systemd/network + fi +} -- cgit v1.2.3