Check-in [c6277794a9]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:c6277794a9f4c0f39cb0ff87d23925d86d67d586
Date: 2012-01-08 11:50:00
User: BarryK
Comment:usb-modeswitch updated 1.2.1, patched, detection scripts improved

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/etc/udev/rules.d/52-usb_modem_puppy.rules

@@ -1,7 +1,9 @@
 #BK some usb 3G modems do not mode-switch, so usb-modeswitch handling is not used.
 #handle these special cases here.
 #/lib/udev/rules.d/40-usb_modeswitch.rules has a rule for creating /dev/gsmmodem symlink to a working /dev/ttyUSB[n].
+#120901 add rule to remove /dev/gsmmodem.
 
 #my Optus Huawei E160-E 3G modem...
-ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140c", RUN+="/usr/sbin/usb_modem_special_status"
+ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140c", RUN+="/usr/sbin/usb_modem_special_status 3g"
+ACTION=="remove", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="140c", RUN+="/bin/rm -f /dev/gsmmodem"
 

Changes to woof-code/rootfs-skeleton/usr/sbin/usb_modem_special_status

@@ -1,22 +1,34 @@
 #!/bin/sh
 #BK called from udev rule in /etc/udev/rules.d/52-usb_modem_puppy.rules
-#some variables:
+#120109 usb_modeswitch 1.2.1: my optus 3g modem, not creating /dev/gsmmodem. call usb_modeswitch_status to do all the work.
+
+#some variables passed in:
 #ACTION=add
 #DEVLINKS=/dev/gsmmodem
 #DEVNAME=/dev/ttyUSB0
 #DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/ttyUSB0/tty/ttyUSB0
 #MAJOR=188
 #MINOR=0
 #SEQNUM=3815
 #SUBSYSTEM=tty
 
+#if [ "$DEVLINKS" = "/dev/gsmmodem" ];then
+##if [ -e /dev/gsmmodem ];then
+# killall yaf-splash
+# DISPLAY=":0" yaf-splash -placement center -close never -bg green -fontsize large -timeout 5 -text "USB Modem ready for use" &
+#else
+# if pidof yaf-splash ;then exit ;fi
+# DISPLAY=":0" yaf-splash -placement center -close never -bg yellow -fontsize large -timeout 30 -text "USB Modem inserted, please wait, configuring..." &
+#fi
 
-if [ "$DEVLINKS" = "/dev/gsmmodem" ];then
-#if [ -e /dev/gsmmodem ];then
- killall yaf-splash
- DISPLAY=":0" yaf-splash -placement center -close never -bg green -fontsize large -timeout 5 -text "USB Modem ready for use" &
-else
- if pidof yaf-splash ;then exit ;fi
- DISPLAY=":0" yaf-splash -placement center -close never -bg yellow -fontsize large -timeout 30 -text "USB Modem inserted, please wait, configuring..." &
-fi
+PARAM1=""
+[ $1 ] && PARAM1="$1"
 
+if [ "$PARAM1" = "3g" ];then #120109 3g: see 52-usb_modem_puppy.rules
+ #just go to normal status script...
+ echo "Mode switching was successful" > /var/log/usb_modeswitch_special_status #read by usb_modeswitch_status
+ #do not use 'exec' as udev calls this script multiple times and it must complete. but,
+ #usb_modeswitch_status has a lock region that prevents near-simultaneous multiple instances, but need
+ #to also do a running-check here first...
+ [ "`/bin/pidof usb_modeswitch_status`" = "" ] && /usr/sbin/usb_modeswitch_status &
+fi

Changes to woof-code/rootfs-skeleton/usr/sbin/usb_modeswitch_status

@@ -3,10 +3,12 @@
 #called from /lib/udev/usb_modeswitch, which in turn is called by udev rule when a 3G modem inserted.
 #101208 rewrite, simpler.
 #101209 switch has occurred, but sometimes (my ZTE K3571-Z modem) usbserial.ko fails to attach to usb interface.
 #110914 think possible this script gets called almost simultaneously more than once.
 #110914 create /dev/gsmmodem symlink if usb-modeswitch fails to do it.
+#120109 usb_modeswitch 1.2.1 different success message.
+#120109 /usr/sbin/usb_modeswitch_special_status now just comes here (usb modems that do not need switch).
 
 #all of the uevent env. variables are visible here. ex (my Optus 3G modem):
 #ACTION=add
 #DEVICE=/proc/bus/usb/001/005
 #DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.5
@@ -38,18 +40,19 @@
 rm -f /tmp/usb_modeswitch_status_lockregion_${$}_
 #end lock region#
 
 rm -f /tmp/usb_modeswitch_status_flag_success 2>/dev/null
 
-DISPLAY=":0" yaf-splash -placement center -close never -bg yellow -fontsize large -text "3G USB modem inserted, please wait, configuring..." &
+DISPLAY=":0" yaf-splash -placement center -close never -bg yellow -fontsize large -text "3G USB modem inserted, please wait, configuring ..." &
 yPID=$!
 
 BRKCNT=0
 while [ $BRKCNT -lt 30 ];do
  sleep 1
  LOGS="`cat /var/log/usb_modeswitch_*`"
  [ "`echo "$LOGS" | grep 'Mode switch succeeded'`" ] && break
+ [ "`echo "$LOGS" | grep 'Mode switching was successful'`" ] && break #120109 usb_modeswitch 1.2.1 different success message.
  BRKCNT=$(($BRKCNT+1))
 done
 
 if [ $BRKCNT -lt 30 ];then
  #101209 switch has occurred, but sometimes (my ZTE K3571-Z modem) usbserial.ko fails to attach to usb interface...

Changes to woof-distro/Packages-puppy-noarch-official

@@ -87,11 +87,12 @@
 pwsget-0.1|pwsget|0.1||Internet|40K||pwsget-0.1.pet|+gtkdialog3|Pwsget secure file downloader||||
 pzchmview-1.0d-1|pzchmview|1.0d-1||Document|28K||pzchmview-1.0d-1.pet|+chmlib|PZCHMView CHM Viewer||||
 shared-mime-info-0.70-5|shared-mime-info|0.70-5||BuildingBlock|272K||shared-mime-info-0.70-5.pet||mime information||||
 shared-mime-info_DEV-0.70-5|shared-mime-info_DEV|0.70-5||BuildingBlock|3772K||shared-mime-info_DEV-0.70-5.pet|+shared-mime-info|mime information||||
 ssh_gui-0.7.1-1-p4|ssh_gui|0.7.1-1-p4||Internet|40K||ssh_gui-0.7.1-1-p4.pet|+gtk+,+openssh_client|secure telnet gui|puppy|4||
+usb-modeswitch-data-20111023|usb-modeswitch-data|20111023||BuildingBlock|892K||usb-modeswitch-data-20111023.pet||data for usb-modeswitch pkg||||
 wallpaper-0.6.1-1|wallpaper|0.6.1-1||Desktop|116K||wallpaper-0.6.1-1.pet|+gtkdialog4|Set backdrop image||||
 wcpufreq-0.8|wcpufreq|0.8||System|53K||wcpufreq-0.8.pet||CPU Frequency Scaling Tool||||
 woo-ff-0.1.1|woo-ff|0.1.1||Multimedia|48K||woo-ff-0.1.1.pet|+ffmpeg,+gtkdialog3|woo-ff - multimedia converter||||
 xlock_gui-0.2-4|xlock_gui|0.2-4||Desktop|60K||xlock_gui-0.2-4.pet|+xlockmore|screen lock and screensaver||||
 you2pup-2.1.4-520|you2pup|2.1.4-520||Internet|60K||you2pup-2.1.4-520.pet|+gtkdialog3,+urxvt|You2pup YouTube downloader||||
 z_geany_bacon_hack-1.4|z_geany_bacon_hack|1.4||Document|40K||z_geany_bacon_hack-1.4.pet|+geany|temp hack for geany text editor for BaCon highlighting, stealing Freebasic category, created by big_bass||||

Changes to woof-distro/x86/Packages-puppy-common-official

@@ -336,12 +336,11 @@
 udev_DOC-136-w5|udev_DOC|136-w5||BuildingBlock|96K||udev_DOC-136-w5.pet||A Userspace Implementation for dynamic dev nodes|puppy|wary5||
 uget-1.4.8.5-1-pup4|uget|1.4.8.5-1-pup4||Internet|196K||uget-1.4.8.5-1-pup4.pet|+gtk+,+curl,+openssl|Uget download manager|puppy|4||
 unclutter-0.8-11|unclutter|0.8-11||BuildingBlock|9K||unclutter-0.8-11.pet||hides cursor when not moving|puppy|4||
 unionfs_utils-0.2.1-q1|unionfs_utils|0.2.1-q1||BuildingBlock|68K||unionfs_utils-0.2.1-q1.pet||unionfs layered filesystem utilities|t2|8.0rc||
 urxvtset-0.5|urxvtset|0.5||Desktop|44K||urxvtset-0.5.pet|+yad,+urxvt|UrxvtSet setup terminal emulator||||
-usb-modeswitch-1.1.9-patched-w52|usb-modeswitch|1.1.9-patched-w52||BuildingBlock|136K||usb-modeswitch-1.1.9-patched-w52.pet|+jimtcl|hybrid usb device mode switcher, note compiled in wary|puppy|wary5||
-usb-modeswitch-data-20110805|usb-modeswitch-data|20110805||BuildingBlock|700K||usb-modeswitch-data-20110805.pet|+usb-modeswitch|data for usb-modeswitch 3g modem management||||
+usb-modeswitch-1.2.1-w5c|usb-modeswitch|1.2.1-w5c||BuildingBlock|136K||usb-modeswitch-1.2.1-w5c.pet|+jimtcl|hybrid usb device mode switcher, note compiled in wary but should work all puppies, for best results needs woof 20120109+|puppy|wary5||
 util-linux-2.16.1-1-w5|util-linux|2.16.1-1-w5||BuildingBlock|456K||util-linux-2.16.1-1-w5.pet||Miscellaneous system utilities for Linux|puppy|wary5||
 util-linux_DEV-2.16.1-1-w5|util-linux_DEV|2.16.1-1-w5||BuildingBlock|208K||util-linux_DEV-2.16.1-1-w5.pet|+util-linux|Miscellaneous system utilities for Linux|puppy|wary5||
 valide-194-uj|valide|194-uj||Development|2324K||valide-194-uj.pet|+vala|text editor IDE for Vala/Genie coding|ubuntu|jaunty||
 viewnior-1.1|viewnior|1.1||Graphic|200K||viewnior-1.1.pet|+gtk+|Elegant Image Viewer, note compiled in Wary should work in all puppies||||
 viewnior_DOC-1.1|viewnior_DOC|1.1||Graphic|24K||viewnior_DOC-1.1.pet||Simple image viewer||||