[LEDE-DEV] [PATCH 3/3] usbmode: remove devices with unsupported modes
Bjørn Mork
bjorn at mork.no
Fri Dec 22 03:13:43 PST 2017
Julian Labus <julian at labus-online.de> writes:
> On 12/22/2017 10:48 AM, Bjørn Mork wrote:
>> Julian Labus <julian at labus-online.de> writes:
>>
>>> diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile
>>> index 7f0195fdce..1b1ef147b6 100644
>>> --- a/package/utils/usbmode/Makefile
>>> +++ b/package/utils/usbmode/Makefile
>>> @@ -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
>>
>>
>> Sorry for the extremely late comment on this. I missed the discussion
>> when it happened, but was made aware of it now because users with Option
>> modems complain that the modems have stopped working with LEDE.
>>
>> This patch is papering over a regression introduced by updating the data
>> package. I strongly object to that sort of bug "fixing". Option modems
>> used to work with the old data package, as it included the explicit
>> message for each Option device entry. Adding new modems does not
>> justify dropping support for older modems.
>>
>> Please fix this properly instead if you want to update to the config
>> data.
>
> Hi Bjørn,
>
> I didn't recognize that new modes where introduced for existing devices. To me
> it looked like they where introduced to support previously unsupported devices.
> Knowing that, I wouldn't have submitted the patch.
Yes, I believe this is correct for the Quanta, Blackberry and Pantech
modes. They use special control requests anyway, which I don't think
could be expressed using the older config.
But all the 61 OptionMode entries in usb-modeswitch-data-20170205 were
also present in usb-modeswitch-data-20150115.
> I saw that you already updated usbmode to support the missing modes. Once the
> package is updated accordingly my "patch" can be reverted.
Yes. But in the short run, you might want to do a quickfix ala
if grep -q 'OptionMode' "$$$$filevar" ; then \
sed -i -e 's/^OptionMode=1/MessageContent="55534243785634120100000080000601000000000000000000000000000000"\nNoDriverLoading=1/' "$$$$filevar" \
fi
or similar in that fixup loop, and drop 'Option|' from the regex. This
should be enough to convert the Option entries back to the old config
format.
Bjørn
More information about the Lede-dev
mailing list