diff options
author | Jerry Wan <jerry.wan@quantatw.com> | 2022-02-14 14:35:26 +0300 |
---|---|---|
committer | Jerry Wan <jerry.wan@quantatw.com> | 2022-03-11 06:14:03 +0300 |
commit | b63d8ff4c6caf32bf6c9467a3834b623d190e3ea (patch) | |
tree | 002a40d0f4b310c63e18ceed228b1b604d63b8aa | |
parent | 1fe1de3781843c487323e0408ec0949bd93e1c47 (diff) | |
download | openbmc-b63d8ff4c6caf32bf6c9467a3834b623d190e3ea.tar.xz |
meta-quanta: s6q: Add usb0 network interface
1. Fix the sytle of systemd-conf.bbappend to wrap with 80 characters.
2. Add usb0 network interface.
3. Disable ipv4 link-local address to avoid routing problems.
Tested:
Set the host's network interface to a link-local address and
successfully communicate with the BMC via usb0.
Signed-off-by: Jerry Wan <jerry.wan@quantatw.com>
Change-Id: I9e6a9946a2beb8cf85872abe1919e92052fe46cc
5 files changed, 66 insertions, 17 deletions
diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond0.conf b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond0.conf new file mode 100644 index 0000000000..186f3e4969 --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf/bond0.conf @@ -0,0 +1,2 @@ +[Network] +LinkLocalAddressing=ipv6 diff --git a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend index 519ca8d8c2..519f992570 100644 --- a/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend +++ b/meta-quanta/meta-s6q/recipes-core/systemd/systemd-conf_%.bbappend @@ -1,24 +1,49 @@ 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)}" +SRC_URI:append:s6q = " file://s6q-resolv.conf" +BONDING_CONF = "\ + file://10-bmc-bond0.netdev \ + file://bond-eth0.conf \ + file://bond-eth1.conf \ + file://bond0.conf \ + " +SRC_URI:append:s6q = "${@bb.utils.contains('MACHINE_FEATURES', 'bonding',\ + ' ${BONDING_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)}" +FILES:${PN}:append:s6q = "\ + ${sysconfdir}/systemd/resolved.conf.d/s6q-resolv.conf \ + ${sysconfdir}/systemd/network/00-bmc-eth0.network.d/ \ + ${sysconfdir}/systemd/network/00-bmc-eth1.network.d/ \ + " +BONDING_CONF_PATH = "\ + ${sysconfdir}/systemd/network/10-bmc-bond0.netdev \ + ${sysconfdir}/systemd/network/00-bmc-bond0.network.d/bond0.conf \ + " +FILES:${PN}:append:s6q = "${@bb.utils.contains('MACHINE_FEATURES', 'bonding',\ + ' ${BONDING_CONF_PATH}', '', 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 + install -d ${D}${sysconfdir}/systemd/resolved.conf.d/ + install -m 0644 ${WORKDIR}/s6q-resolv.conf \ + ${D}${sysconfdir}/systemd/resolved.conf.d/ + install -d ${D}${sysconfdir}/systemd/network/ + install -d ${D}${sysconfdir}/systemd/network/00-bmc-eth0.network.d/ + install -d ${D}${sysconfdir}/systemd/network/00-bmc-eth1.network.d/ + if ${@bb.utils.contains('MACHINE_FEATURES', 'bonding', 'true', 'false', d)}; + then + install -d ${D}${sysconfdir}/systemd/network/00-bmc-bond0.network.d/ + install -m 0644 ${WORKDIR}/bond-eth0.conf \ + ${D}${sysconfdir}/systemd/network/00-bmc-eth0.network.d/ + install -m 0644 ${WORKDIR}/bond-eth1.conf \ + ${D}${sysconfdir}/systemd/network/00-bmc-eth1.network.d/ + install -m 0644 ${WORKDIR}/10-bmc-bond0.netdev \ + ${D}${sysconfdir}/systemd/network/ + install -m 0644 ${WORKDIR}/bond0.conf \ + ${D}${sysconfdir}/systemd/network/00-bmc-bond0.network.d/ + else + echo -e "[Network]\nLinkLocalAddressing=ipv6" > \ + ${D}${sysconfdir}/systemd/network/00-bmc-eth0.network.d/eth0.conf + echo -e "[Network]\nLinkLocalAddressing=ipv6" > \ + ${D}${sysconfdir}/systemd/network/00-bmc-eth1.network.d/eth1.conf fi } diff --git a/meta-quanta/meta-s6q/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-quanta/meta-s6q/recipes-phosphor/images/obmc-phosphor-image.bbappend new file mode 100644 index 0000000000..3c1f006d8c --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -0,0 +1 @@ +OBMC_IMAGE_EXTRA_INSTALL:append:s6q = " usb-ethernet-gadget" diff --git a/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget.bb b/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget.bb new file mode 100644 index 0000000000..6229879c3d --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget.bb @@ -0,0 +1,13 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +FILESEXTRAPATHS:append := "${THISDIR}/${PN}:" +SRC_URI:append = " file://00-bmc-usb0.network" + +FILES:${PN}:append = " ${sysconfdir_native}/systemd/network/00-bmc-usb0.network" + +do_install() { + install -d ${D}${sysconfdir_native}/systemd/network/ + install -m 0644 ${WORKDIR}/00-bmc-usb0.network \ + ${D}${sysconfdir_native}/systemd/network +} diff --git a/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget/00-bmc-usb0.network b/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget/00-bmc-usb0.network new file mode 100644 index 0000000000..44797f7c16 --- /dev/null +++ b/meta-quanta/meta-s6q/recipes-s6q/network/usb-ethernet-gadget/00-bmc-usb0.network @@ -0,0 +1,8 @@ +[Match] +Name=usb0 +[Network] +DHCP=false +LinkLocalAddressing=no +IPv6AcceptRA=false +[Address] +Address=169.254.0.17/20 |