From efcde4484b89ba9546561c7f265bcca48fd02db8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 4 Jul 2012 12:02:23 +0000 Subject: [PATCH] [packages] usb-modeswitch: wait a second before retrying modeswitching, this reportedly helps to kick some dongles into operation SVN-Revision: 32602 --- utils/usb-modeswitch/Makefile | 4 ++-- utils/usb-modeswitch/files/modeswitch.hotplug | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/usb-modeswitch/Makefile b/utils/usb-modeswitch/Makefile index e2c4939b7d..ade1a012e3 100644 --- a/utils/usb-modeswitch/Makefile +++ b/utils/usb-modeswitch/Makefile @@ -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 diff --git a/utils/usb-modeswitch/files/modeswitch.hotplug b/utils/usb-modeswitch/files/modeswitch.hotplug index 33137d42f7..eb71b3056a 100644 --- a/utils/usb-modeswitch/files/modeswitch.hotplug +++ b/utils/usb-modeswitch/files/modeswitch.hotplug @@ -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 -- 2.30.2