Revision: 5846
          http://ipcop.svn.sourceforge.net/ipcop/?rev=5846&view=rev
Author:   gespinasse
Date:     2011-09-13 16:11:12 +0000 (Tue, 13 Sep 2011)
Log Message:
-----------
Split usb-modeswitch and usb-modeswitch-data
Upgrade usb-modeswitch to 1.1.9 and use the jimsh flavor to gain tcl support

Upgrade usb-modeswitch-data to 20110805

Add a default-if patch that fix an issue on some device and will be include in 
next version

Add a patch on my own that remove gzip timestamp on the packed configuration 
file

Modified Paths:
--------------
    ipcop/trunk/config/rootfiles/common/usb-modeswitch
    ipcop/trunk/lfs/usb-modeswitch
    ipcop/trunk/make.sh

Added Paths:
-----------
    ipcop/trunk/config/rootfiles/common/usb-modeswitch-data
    ipcop/trunk/lfs/usb-modeswitch-data
    ipcop/trunk/src/patches/usb-modeswitch-1.1.9-jimsh_default-if.patch
    ipcop/trunk/src/patches/usb-modeswitch-data-20110805_gzip.patch

Modified: ipcop/trunk/config/rootfiles/common/usb-modeswitch
===================================================================
--- ipcop/trunk/config/rootfiles/common/usb-modeswitch  2011-09-12 19:12:12 UTC 
(rev 5845)
+++ ipcop/trunk/config/rootfiles/common/usb-modeswitch  2011-09-13 16:11:12 UTC 
(rev 5846)
@@ -1,6 +1,8 @@
-## usb-modeswitch-1.1.8
-##
 etc/usb_modeswitch.conf
-lib/udev/rules.d/40-usb_modeswitch.rules
+lib/udev/usb_modeswitch
+usr/bin/jimsh
+usr/bin/tclsh
 usr/sbin/usb_modeswitch
-usr/share/usb_modeswitch
+usr/sbin/usb_modeswitch_dispatcher
+#usr/share/man/man1/usb_modeswitch.1
+var/lib/usb_modeswitch

Added: ipcop/trunk/config/rootfiles/common/usb-modeswitch-data
===================================================================
--- ipcop/trunk/config/rootfiles/common/usb-modeswitch-data                     
        (rev 0)
+++ ipcop/trunk/config/rootfiles/common/usb-modeswitch-data     2011-09-13 
16:11:12 UTC (rev 5846)
@@ -0,0 +1 @@
+usr/share/usb_modeswitch/configPack.tar.gz

Modified: ipcop/trunk/lfs/usb-modeswitch
===================================================================
--- ipcop/trunk/lfs/usb-modeswitch      2011-09-12 19:12:12 UTC (rev 5845)
+++ ipcop/trunk/lfs/usb-modeswitch      2011-09-13 16:11:12 UTC (rev 5846)
@@ -32,8 +32,10 @@
 
 include Config
 
+# Use the variant including jimsh mini-tcl interpreter
+# Add jimsh on VER, so log_ and files_ have the same name
 PKG_NAME   = usb-modeswitch
-VER        = 1.1.8
+VER        = 1.1.9-jimsh
 HOST_ARCH  = all
 OTHER_SRC  = yes
 
@@ -43,23 +45,16 @@
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
 
-DATAVER    = 20110714
-DATAAPP    = usb-modeswitch-data-$(DATAVER)
-DL_DATAFILE = $(DATAAPP).tar.bz2
-DIR_DATAAPP = $(DIR_SRC)/$(DATAAPP)
 
 ###############################################################################
 # Top-level Rules
 ###############################################################################
 
-objects = $(DL_FILE) \
-       $(DL_DATAFILE)
+objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_DATAFILE) = $(DL_FROM)/$(DL_DATAFILE)
 
-$(DL_FILE)_MD5 = 1aaaa45e0465843e4973d7778bfbafbb
-$(DL_DATAFILE)_MD5 = da8ecaac36d97b5474d43d52fe66c272
+$(DL_FILE)_MD5 = 79b591c581a2c3a8f7876327ee034c20
 
 install : $(TARGET)
 
@@ -88,14 +83,13 @@
 
 $(TARGET) : $(firstword $(MAKEFILE_LIST)) $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) $(DIR_DATAAPP) && cd $(DIR_SRC) && tar axf 
$(DIR_DL)/$(DL_FILE)
+       @rm -rf $(DIR_APP) $(DIR_DATAAPP) && cd $(DIR_SRC) && tar xf 
$(DIR_DL)/$(DL_FILE)
+       # fix commented delay in 1.1.9 that may broke device working in 1.1.8
+       cd $(DIR_APP) && sed -i -e 's/#\tafter 500/\tafter 500/' 
usb_modeswitch.tcl
+       # apply patch that will be on 1.2.0
+       cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/$(THISAPP)_default-if.patch
 
-       cd $(DIR_APP) && make
-       cd $(DIR_APP) && install -m 754 usb_modeswitch /usr/sbin
-       cd $(DIR_APP) && install -m 644 usb_modeswitch.conf /etc
+       cd $(DIR_APP) && make install
 
-       cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_DATAFILE)
-       cd $(DIR_DATAAPP) && make files-install
-
        @rm -rf $(DIR_APP) $(DIR_DATAAPP)
        @$(POSTBUILD)

Added: ipcop/trunk/lfs/usb-modeswitch-data
===================================================================
--- ipcop/trunk/lfs/usb-modeswitch-data                         (rev 0)
+++ ipcop/trunk/lfs/usb-modeswitch-data 2011-09-13 16:11:12 UTC (rev 5846)
@@ -0,0 +1,92 @@
+###############################################################################
+# This file is part of the IPCop Firewall.                                    #
+#                                                                             #
+# IPCop is free software; you can redistribute it and/or modify               #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation; either version 2 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# IPCop is distributed in the hope that it will be useful,                    #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with IPCop; if not, write to the Free Software                        #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA    #
+#                                                                             #
+# Makefiles are based on LFSMake, which is                                    #
+# Copyright (C) 2002 Rod Roard <r...@sunsetsystems.com>                        
#
+#                                                                             #
+# Modifications by:                                                           #
+# ??-12-2003 Mark Wormgoor < m...@wormgoor.com>                               #
+#          - Modified Makefile for IPCop build                                #
+#                                                                             #
+# $Id: usb-modeswitch 5759 2011-07-31 13:27:44Z eoberlander $
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+PKG_NAME   = usb-modeswitch-data
+VER        = 20110805
+HOST_ARCH  = all
+OTHER_SRC  = yes
+
+THISAPP    = $(PKG_NAME)-$(VER)
+DL_FILE    = $(THISAPP).tar.bz2
+DL_FROM    = http://www.draisberghof.de/usb_modeswitch
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 0ed8a28f8efd3177a128ecd46fc8bf9f
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(firstword $(MAKEFILE_LIST)) $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP)&& cd $(DIR_SRC) && tar xf $(DIR_DL)/$(DL_FILE)
+       # remove gzip timestamp on packed configuration (patch submitted to the 
forum)
+       cd $(DIR_APP) && patch -p1 -i  $(DIR_PATCHES)/$(THISAPP)_gzip.patch
+       # Avoid rules-reload target as non-sense on building machine
+       # Use compressed config tar.gz with db-install-packed,
+       # that change from 196 individual files, each on a 4k block to a 9 kb 
configPack.tar.gz
+       cd $(DIR_APP) && make files-install db-install-packed
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)

Modified: ipcop/trunk/make.sh
===================================================================
--- ipcop/trunk/make.sh 2011-09-12 19:12:12 UTC (rev 5845)
+++ ipcop/trunk/make.sh 2011-09-13 16:11:12 UTC (rev 5846)
@@ -1854,6 +1854,7 @@
        chroot_make traceroute
        chroot_make ulogd
        chroot_make usb-modeswitch
+       chroot_make usb-modeswitch-data
        chroot_make vlan
        chroot_make vnstat
        chroot_make wireless_tools

Added: ipcop/trunk/src/patches/usb-modeswitch-1.1.9-jimsh_default-if.patch
===================================================================
--- ipcop/trunk/src/patches/usb-modeswitch-1.1.9-jimsh_default-if.patch         
                (rev 0)
+++ ipcop/trunk/src/patches/usb-modeswitch-1.1.9-jimsh_default-if.patch 
2011-09-13 16:11:12 UTC (rev 5846)
@@ -0,0 +1,37 @@
+commit 6ba592574d59bf9ab3aa890f536b00acc60b9095
+Author: Alexander Gordeev <lasa...@lvk.cs.msu.su>
+Date:   Wed Aug 31 12:01:04 2011 +0400
+
+    use the first available interface instead of zero
+   
+    In some broken devices interface numbers start from 1 while in other 
devices
+    with the same VID:PID combination (but under different brand) it's the 
usual
+    zero. The config file doesn't provide any means to set the right Interface
+    variable for them both to work. I think the best way is to dynamically 
detect
+    the least available interface number.
+   
+    Signed-off-by: Alexander Gordeev <lasa...@lvk.cs.msu.su>
+
+diff --git a/usb_modeswitch.c b/usb_modeswitch.c
+index 73d7e5d..701dbda 100644
+--- a/usb_modeswitch.c
++++ b/usb_modeswitch.c
+@@ -91,7 +91,7 @@ char ByteString[LINE_DIM/2];
+ char buffer[BUF_SIZE];
+ 
+ /* Settable Interface and Configuration (for debugging mostly) (jmw) */
+-int Interface = 0, Configuration = 0, AltSetting = -1;
++int Interface = -1, Configuration = 0, AltSetting = -1;
+ 
+ 
+ static struct option long_options[] = {
+@@ -437,6 +437,9 @@ int main(int argc, char **argv)
+                       defaultClass = 8;
+               }
+ 
++      if (Interface == -1)
++              Interface = 
dev->config[0].interface[0].altsetting[0].bInterfaceNumber;
++
+       /* Check or get endpoints */
+       if (strlen(MessageContent) || InquireDevice || CiscoMode) {
+               if (!MessageEndpoint) 

Added: ipcop/trunk/src/patches/usb-modeswitch-data-20110805_gzip.patch
===================================================================
--- ipcop/trunk/src/patches/usb-modeswitch-data-20110805_gzip.patch             
                (rev 0)
+++ ipcop/trunk/src/patches/usb-modeswitch-data-20110805_gzip.patch     
2011-09-13 16:11:12 UTC (rev 5846)
@@ -0,0 +1,13 @@
+--- usb-modeswitch-data-20110805/Makefile.old  2011-08-05 20:11:33.000000000 
+0200
++++ usb-modeswitch-data-20110805/Makefile      2011-09-13 07:30:04.000000000 
+0200
+@@ -25,7 +25,9 @@
+       install --mode=644 -t $(PREFIX)/share/usb_modeswitch 
./usb_modeswitch.d/*
+ 
+ db-install-packed:
+-      cd ./usb_modeswitch.d; tar -czf ../configPack.tar.gz *
++      # Create a compressed tar without gzip timestamp, so tar.gz is only 
different when the content is different
++      cd ./usb_modeswitch.d; tar -cf ../configPack.tar *
++      gzip -f9n ./configPack.tar
+       install --mode=644 -t $(PREFIX)/share/usb_modeswitch ./configPack.tar.gz
+       rm -f ./configPack.tar.gz
+ 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to