[packages] usb-modeswitch: wait a second before retrying modeswitching, this reportedly helps to kick some dongles into operation

git-svn-id: svn://svn.openwrt.org/openwrt/packages@32602 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-07-04 12:02:23 +00:00
parent a958ad22c8
commit acb939b949
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2008-2011 OpenWrt.org
# Copyright (C) 2008-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=usb-modeswitch
PKG_VERSION:=1.2.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.draisberghof.de/usb_modeswitch

View File

@ -123,12 +123,13 @@ if [ "$ACTION" = add ]; then
# ugly workaround, but working for all hw we got for testing
switching_done=0
switching_tries=0
local usb_dir="/sys/$DEVPATH"
local usb_dir="/sys/$DEVPATH"
[ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}"
while [ $switching_done -lt 1 -a $switching_tries -le 6 ]; do
$modeswitch -v $uVid -p $uPid -I -D -n -s 30 -c "${configs%% *}"
if [ $(sanitize "$usb_dir/idProduct") = $uPid ]; then
log "switching seemingly failed"
log "$DEVICENAME: Switching seemingly failed"
sleep 1
else
switching_done=1
fi