[Cooker] Vodafone Mobile Connect Card Driver for (Mandriva) Linux

Mandriva Linux: cooker@mandrivalinux.org


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

  • From: Buchan Milne
  • Subject: [Cooker] Vodafone Mobile Connect Card Driver for (Mandriva) Linux
  • Date: 1 Aug 2008 08:05:06 -0000

In the past, I have used the Option Globetrotter PCMCIA 3g card, one of the 
nozomi-based 3G cards, Nokia N70, and Nokia E61 for internet access on 
Mandriva, and it usually worked without incident (the 3g card well supported 
by drakconnect, the phones required some editing of ifcfg-files in the past).

I recently got a Vodafone E220 USB 3G modem, and there were some issues 
getting it working on 2008.1 (which sometimes requires the huaweiAktBbo 
utility to be run), however on the 2.6.26 kernel in cooker it works fine.

However, Vodafone has provided a linux utility similar to the one shipped on 
the USB storage on the device for Mac OS X and Windows, available at 
https://forge.betavine.net/projects/vodafonemobilec/ . It is a python-twisted 
based application which runs as a tray application, allowing you to easily set 
up new 3g connections (with hardware detection, hardware-specific settings, 
network-specific settings etc.), and support for reading SMS's from the modem.

It doesn't work out-the-box on Mandriva, an OS plugin is required. I have one 
that works (attached), but I have also packaged the software. Upstream has a 
rather long name for the package (vodafone-mobile-connect-card-driver-for-
linux-2.0.beta1.i386.rpm), so I have packaged it as 'vmc' (with relevant 
provides/obsoletes).

I will send the OS plugin upstream, but it may be more convenient to have it 
in contrib as well, so I will upload it (assuming there are no issues) to 
contrib and backports for contrib).

The remaining issues:

1)
I haven't looked at the installer versions of the software, but I suspect that 
they ship some binary utilities (such as the huaweiAktBbo, icon_switch etc. 
that are available in the contrib directory in the source package). So far, I 
packaged the huaweiAtkBbo utility (from 
http://www.kanoistika.sk/bobovsky/archiv/umts/) in a standalone package, and 
added a Suggests on this package in vmc (for %mdkversion <= 200900).

Since the vmc package is noarch, I would prefer not to ship the utilities in 
the vmc package, but I don't see much point in separate packages for each 
device's workaround utility (they normally consist of one source file and 
result in one binary and one udev rule).


2)
The vmc software uses wvdial for dialing, and it seems that the requirement is 
that the user running vmc needs write access to /etc/pp/pap-secrets, 
/etc/ppp/chap-secrets, and /etc/ppp/peers. If the user does not have write 
access, vmc puts up a warning (suggesting that the user should be added to the 
'daemon' group, and that the relevant files should be writeable by the daemon 
group), and exits.


Suggestions ? Comments?

Regards,
Buchan
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2007  Vodafone España, S.A.
# Author:  Pablo Martí
# Mandriva adaptions: Buchan Milne
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Mandriva OSPlugin"""
__version__ = "$Rev: 1179 $"

import re

from twisted.python.procutils import which

from vmc.common.oses import LinuxPlugin
from vmc.utils.utilities import get_file_data

mandriva_customization = {
    'WVDIAL_CONN_SWITCH' : '--config',
    'gksudo_name' : 'gksu',
}

DEFAULT_TEMPLATE = """
debug
noauth
name wvdial
noipdefault
nomagic
usepeerdns
ipcp-accept-local
ipcp-accept-remote
nomp
noccp
nopredictor1
novj
novjccomp
nobsdcomp"""

PAP_TEMPLATE = DEFAULT_TEMPLATE + """
refuse-chap
refuse-mschap
refuse-mschap-v2
refuse-eap
"""

CHAP_TEMPLATE = DEFAULT_TEMPLATE + """
refuse-pap
"""

TEMPLATES_DICT = {
    'default' : DEFAULT_TEMPLATE,
    'PAP' : PAP_TEMPLATE,
    'CHAP' : CHAP_TEMPLATE,
}

class MandrivaBasedDistro(LinuxPlugin):
    """
    OSPlugin for Mandriva-based distros
    """
    os_name = re.compile("Mandriva")
    os_version = None
    customization = mandriva_customization
   
    #XXX: Almost duplicated code with Suse plugin
    def get_timezone(self):
        timezone_re = re.compile('ZONE=(?P<tzname>[\w/]+)')
        sysconf_clock_file = get_file_data('/etc/sysconfig/clock')
        search_dict = timezone_re.search(sysconf_clock_file).groupdict()
        return search_dict['tzname'] or None
 
    def get_connection_args(self, dialer):
        assert dialer.binary == 'wvdial'
        
        if not self.privileges_needed:
            return [dialer.bin_path, self.abstraction['WVDIAL_CONN_SWITCH'],
                    dialer.conf_path, 'connect']
        
        gksudo_name = self.abstraction['gksudo_name']
        gksudo_path = which(gksudo_name)[0]
        args = [dialer.bin_path, self.abstraction['WVDIAL_CONN_SWITCH'],
                dialer.conf_path, 'connect']
        return [gksudo_path, '-g', " ".join(args)]
    
    def get_disconnection_args(self, dialer):
        assert dialer.binary == 'wvdial'
        
        killall_path = which('killall')[0]
        if not self.privileges_needed:
            return [killall_path, 'pppd', 'wvdial']
        
        gksudo_name = self.abstraction['gksudo_name']
        gksudo_path = which(gksudo_name)[0]
        args = " ".join([killall_path, 'pppd', 'wvdial'])
        return [gksudo_path, '-g', args]

    def get_config_template(self, dialer_profile):
        return TEMPLATES_DICT[dialer_profile]

mandriva = MandrivaBasedDistro()
%define realname vodafone-mobile-connect-card-driver-for-linux
%define version 2.0
%define pre beta3
%define rel 1

Summary: 	Vodafone Mobile Connect Card Driver (GUI) for Linux
Name: 		vmc
Version: 	%{version}
Release:	%mkrel %{expand:%{?pre:0.%pre.}}%rel
Source0: 	https://forge.vodafonebetavine.net/frs/download.php/57/%{realname}-%{version}%{?pre:.%pre}.tar.gz
Source1:	vmc-mandriva-plugin.py
#Patch:		
License:	GPLv2+
Group: 		System/Configuration/Networking
BuildArch:	noarch
BuildRoot: 	%{_tmppath}/%{name}-buildroot
URL:		https://forge.betavine.net/projects/vodafonemobilec/
Provides:	%{realname} = %{version}-%{release}
Obsoletes:	%{realname} < %{version}
# < %{version}-{release}
BuildRequires:	python-devel python-setuptools >= 0.6c5
Requires:	python-twisted python-serial pygtk2.0-libglade 
Requires:	python-matplotlib python-dbus gksu wvdial
Requires:	lsb-release
%if %mdkversion <= 200900
# With 2.6.26 and later, this is not required, but on 2.6.24 (2008.1) it still is:
Suggests:	huaweiaktbbo
%endif
# TODO
# contrib/ovation
# contrib/option_icon

%description
Vodafone Mobile Connect Card driver for Linux is a GPRS/UMTS/HSDPA device
manager written in Python, licensed under the GPL. Features: Data call handling
Send/Receive SMS SIM phone book management Graphical user interface using GTK

%prep
%setup -q -n %{realname}-%{version}%{?pre:.%pre}
install -m644 %{SOURCE1} plugins/mandriva.py
find . -name '*~' -o -name '*.bak' -exec rm -f {} \;
rm -f plugins/suse.py~

%build
env CFLAGS="$RPM_OPT_FLAGS" python setup.py build

%install
rm -Rf %{buildroot}
#rm -f INSTALLED_FILES
python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES

%clean
rm -rf $RPM_BUILD_ROOT

%files -f INSTALLED_FILES
%defattr(-,root,root)
%doc README

%changelog
* Thu Jul 31 2008 Buchan Milne <bgmilne@mandriva.org> 2.0-0.beta3.1mdv
- Initial package
Name: huaweiaktbbo
Version: 0.0.0
Release: %mkrel 1
License: GPL
Group: Communications
Summary: Tool to change the mode of the HUAWEI E220 3G Modem
BuildRequires: libusb-devel
URL: http://www.kanoistika.sk/bobovsky/archiv/umts/
Source: http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c
Source1: 99-huawei.rules

%description
Tool to change the mode of the HUAWEI E220 3G Modem

%prep
%setup -c -T
cp %{SOURCE0} .

%build
export CFLAGS="%optflags"
LDFLAGS=-lusb make huaweiAktBbo

%install
rm -Rf %{buildroot}
install -d %{buildroot}/%{_sbindir}
install -m755 huaweiAktBbo %{buildroot}/%{_sbindir}
install -d %{buildroot}/%{_sysconfdir}/udev/rules.d
install -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/udev/rules.d/99-huawei.rules

%files
%defattr(-,root,root)
%{_sbindir}/*
%{_sysconfdir}/udev/rules.d/*


Date Index | Thread Index

Search the archive:



To (un)subscribe from/to the lists:

Sympa mailing lists server.





Looking for a job?