Changeset 26809


Ignore:
Timestamp:
2011-05-03T21:39:13+02:00 (7 years ago)
Author:
jow
Message:

[package] comgt: move 3g hotplug handling to tty subsystem, fixes race on coldplug (#9211)

Location:
trunk/package/comgt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/comgt/Makefile

    r26175 r26809  
    5555        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface 
    5656        $(INSTALL_DATA) ./files/3g.iface $(1)/etc/hotplug.d/iface/05-3g 
    57         $(INSTALL_DIR) $(1)/etc/hotplug.d/usb 
    58         $(INSTALL_DATA) ./files/3g.usb $(1)/etc/hotplug.d/usb/30-3g 
     57        $(INSTALL_DIR) $(1)/etc/hotplug.d/tty 
     58        $(INSTALL_DATA) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g 
    5959        $(INSTALL_DIR) $(1)/etc/gcom 
    6060        $(INSTALL_DATA) ./files/setpin.gcom $(1)/etc/gcom/setpin.gcom 
  • trunk/package/comgt/files/3g.usb

    r26175 r26809  
    2323 
    2424                if [ "${dev##*/}" = "${tty##*/}" ]; then 
    25                         log "Starting interface $cfg for device ${tty##*/}" 
    26                         ( sleep 1; /sbin/ifup "$cfg" ) & 
     25                        [ -z "$(ls /var/lock | grep ${dev##*/})" ] && { 
     26                                log "Starting interface $cfg for device ${dev##*/}" 
     27                                sleep 1 
     28                                /sbin/ifup "$cfg" 
     29                        } 
    2730                fi 
    2831        } 
     
    3235if [ "$ACTION" = add ]; then 
    3336        case "$DEVICENAME" in 
    34                 *-*:*.*) config_load network;; 
     37                tty*) config_load network;; 
    3538                *) exit 0;; 
    3639        esac 
    3740 
    3841        local tty 
    39         for tty in /sys/$DEVPATH/ttyUSB* /sys/$DEVPATH/tty/ttyACM* /sys/$DEVPATH/tty/ttyHS*; do 
    40                 [ -d "$tty" ] || continue 
     42        for tty in /dev/ttyUSB* /dev/ttyACM* /dev/ttyHS*; do 
     43                [ -e "$tty" ] || continue 
    4144                config_foreach find_3g_iface interface "$tty" 
    4245        done 
Note: See TracChangeset for help on using the changeset viewer.