diff options
author | William A. Kennington III <wak@google.com> | 2022-04-05 03:05:05 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2022-04-05 20:10:28 +0300 |
commit | 878454ad544c4dfe1fa75e33cecce28ef646f749 (patch) | |
tree | 05cb64ec5555487c8639a5ab9f8e3e2c74add7f7 /meta-google | |
parent | f08c0ccbe69d714bbcfc45f35293b5d634f9a5ba (diff) | |
download | openbmc-878454ad544c4dfe1fa75e33cecce28ef646f749.tar.xz |
meta-google: google-usb-network: Name gadget after interface
We generally have a single interface per gadget, so name it after the
interface by default.
Change-Id: Iac4ebc50fa8586ec3493111ffa85d8c3a7aa8125
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rwxr-xr-x | meta-google/recipes-google/networking/google-usb-network/usb_network.sh | 8 |
1 files changed, 6 insertions, 2 deletions
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 0483e0849e..cbe7d0aefa 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 @@ -38,7 +38,7 @@ $0 [OPTIONS] [stop|start] --dev-mac MAC address of the device (gadget) part of the connection. Optional. --dev-type Type of gadget to instantiate. Default: "eem" --bind-device Name of the device to bind, as listed in /sys/class/udc/ - --gadget-dir-name Optional base name for gadget directory. Default: "g1" + --gadget-dir-name Optional base name for gadget directory. Default: iface-name --iface-name Optional name of the network interface. Default: "usb0" --help Print this help and exit. HELP @@ -132,7 +132,7 @@ DEV_TYPE="eem" HOST_MAC_ADDR="" BIND_DEVICE="" ACTION="start" -GADGET_DIR_NAME="g1" +GADGET_DIR_NAME="" IFACE_NAME="usb0" while [[ $# -gt 0 ]]; do case "$1" in @@ -191,6 +191,10 @@ while [[ $# -gt 0 ]]; do esac done +if [ -z "$GADGET_DIR_NAME" ]; then + GADGET_DIR_NAME="$IFACE_NAME" +fi + if [[ $ACTION == "stop" ]]; then gadget_stop else |