diff options
author | William A. Kennington III <wak@google.com> | 2022-02-23 04:11:13 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2022-02-24 02:10:26 +0300 |
commit | a9de0df0c17ca93cdf86a978f46c574b9c6ec095 (patch) | |
tree | 0047aeef0cdb8e3196d5361b0ef69868cd6d8f8a /meta-google/recipes-google/networking | |
parent | 51def646105d0e53c94bafe9514039e85bb76a8b (diff) | |
download | openbmc-a9de0df0c17ca93cdf86a978f46c574b9c6ec095.tar.xz |
meta-google: gbmc-bridge: Only target bridge USB devices
This will allow us to have non-bridge USB devices on the system.
Change-Id: I5102fa8e1039013d9629b889350d46c6acf5cde3
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/networking')
-rw-r--r-- | meta-google/recipes-google/networking/gbmc-bridge/+-bmc-gbmcbrusb.network | 2 | ||||
-rwxr-xr-x | meta-google/recipes-google/networking/google-usb-network/usb_network.sh | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/+-bmc-gbmcbrusb.network b/meta-google/recipes-google/networking/gbmc-bridge/+-bmc-gbmcbrusb.network index e403334b43..ea923eb714 100644 --- a/meta-google/recipes-google/networking/gbmc-bridge/+-bmc-gbmcbrusb.network +++ b/meta-google/recipes-google/networking/gbmc-bridge/+-bmc-gbmcbrusb.network @@ -1,5 +1,5 @@ [Match] -Name=usb* +Property=ID_BUS=usb ID_VENDOR_ID=18d1 ID_MODEL_ID=0232 [Network] Bridge=gbmcbr [Bridge] diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh index 06707c4f7e..ede4482440 100755 --- a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh +++ b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh @@ -43,6 +43,20 @@ HELP } gadget_start() { + # Add the gbmcbr configuration if this is a relevant device + if (( ID_VENDOR == 0x18d1 && ID_PRODUCT == 0x22b )); then + mkdir -p /run/systemd/network + cat >/run/systemd/network/+-bmc-"${IFACE_NAME}".network <<EOF +[Match] +Name=${IFACE_NAME} +[Network] +Bridge=gbmcbr +[Bridge] +Cost=85 +EOF + networkctl reload || true + fi + local gadget_dir="${CONFIGFS_HOME}/usb_gadget/${GADGET_DIR_NAME}" mkdir -p "${gadget_dir}" echo ${ID_VENDOR} > "${gadget_dir}/idVendor" @@ -83,6 +97,9 @@ gadget_stop() { rm -rf ${gadget_dir}/strings/0x409 rm -rf ${gadget_dir}/functions/eem.${IFACE_NAME} rm -rf ${gadget_dir} + + rm -f /run/systemd/network/+-bmc-"${IFACE_NAME}".network + networkctl reload } opts=$(getopt \ |