Changeset 28634


Ignore:
Timestamp:
2011-10-27T22:29:00+02:00 (6 years ago)
Author:
nbd
Message:

comgt: port 3g.sh to netifd

Location:
trunk/package/comgt
Files:
3 added
1 edited
1 copied
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/package/comgt/Makefile

    r27699 r28634  
    1717 
    1818PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION) 
     19 
     20PKG_CONFIG_DEPENDS:=CONFIG_USE_NETIFD 
     21COMGT_VARIANT:=$(if $(CONFIG_USE_NETIFD),netifd,old) 
     22FILES_DIR:=./files-$(COMGT_VARIANT) 
    1923 
    2024include $(INCLUDE_DIR)/package.mk 
     
    4246endef 
    4347 
     48define Package/comgt/install/netifd 
     49        $(INSTALL_DIR) $(1)/lib/netifd/proto 
     50        $(INSTALL_BIN) $(FILES_DIR)/3g.sh $(1)/lib/netifd/proto/3g.sh 
     51endef 
     52 
     53define Package/comgt/install/old 
     54        $(INSTALL_DIR) $(1)/etc/ppp 
     55        $(INSTALL_BIN) $(FILES_DIR)/3g.connect $(1)/etc/ppp/3g.connect 
     56        $(INSTALL_DIR) $(1)/lib/network 
     57        $(INSTALL_BIN) $(FILES_DIR)/3g.sh $(1)/lib/network/3g.sh 
     58        $(INSTALL_DIR) $(1)/etc/hotplug.d/button 
     59        $(INSTALL_DATA) $(FILES_DIR)/3g.button $(1)/etc/hotplug.d/button/05-3g 
     60        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface 
     61        $(INSTALL_DATA) $(FILES_DIR)/3g.iface $(1)/etc/hotplug.d/iface/05-3g 
     62endef 
     63 
    4464define Package/comgt/install 
    4565        $(INSTALL_DIR) $(1)/usr/bin 
    4666        $(INSTALL_BIN) $(PKG_BUILD_DIR)/comgt $(1)/usr/bin/ 
    4767        ln -s comgt $(1)/usr/bin/gcom 
    48         $(INSTALL_DIR) $(1)/etc/ppp 
    49         $(INSTALL_BIN) ./files/3g.connect $(1)/etc/ppp/3g.connect 
    5068        $(INSTALL_DIR) $(1)/etc/chatscripts 
    5169        $(INSTALL_DATA) ./files/3g.chat $(1)/etc/chatscripts/3g.chat 
    5270        $(INSTALL_DATA) ./files/evdo.chat $(1)/etc/chatscripts/evdo.chat 
    53         $(INSTALL_DIR) $(1)/lib/network 
    54         $(INSTALL_BIN) ./files/3g.sh $(1)/lib/network/3g.sh 
    55         $(INSTALL_DIR) $(1)/etc/hotplug.d/button 
    56         $(INSTALL_DATA) ./files/3g.button $(1)/etc/hotplug.d/button/05-3g 
    57         $(INSTALL_DIR) $(1)/etc/hotplug.d/iface 
    58         $(INSTALL_DATA) ./files/3g.iface $(1)/etc/hotplug.d/iface/05-3g 
    59         $(INSTALL_DIR) $(1)/etc/hotplug.d/tty 
    60         $(INSTALL_DATA) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g 
    6171        $(INSTALL_DIR) $(1)/etc/gcom 
    6272        $(INSTALL_DATA) ./files/setpin.gcom $(1)/etc/gcom/setpin.gcom 
     
    6474        $(INSTALL_DATA) ./files/getcardinfo.gcom $(1)/etc/gcom/getcardinfo.gcom 
    6575        $(INSTALL_DATA) ./files/getstrength.gcom $(1)/etc/gcom/getstrength.gcom 
     76        $(INSTALL_DIR) $(1)/etc/hotplug.d/tty 
     77        $(INSTALL_DATA) $(FILES_DIR)/3g.usb $(1)/etc/hotplug.d/tty/30-3g 
     78        $(Package/comgt/install/$(COMGT_VARIANT)) 
    6679endef 
    6780 
  • trunk/package/comgt/files-netifd/3g.usb

    r28633 r28634  
    11#!/bin/sh 
    2  
    32. /etc/functions.sh 
    4  
    5 log() { 
    6         logger -t 3g-hotplug "$@" 
    7 } 
     3. /lib/netifd/netifd-proto.sh 
    84 
    95find_3g_iface() { 
     
    1511        [ "$proto" = 3g ] || return 0 
    1612 
    17         local auto 
    18         config_get_bool auto "$cfg" auto 1 
    19         [ "$auto" = 1 ] || [ "$ACTION" = remove ] || return 0 
    20  
    2113        local dev 
    2214        config_get dev "$cfg" device 
     
    2416        if [ "${dev##*/}" = "${tty##*/}" ]; then 
    2517                if [ "$ACTION" = add ]; then 
    26                         log "Starting interface $cfg for device ${dev##*/}" 
    27                         ( sleep 1; /sbin/ifup "$cfg" ) & 
     18                        available=1 
    2819                else 
    29                         log "Stopping interface $cfg for device ${dev##*/}" 
    30                         /sbin/ifdown "$cfg" & 
     20                        available=0 
    3121                fi 
     22                proto_set_available "$cfg" $available 
    3223        fi 
    3324} 
Note: See TracChangeset for help on using the changeset viewer.