From 878454ad544c4dfe1fa75e33cecce28ef646f749 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 4 Apr 2022 17:05:05 -0700 Subject: 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 --- .../recipes-google/networking/google-usb-network/usb_network.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'meta-google') 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 -- cgit v1.2.3