Set USB PID based on kernel name - Check uname for imx or mtk, and set the PID appropriately. - Bail out if we don't match either. - If we start to have multiple boards with the same kernel version, we'll have to come up with a more clever way to handle this. Change-Id: I98df4503646c23cc9f34fa9dcf027183c11c93a7
diff --git a/usr/bin/usb-gadget-start.sh b/usr/bin/usb-gadget-start.sh index e3f293b..9f0c557 100755 --- a/usr/bin/usb-gadget-start.sh +++ b/usr/bin/usb-gadget-start.sh
@@ -1,8 +1,17 @@ #!/bin/bash +KERNEL_VERSION="$(uname -r)" +if [[ "${KERNEL_VERSION}" =~ imx ]]; then + PRODUCT_ID="0x9303" +elif [[ "${KERNEL_VERSION}" =~ mtk ]]; then + PRODUCT_ID="0x9304" +else + echo "Unknown device, not setting up gadget." + exit 1 +fi + PRODUCT_STRING="Mendel" MANUFACTURER_STRING="Google,LLC" -PRODUCT_ID="0x9303" VENDOR_ID="0x18d1" USB_VER="0x0200" DEV_CLASS="2"