usbmode: remove devices with unsupported modes
authorJulian Labus <julian@labus-online.de>
Wed, 24 May 2017 14:32:18 +0000 (16:32 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Dec 2017 14:50:37 +0000 (15:50 +0100)
remove files which include the following mode options
BlackberryMode OptionMode PantechMode QuantaMode

Signed-off-by: Julian Labus <julian@labus-online.de>
(cherry picked from commit b757de65b3c3aa210022c65445df1d6dbbf9eadd)

package/utils/usbmode/Makefile

index 7f0195f..1b1ef14 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