wok-6.x rev 3494

get-softmodem-driver: automatic country detection added during slmodem install
author Dominique Corbex <domcox@users.sourceforge.net>
date Thu Jun 18 14:43:23 2009 +0200 (2009-06-18)
parents 71a234d3060d
children 7a518ed08988
files get-softmodem-driver/receipt get-softmodem-driver/stuff/get-softmodem-driver get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff get-softmodem-driver/stuff/hcfpcimodem.receipt get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff get-softmodem-driver/stuff/hsfmodem.receipt get-softmodem-driver/stuff/martian.receipt get-softmodem-driver/stuff/slmodem.country get-softmodem-driver/stuff/slmodem.receipt
line diff
     1.1 --- a/get-softmodem-driver/receipt	Thu Jun 18 04:52:08 2009 +0200
     1.2 +++ b/get-softmodem-driver/receipt	Thu Jun 18 14:43:23 2009 +0200
     1.3 @@ -20,5 +20,6 @@
     1.4  	cp -a stuff/*diff $fs/usr/share/softmodem
     1.5  	cp -a stuff/*receipt $fs/usr/share/softmodem
     1.6  	cp -a stuff/*init $fs/usr/share/softmodem
     1.7 +	cp -a stuff/*country $fs/usr/share/softmodem
     1.8  	cp -a stuff/zone.tab $fs/usr/share/softmodem
     1.9  }
     2.1 --- a/get-softmodem-driver/stuff/get-softmodem-driver	Thu Jun 18 04:52:08 2009 +0200
     2.2 +++ b/get-softmodem-driver/stuff/get-softmodem-driver	Thu Jun 18 14:43:23 2009 +0200
     2.3 @@ -101,8 +101,8 @@
     2.4  	make ROOT=$fs install
     2.5  	make clean
     2.6  	# Data for automatic region setting
     2.7 -	mkdir -p $fs/usr/share/softmodem
     2.8 -	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hsfzone.tab
     2.9 +	mkdir -p $fs/usr/share/hsfmodem
    2.10 +	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/hsfmodem
    2.11  	# src is needed
    2.12  	cd $taz
    2.13  	mkdir -p $fs/usr/src
    2.14 @@ -119,8 +119,8 @@
    2.15  	make ROOT=$fs install
    2.16  	make clean
    2.17  	# Data for automatic region setting
    2.18 -	mkdir -p $fs/usr/share/softmodem
    2.19 -	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hcfpcizone.tab
    2.20 +	mkdir -p $fs/usr/share/hcfpcimodem
    2.21 +	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/hcfpcimodem
    2.22  	# src is needed
    2.23  	cd $taz
    2.24  	mkdir -p $fs/usr/src
    2.25 @@ -162,6 +162,11 @@
    2.26  	cp -a modem/slmodemd $fs/usr/sbin
    2.27  	mkdir -p $fs/etc/init.d
    2.28  	cp -a /usr/share/softmodem/slmodem.init $fs/etc/init.d/slmodem
    2.29 +	chmod +x $fs/etc/init.d/slmodem
    2.30 +	# Data for automatic region setting
    2.31 +	mkdir -p $fs/usr/share/slmodem
    2.32 +	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/slmodem
    2.33 +	cp -a /usr/share/softmodem/slmodem.country $fs/usr/share/slmodem
    2.34  	rm -rf $src
    2.35  	;;
    2.36  esac
     3.1 --- a/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff	Thu Jun 18 04:52:08 2009 +0200
     3.2 +++ b/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff	Thu Jun 18 14:43:23 2009 +0200
     3.3 @@ -55,10 +55,10 @@
     3.4   	fi
     3.5   
     3.6  -	zoneinfo_dir=/usr/share/zoneinfo
     3.7 -+	zoneinfo_dir=/usr/share/softmodem
     3.8 ++	zoneinfo_dir=/usr/share/hcfpcimodem
     3.9   
    3.10  -	if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then
    3.11 -+	if [ -f ${zoneinfo_dir}/hcfpcizone.tab ]; then
    3.12 ++	if [ -f ${zoneinfo_dir}/zone.tab ]; then
    3.13   		return 1
    3.14   	fi
    3.15   
    3.16 @@ -78,7 +78,7 @@
    3.17  -					eval "echo \${iso_${code}}"
    3.18  -				done | sort | uniq
    3.19  +		zone=`cat /etc/TZ`
    3.20 -+		code=`grep $zone ${zoneinfo_dir}/hcfpcizone.tab | awk '{print $1}' | sort | uniq`
    3.21 ++		code=`grep $zone ${zoneinfo_dir}/zone.tab | awk '{print $1}' | sort | uniq`
    3.22  +		eval "echo \${iso_${code}}"
    3.23   		return 0
    3.24   	)
     4.1 --- a/get-softmodem-driver/stuff/hcfpcimodem.receipt	Thu Jun 18 04:52:08 2009 +0200
     4.2 +++ b/get-softmodem-driver/stuff/hcfpcimodem.receipt	Thu Jun 18 14:43:23 2009 +0200
     4.3 @@ -22,4 +22,6 @@
     4.4      echo -n "Removing modules.."
     4.5      rm -rf /lib/modules/`uname -r`/extra/hcfpci*
     4.6      status
     4.7 +	rm -rf /usr/share/hcfpicmodem
     4.8 +	rm -rf /etc/hcfpcimodem
     4.9  }
    4.10 \ No newline at end of file
     5.1 --- a/get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff	Thu Jun 18 04:52:08 2009 +0200
     5.2 +++ b/get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff	Thu Jun 18 14:43:23 2009 +0200
     5.3 @@ -55,10 +55,10 @@
     5.4   	fi
     5.5   
     5.6  -	zoneinfo_dir=/usr/share/zoneinfo
     5.7 -+	zoneinfo_dir=/usr/share/softmodem
     5.8 ++	zoneinfo_dir=/usr/share/hsfmodem
     5.9   
    5.10  -	if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then
    5.11 -+	if [ ! -f ${zoneinfo_dir}/hsfzone.tab ]; then
    5.12 ++	if [ ! -f ${zoneinfo_dir}/zone.tab ]; then
    5.13   		return 1
    5.14   	fi
    5.15   
    5.16 @@ -78,7 +78,7 @@
    5.17  -					eval "echo \${iso_${code}}"
    5.18  -				done | sort | uniq
    5.19  +		zone=`cat /etc/TZ`
    5.20 -+		code=`grep $zone ${zoneinfo_dir}/hsfzone.tab | awk '{print $1}' | sort | uniq`
    5.21 ++		code=`grep $zone ${zoneinfo_dir}/zone.tab | awk '{print $1}' | sort | uniq`
    5.22  +		eval "echo \${iso_${code}}"
    5.23   		return 0
    5.24  +		
     6.1 --- a/get-softmodem-driver/stuff/hsfmodem.receipt	Thu Jun 18 04:52:08 2009 +0200
     6.2 +++ b/get-softmodem-driver/stuff/hsfmodem.receipt	Thu Jun 18 14:43:23 2009 +0200
     6.3 @@ -22,4 +22,6 @@
     6.4  	echo -n "Removing modules.."
     6.5  	rm -rf /lib/modules/`uname -r`/extra/hsf*
     6.6  	status
     6.7 +	rm -rf /usr/share/hsfmodem
     6.8 +	rm -rf /etc/hsfmodem
     6.9  }
    6.10 \ No newline at end of file
     7.1 --- a/get-softmodem-driver/stuff/martian.receipt	Thu Jun 18 04:52:08 2009 +0200
     7.2 +++ b/get-softmodem-driver/stuff/martian.receipt	Thu Jun 18 14:43:23 2009 +0200
     7.3 @@ -14,6 +14,23 @@
     7.4  
     7.5  post_install()
     7.6  {
     7.7 +	# Country settings
     7.8 +	if [ -e /etc/TZ ]; then
     7.9 +		ZONE=`cat /etc/TZ`
    7.10 +		CODE=`grep $ZONE /usr/share/softmodem/marszone.tab | cut -f1'`
    7.11 +		if [ -n $CODE ]; then
    7.12 +			COUNTRY=`grep ^$CODE /usr/share/softmodem/martian.country | cut -f2`
    7.13 +		fi
    7.14 +	fi
    7.15 +	if [ -z $COUNTRY ]; then
    7.16 +		COUNTRY="USA"
    7.17 +	fi
    7.18 +	cat >> $root/etc/daemons.conf << "EOT"
    7.19 +# martian daemon options.
    7.20 +MARTIAN_OPTIONS="--country=$COUNTRY"
    7.21 +
    7.22 +EOT
    7.23 +	# Load module
    7.24  	/sbin/depmod -a
    7.25  	/sbin/modprobe martian_dev && \
    7.26  	/etc/init.d/martian start
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/get-softmodem-driver/stuff/slmodem.country	Thu Jun 18 14:43:23 2009 +0200
     8.3 @@ -0,0 +1,83 @@
     8.4 +AD	CTR21EUROPE
     8.5 +AE	UAE
     8.6 +AR	ARGENTINA
     8.7 +AT	AUSTRIA
     8.8 +AU	AUSTRALIA
     8.9 +BE	BELGIUM
    8.10 +BG	BULGARIA
    8.11 +BH	BAHREIN
    8.12 +BN	BRUNEI
    8.13 +BR	BRAZIL
    8.14 +CA	CANADA
    8.15 +CH	SWITZERLAND
    8.16 +CL	CHILE
    8.17 +CN	CHINA
    8.18 +CY	CYPRUS
    8.19 +CZ	CZECH_REPUBLIC
    8.20 +DE	GERMANY
    8.21 +DK	DENMARK
    8.22 +DZ	ALGERIA
    8.23 +EE	ESTONIA
    8.24 +EG	EGYPT
    8.25 +ES	SPAIN
    8.26 +FI	FINLAND
    8.27 +FO	CTR21EUROPE
    8.28 +FR	FRANCE
    8.29 +GB	UK
    8.30 +GI	CTR21EUROPE
    8.31 +GL	CTR21EUROPE
    8.32 +GP	FRANCE
    8.33 +GR	GREECE
    8.34 +GY	FRANCE
    8.35 +HK	HONG_KONG
    8.36 +HU	HUNGARY
    8.37 +ID	INDONESIA
    8.38 +IE	IRELAND
    8.39 +IL	ISRAEL
    8.40 +IN	INDIA
    8.41 +IS	ICELAND
    8.42 +IT	ITALY
    8.43 +JO	JORDAN
    8.44 +JP	JAPAN
    8.45 +KR	KOREA
    8.46 +KT	SOUTHKOREA
    8.47 +KW	KUWAIT
    8.48 +LB	LEBANON
    8.49 +LI	CTR21EUROPE
    8.50 +LK	SRILANKA
    8.51 +LT	LITHUANIA
    8.52 +LU	LUXEMBOURG
    8.53 +LV	LATVIA
    8.54 +MA	MOROCCO
    8.55 +MC	CTR21EUROPE
    8.56 +MQ	FRANCE
    8.57 +MT	MALTA
    8.58 +MX	MEXICO
    8.59 +MY	MALAYSIA
    8.60 +NC	FRANCE
    8.61 +NL	NETHERLANDS
    8.62 +NO	NORWAY
    8.63 +NZ	NEW_ZEALAND
    8.64 +OM	OMAN
    8.65 +PE	PERU
    8.66 +PH	PHILIPPINES
    8.67 +PJ	FRANCE
    8.68 +PK	PAKISTAN
    8.69 +PL	POLAND
    8.70 +PT	PORTUGAL
    8.71 +RO	ROMANIA
    8.72 +RU	RUSSIA
    8.73 +SA	SAUDIARABIA
    8.74 +SE	SWEDEN
    8.75 +SG	SINGAPORE
    8.76 +SI	SLOVENIA
    8.77 +SK	SLOVAKIA
    8.78 +SM	CTR21EUROPE
    8.79 +TH	THAILAND
    8.80 +TN	TUNISIA
    8.81 +TR	TURKEY
    8.82 +TW	TAIWAN
    8.83 +US	USA
    8.84 +UY	URUGUAY
    8.85 +VN	VIETNAM
    8.86 +ZA	SOUTHAFRICA
     9.1 --- a/get-softmodem-driver/stuff/slmodem.receipt	Thu Jun 18 04:52:08 2009 +0200
     9.2 +++ b/get-softmodem-driver/stuff/slmodem.receipt	Thu Jun 18 14:43:23 2009 +0200
     9.3 @@ -14,6 +14,32 @@
     9.4  
     9.5  post_install()
     9.6  {
     9.7 +	# Country detection
     9.8 +	if [ -e /etc/TZ ]; then
     9.9 +		ZONE=`cat /etc/TZ`
    9.10 +		CODE=`grep $ZONE /usr/share/slmodem/zone.tab | cut -f1'`
    9.11 +		if [ -n $CODE ]; then
    9.12 +			COUNTRY=`grep ^$CODE /usr/share/slmodem/slmodem.country | cut -f2`
    9.13 +		fi
    9.14 +	fi
    9.15 +	if [ -z $COUNTRY ]; then
    9.16 +		COUNTRY="USA"
    9.17 +	fi
    9.18 +	echo "Automatic country setting: $COUNTRY"
    9.19 +	# Save options
    9.20 +	if [ `grep -c SLMODEM_OPTIONS /etc/daemons.conf` -gt 0 ]; then
    9.21 +		sed -i 's/SLMODEM_OPTIONS=.*/SLMODEM_OPTIONS="--country='"$COUNTRY"' \/dev\/slamr0"/' /etc/daemons.conf
    9.22 +	else
    9.23 +		echo "# slmodemd daemon options." >> $root/etc/daemons.conf
    9.24 +		echo "SLMODEM_OPTIONS=\"--country=$COUNTRY /dev/slamr0\"" >> $root/etc/daemons.conf
    9.25 +		echo  >> $root/etc/daemons.conf
    9.26 +	fi
    9.27 +	# Load module 
    9.28  	depmod -a
    9.29  	/sbin/modprobe slamr && /etc/init.d/slmodem start
    9.30  }
    9.31 +
    9.32 +post_remove()
    9.33 +{
    9.34 +	rm -rf /usr/share/slmodem
    9.35 +}
    9.36 \ No newline at end of file