diff options
author | Lei YU <yulei.sh@bytedance.com> | 2020-07-16 11:16:59 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-09-15 22:49:49 +0300 |
commit | 216f4ead0ba0eee8cc2d498cfe09b59d129f49f1 (patch) | |
tree | dd6ae6462483aceffcd2753c4f56f06b614b7010 | |
parent | a0aa022c42c459bc914406d858b452c5285926d6 (diff) | |
download | openbmc-216f4ead0ba0eee8cc2d498cfe09b59d129f49f1.tar.xz |
Add and use usb-network package
The usb-network.bb addes the service and config to enable usb-network by
default.
Tested: Verify that the usbeth0 device is created by default.
(From meta-bytedance rev: d7af25d78f709173cb41789708eb95119b9e3dd1)
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I075598dbddd8d7919b82d50bdbb1d12dc7f59d1e
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
4 files changed, 44 insertions, 1 deletions
diff --git a/meta-bytedance/recipes-bytedance/packagegroups/packagegroup-obmc-apps.bbappend b/meta-bytedance/recipes-bytedance/packagegroups/packagegroup-obmc-apps.bbappend index ffe77263c..2d3928d0f 100644 --- a/meta-bytedance/recipes-bytedance/packagegroups/packagegroup-obmc-apps.bbappend +++ b/meta-bytedance/recipes-bytedance/packagegroups/packagegroup-obmc-apps.bbappend @@ -1 +1 @@ -RDEPENDS_${PN}-extras_append = " phosphor-misc-usb-ctrl" +RDEPENDS_${PN}-extras_append = " phosphor-misc-usb-ctrl usb-network" diff --git a/meta-bytedance/recipes-bytedance/usb-network/files/00-bmc-usb0.network b/meta-bytedance/recipes-bytedance/usb-network/files/00-bmc-usb0.network new file mode 100644 index 000000000..834100329 --- /dev/null +++ b/meta-bytedance/recipes-bytedance/usb-network/files/00-bmc-usb0.network @@ -0,0 +1,7 @@ +[Match] +Name=usb0 +[Address] +Address=169.254.100.100/16 +[Network] +LinkLocalAddressing=no +IPv6AcceptRA=no diff --git a/meta-bytedance/recipes-bytedance/usb-network/files/usb_network.service b/meta-bytedance/recipes-bytedance/usb-network/files/usb_network.service new file mode 100644 index 000000000..bb20acdbf --- /dev/null +++ b/meta-bytedance/recipes-bytedance/usb-network/files/usb_network.service @@ -0,0 +1,12 @@ +[Unit] +Description=Enable usb network +After=phosphor-ipmi-host.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/usb-ctrl ecm usbeth0 on +ExecStop=/usr/bin/usb-ctrl ecm usbeth0 off + +[Install] +WantedBy=multi-user.target diff --git a/meta-bytedance/recipes-bytedance/usb-network/usb-network.bb b/meta-bytedance/recipes-bytedance/usb-network/usb-network.bb new file mode 100644 index 000000000..4ee0ed5ab --- /dev/null +++ b/meta-bytedance/recipes-bytedance/usb-network/usb-network.bb @@ -0,0 +1,24 @@ +SUMMARY = "Enable USB ethernet" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +DEPENDS += "systemd" +RDEPENDS_${PN} += "libsystemd" + +inherit allarch systemd + +SRC_URI += "file://usb_network.service \ + file://00-bmc-usb0.network" + +do_install() { + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/usb_network.service ${D}${systemd_unitdir}/system + + install -d ${D}${sysconfdir_native}/systemd/network/ + install -m 0644 ${WORKDIR}/00-bmc-usb0.network ${D}${sysconfdir_native}/systemd/network +} + +NATIVE_SYSTEMD_SUPPORT = "1" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "usb_network.service" |