usbmode: remove devices with unsupported modes
authorJulian Labus <julian@labus-online.de>
Wed, 24 May 2017 14:32:18 +0000 (16:32 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 31 May 2017 07:55:08 +0000 (09:55 +0200)
remove files which include the following mode options
BlackberryMode OptionMode PantechMode QuantaMode

Signed-off-by: Julian Labus <julian@labus-online.de>
package/utils/usbmode/Makefile

index 7f0195fdced7bf9dc9e7eba326cc2c3a7dd677d2..1b1ef147b6eff2ba3a2d947dc7a264e961e45399 100644 (file)
@@ -40,8 +40,13 @@ endef
 define Build/Prepare
        $(Build/Prepare/Default)
        tar xvfj $(DL_DIR)/$(PKG_DATA_FILENAME) -C $(PKG_BUILD_DIR)
-       rm -f \
-               $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/05c6:1000:sVe=GT
+       #remove devices with unsupported modes
+       for filevar in $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/* ; \
+       do \
+               if grep -q -E '(Quanta|Option|Blackberry|Pantech)Mode' "$$$$filevar" ; then \
+                       rm "$$$$filevar" ; \
+               fi \
+       done
        cp ./data/* $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/
        #in order to keep the Lede GIT repo free of filenames with colons,
        #we name the files xxxx-yyyy