# HG changeset patch # User Dominique Corbex # Date 1245329003 -7200 # Node ID 8fc90d8b565bfde52719760a68c53d9ad13e82fc # Parent 71a234d3060dd0c2cdc48c26ff891b91df24a9d3 get-softmodem-driver: automatic country detection added during slmodem install diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/receipt --- a/get-softmodem-driver/receipt Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/receipt Thu Jun 18 14:43:23 2009 +0200 @@ -20,5 +20,6 @@ cp -a stuff/*diff $fs/usr/share/softmodem cp -a stuff/*receipt $fs/usr/share/softmodem cp -a stuff/*init $fs/usr/share/softmodem + cp -a stuff/*country $fs/usr/share/softmodem cp -a stuff/zone.tab $fs/usr/share/softmodem } diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/get-softmodem-driver --- a/get-softmodem-driver/stuff/get-softmodem-driver Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/get-softmodem-driver Thu Jun 18 14:43:23 2009 +0200 @@ -101,8 +101,8 @@ make ROOT=$fs install make clean # Data for automatic region setting - mkdir -p $fs/usr/share/softmodem - cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hsfzone.tab + mkdir -p $fs/usr/share/hsfmodem + cp -a /usr/share/softmodem/zone.tab $fs/usr/share/hsfmodem # src is needed cd $taz mkdir -p $fs/usr/src @@ -119,8 +119,8 @@ make ROOT=$fs install make clean # Data for automatic region setting - mkdir -p $fs/usr/share/softmodem - cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hcfpcizone.tab + mkdir -p $fs/usr/share/hcfpcimodem + cp -a /usr/share/softmodem/zone.tab $fs/usr/share/hcfpcimodem # src is needed cd $taz mkdir -p $fs/usr/src @@ -162,6 +162,11 @@ cp -a modem/slmodemd $fs/usr/sbin mkdir -p $fs/etc/init.d cp -a /usr/share/softmodem/slmodem.init $fs/etc/init.d/slmodem + chmod +x $fs/etc/init.d/slmodem + # Data for automatic region setting + mkdir -p $fs/usr/share/slmodem + cp -a /usr/share/softmodem/zone.tab $fs/usr/share/slmodem + cp -a /usr/share/softmodem/slmodem.country $fs/usr/share/slmodem rm -rf $src ;; esac diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff --- a/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff Thu Jun 18 14:43:23 2009 +0200 @@ -55,10 +55,10 @@ fi - zoneinfo_dir=/usr/share/zoneinfo -+ zoneinfo_dir=/usr/share/softmodem ++ zoneinfo_dir=/usr/share/hcfpcimodem - if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then -+ if [ -f ${zoneinfo_dir}/hcfpcizone.tab ]; then ++ if [ -f ${zoneinfo_dir}/zone.tab ]; then return 1 fi @@ -78,7 +78,7 @@ - eval "echo \${iso_${code}}" - done | sort | uniq + zone=`cat /etc/TZ` -+ code=`grep $zone ${zoneinfo_dir}/hcfpcizone.tab | awk '{print $1}' | sort | uniq` ++ code=`grep $zone ${zoneinfo_dir}/zone.tab | awk '{print $1}' | sort | uniq` + eval "echo \${iso_${code}}" return 0 ) diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/hcfpcimodem.receipt --- a/get-softmodem-driver/stuff/hcfpcimodem.receipt Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/hcfpcimodem.receipt Thu Jun 18 14:43:23 2009 +0200 @@ -22,4 +22,6 @@ echo -n "Removing modules.." rm -rf /lib/modules/`uname -r`/extra/hcfpci* status + rm -rf /usr/share/hcfpicmodem + rm -rf /etc/hcfpcimodem } \ No newline at end of file diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff --- a/get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/hsfmodem-7.80.02.04full.diff Thu Jun 18 14:43:23 2009 +0200 @@ -55,10 +55,10 @@ fi - zoneinfo_dir=/usr/share/zoneinfo -+ zoneinfo_dir=/usr/share/softmodem ++ zoneinfo_dir=/usr/share/hsfmodem - if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then -+ if [ ! -f ${zoneinfo_dir}/hsfzone.tab ]; then ++ if [ ! -f ${zoneinfo_dir}/zone.tab ]; then return 1 fi @@ -78,7 +78,7 @@ - eval "echo \${iso_${code}}" - done | sort | uniq + zone=`cat /etc/TZ` -+ code=`grep $zone ${zoneinfo_dir}/hsfzone.tab | awk '{print $1}' | sort | uniq` ++ code=`grep $zone ${zoneinfo_dir}/zone.tab | awk '{print $1}' | sort | uniq` + eval "echo \${iso_${code}}" return 0 + diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/hsfmodem.receipt --- a/get-softmodem-driver/stuff/hsfmodem.receipt Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/hsfmodem.receipt Thu Jun 18 14:43:23 2009 +0200 @@ -22,4 +22,6 @@ echo -n "Removing modules.." rm -rf /lib/modules/`uname -r`/extra/hsf* status + rm -rf /usr/share/hsfmodem + rm -rf /etc/hsfmodem } \ No newline at end of file diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/martian.receipt --- a/get-softmodem-driver/stuff/martian.receipt Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/martian.receipt Thu Jun 18 14:43:23 2009 +0200 @@ -14,6 +14,23 @@ post_install() { + # Country settings + if [ -e /etc/TZ ]; then + ZONE=`cat /etc/TZ` + CODE=`grep $ZONE /usr/share/softmodem/marszone.tab | cut -f1'` + if [ -n $CODE ]; then + COUNTRY=`grep ^$CODE /usr/share/softmodem/martian.country | cut -f2` + fi + fi + if [ -z $COUNTRY ]; then + COUNTRY="USA" + fi + cat >> $root/etc/daemons.conf << "EOT" +# martian daemon options. +MARTIAN_OPTIONS="--country=$COUNTRY" + +EOT + # Load module /sbin/depmod -a /sbin/modprobe martian_dev && \ /etc/init.d/martian start diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/slmodem.country --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/slmodem.country Thu Jun 18 14:43:23 2009 +0200 @@ -0,0 +1,83 @@ +AD CTR21EUROPE +AE UAE +AR ARGENTINA +AT AUSTRIA +AU AUSTRALIA +BE BELGIUM +BG BULGARIA +BH BAHREIN +BN BRUNEI +BR BRAZIL +CA CANADA +CH SWITZERLAND +CL CHILE +CN CHINA +CY CYPRUS +CZ CZECH_REPUBLIC +DE GERMANY +DK DENMARK +DZ ALGERIA +EE ESTONIA +EG EGYPT +ES SPAIN +FI FINLAND +FO CTR21EUROPE +FR FRANCE +GB UK +GI CTR21EUROPE +GL CTR21EUROPE +GP FRANCE +GR GREECE +GY FRANCE +HK HONG_KONG +HU HUNGARY +ID INDONESIA +IE IRELAND +IL ISRAEL +IN INDIA +IS ICELAND +IT ITALY +JO JORDAN +JP JAPAN +KR KOREA +KT SOUTHKOREA +KW KUWAIT +LB LEBANON +LI CTR21EUROPE +LK SRILANKA +LT LITHUANIA +LU LUXEMBOURG +LV LATVIA +MA MOROCCO +MC CTR21EUROPE +MQ FRANCE +MT MALTA +MX MEXICO +MY MALAYSIA +NC FRANCE +NL NETHERLANDS +NO NORWAY +NZ NEW_ZEALAND +OM OMAN +PE PERU +PH PHILIPPINES +PJ FRANCE +PK PAKISTAN +PL POLAND +PT PORTUGAL +RO ROMANIA +RU RUSSIA +SA SAUDIARABIA +SE SWEDEN +SG SINGAPORE +SI SLOVENIA +SK SLOVAKIA +SM CTR21EUROPE +TH THAILAND +TN TUNISIA +TR TURKEY +TW TAIWAN +US USA +UY URUGUAY +VN VIETNAM +ZA SOUTHAFRICA diff -r 71a234d3060d -r 8fc90d8b565b get-softmodem-driver/stuff/slmodem.receipt --- a/get-softmodem-driver/stuff/slmodem.receipt Thu Jun 18 04:52:08 2009 +0200 +++ b/get-softmodem-driver/stuff/slmodem.receipt Thu Jun 18 14:43:23 2009 +0200 @@ -14,6 +14,32 @@ post_install() { + # Country detection + if [ -e /etc/TZ ]; then + ZONE=`cat /etc/TZ` + CODE=`grep $ZONE /usr/share/slmodem/zone.tab | cut -f1'` + if [ -n $CODE ]; then + COUNTRY=`grep ^$CODE /usr/share/slmodem/slmodem.country | cut -f2` + fi + fi + if [ -z $COUNTRY ]; then + COUNTRY="USA" + fi + echo "Automatic country setting: $COUNTRY" + # Save options + if [ `grep -c SLMODEM_OPTIONS /etc/daemons.conf` -gt 0 ]; then + sed -i 's/SLMODEM_OPTIONS=.*/SLMODEM_OPTIONS="--country='"$COUNTRY"' \/dev\/slamr0"/' /etc/daemons.conf + else + echo "# slmodemd daemon options." >> $root/etc/daemons.conf + echo "SLMODEM_OPTIONS=\"--country=$COUNTRY /dev/slamr0\"" >> $root/etc/daemons.conf + echo >> $root/etc/daemons.conf + fi + # Load module depmod -a /sbin/modprobe slamr && /etc/init.d/slmodem start } + +post_remove() +{ + rm -rf /usr/share/slmodem +} \ No newline at end of file