Pessoal,

Depois de muitos problemas tentando instalar o PCTel PCI no Debian potato eu consegui e anotei tudo o que eu fiz para isso num mini-Howto, que segue anexo. Está em inglês porque mandei para a lista debian-user também, e não tive tempo ainda para traduzir. Qualquer dúvida me perguntem.

Abraços,
        - Vítor
==================================================================
PCTel HSP56 Micromodem PCI at Debian 2.2r3 (potato) Mini-HOWTO 0.1
==================================================================

1 - Introduction
================

1.1 - Purpose
        The purpose of this document is to be a guide to anyone who is having 
problems installing a HSP56 PCI Micromodem from PCTel on a Debian 2.2r3 
(potato) system.

        In the folowing paragraphs I will try to describe how I installed this 
modem (which is becoming popular on the latest computer models) on my Debian 
system (a very popular Linux distro). I did not try other distributions of 
Linux or other kinds of Winmodems.

        For more information on Winmodems/Linmodems and the installation of 
their drivers, please consult:

        - Linmodems.org
        - Rob Clark's site: http://www.kcdata.com/~gromitkc/winmodem.html
        - The Linux Documentation Project: http://www.linuxdoc.org
        - Jan Stifter's Homepage: 
http://www.medres.ch/~jstifter/linux/pctel.html

        These links have been very helpful to me.

        Last but not least, please excuse my english. I'm not a native speaker. 
I wrote this in english so it could reach more users, but if you think 
portuguese is easier for you to understand, please contact me. I'll be glad to 
write to you in my native language.

1.2 - Warning
        Use this document as a guide only, adapting the instructions in it to 
your case. This is not a final solution, and things can go wrong! The author 
does not guarantee the instructions below won't damage your system in any ways 
and will not be held responsible for any harm caused by the use of this 
document. In other words: use this guide at your own risk.

        I am not a Linux expert. This document tells you my experience by 
describing exactly what I did. This has worked on a i686 system (AMD Athlon) 
with Debian GNU/Linux 2.2r3 (potato) installed, and a PCTel HSP56 Micromodem 
PCI (not onboard). I don't know if it works in any other plataforms or kinds of 
modem so, if you try it and it works, please let me know.

1.3 - The author
        If you want to contact me, please use my email:
        Vítor Souza <[EMAIL PROTECTED]>

        Feel free to send me a message if you have any questions or suggestions 
for this Mini-Howto.

        
2 - Before you begin
====================
        Before you begin, please be sure to have the following:

        - The CD Set for Debian GNU/Linux 2.2r3 (potato) binaries (at least CDs 
1 and 2 of the 3-CDs Set).
        - Access to the internet on another machine or system.
        - Some hard disk space (can't precise how much).


3 - The installation procedure
==============================
        The installation procedure consists on:

        - Getting the driver from the Internet;
        - Installing and preparing the kernel source;
        - Compiling and fixing the driver;
        - Connecting to the Internet.

        I did all the steps above as root, so I won't describe which steps 
requires root access and which ones don't. If you don't want to do all the 
instructions as root, try to do them as a normal user and su as root for the 
instructions that tell you "Permission denied". I'm just not that cautious 
about running my system as root when I'm installing things. My opinion is that 
as long as you don't play games or access the Internet as root, you'll be OK.

3.1 - Getting the driver from the Internet
        The drivers that worked for me were on Jan Stifter's Homepage, at 
http://www.medres.ch/~jstifter/linux/pctel.html. The name of the archive is 
pctel-2.2.tar.gz, and it should still be there. Download it and copy to any 
directory to which you have access to when logged in Linux.

        Also, you'll need a little script called 'fixscript'. You can find the 
latest version of it reading the Linmodem-Howto (look for it a the Linux 
Documentation Project). At the end of this document there is a version that 
worked for me, and you can use that also.


        $ cd /directory/where/files/were/downloaded/to
        First of all, access the directory where you copied both of the files 
(the drivers and fixscript).

        $ cp pctel-2.2.tar.gz /usr/src
        $ cp fixscript /usr/src
        Copy both of them to the /usr/src directory. That directory should 
exist on your Debian distro.

        $ cd /usr/src
        $ tar -zxvf pctel-2.2.tar.gz
        Change directory to /usr/src, unzip (de-compact) and untar (de-archive) 
the driver files. This will create the directory pctel-2.2. You can erase 
pctel-2.2.tar.gz if you want.

3.2 - Installing and preparing the kernel source
        The driver README file says it needs the kernel source files to install 
properly. Debian 2.2r3 uses kernel 2.2.19pre17, so that is the one we will get 
from the CD Set. To have the sources for this version of the kernel on your 
disk, do the following:

        $ apt-get install kernel-source-2.2.19pre17
        This will install the kernel source and all the other packages needed 
to unzip it.

        $ cd /usr/src
        Change to the directory the zipped (compacted) kernel is.

        $ bzip2 -cd kernel-source-2.2.19pre17.tar.bz2 | tar -xvf -
        Unzip and unarchive the kernel files. This command will take a while, 
because it's a big file.

        $ ln -s kernel-source-2.2.19pre17 linux
        Make a symbolic link (`man ln` for more information on links). This is 
usually done so every program looks for the sources in the same place: 
/usr/src/linux.

        $ cd linux
        $ make dep
        Issue these three commands to evaluate the dependencies of the kernel 
source. Don't mind all the stuff it will display on your screen. Trust the 
kernel wizards, it will work.

3.3 - Compiling and fixing the driver
        With the kernel and the drivers in their positions, it's time to 
compile the driver.

        $ touch /usr/src/linux/include/linux/modversions.h
        This is required before compiling the driver. According to Jan Stifter, 
this is an ugly hack you can pull if the file modversions.h does not exist in 
the proper place on the linux kernel source files.

        $ cd /usr/src/pctel-2.2
        $ make
        Change the directory to the driver dir and make (compile) the driver 
modules.

        $ cp ../fixscript modules
        $ cd modules
        $ chmod 755 fixscript
        Copy fixscript to the modules directory, access it and give fixscript 
execution permission.

        $ ./fixscript ptserial.o ptserial-fix.o
        Fix the ptserial.o module. The other one doesn't need to be fixed.

        $ mv ptserial.o ptserial-old.o
        $ mv ptserial-fix.o ptserial.o
        Backup the original ptserial.o and replace it with the new, fixed 
version.

        $ cd ..
        $ make install
        Go back to the parent directory and install the drivers. They will be 
copied to a /lib/modules subdirectory with your kernel number and will be ready 
to be loaded. This last command will also create a device file for you modem 
(/dev/ttyS15) and set it up properly.

3.4 - Loading the modules
        These two commands should be issued everytime you reboot and want to 
access your modem. Maybe I'll add a section about how to automatically load the 
modem everytime the system boots later (or maybe someone will do that for us).

        $ insmod pctel
        $ insmod ptserial


3.5 - Connecting to the Internet
        There are lots of utilities that can be used to connect to the 
Internet. Some Debian documentation recommends 'wvdial' (see 
http://www.worldvisions.ca for more info), and so do I. It has been working 
nice and clean for me.

        To have wvdial installed and configured, issue this command:

        $ apt-get install ppp wvdial

        wvdial should detect your modem (remember to load the modules first! We 
did that on step 3.4!) and configure itself automatically. It sould show, at 
some point, the following:

        Found a modem on /dev/ttyS15.
        ttyS15<Info>: Speed 115200; init "ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 
+FCLASS=0"

        After this you're ready to connect to the Internet! Only other thing 
you need now is to tell Linux what nameservers you use. If you don't know that, 
ask your provider. Edit the file /etc/resolv.conf with your favorite editor and 
type:

        domain your.domain.name.com
        nameserver YYY.YYY.YYY.YYY
        nameserver ZZZ.ZZZ.ZZZ.ZZZ

        Where your.domain.name.com is your provider's domain on the internet. 
YYY.YYY.YYY.YYY is the IP address of the primary nameserver and ZZZ.ZZZ.ZZZ.ZZZ 
is the IP address of the secondary nameserver (if available). Look at my 
resolv.conf file for example:

        domain terra.com.br
        nameserver 200.177.250.10
        nameserver 200.177.2.10

        You can also try pppconfig instead of wvdial, it has a configuration 
interface that you might find easier to use. Install it with `apt-get 
pppconfig` and type `pppconfig`.


4 - Fixscript
=============
#!/bin/bash

F=/tmp/objcopyscript
S=/tmp/syms
MI=/tmp/modinfo

echo -ne "kernel_version="`uname -r`"\0" > $MI

depmod -e $1 | grep -vE "^ltmodem" > $S

echo "#!/bin/bash" > $F
echo "objcopy \\" >> $F
for i in `cat $S` ; do
 echo -n doing $i
 new=`awk '/ '$i'_R/ {
  printf("%s", $2);
 }' < /proc/ksyms`
 echo " $new"
 echo "--redefine=$i=$new \\" >> $F
done

echo "--remove-section=.modinfo \\" >> $F
echo "--add-section=.modinfo=$MI \\" >> $F
echo '$*' >> $F
cat $F
chmod a+x $F
$F $1 $2
rm -f $F $S $MI


______________________
Vítor Estêvão Silva Souza
[EMAIL PROTECTED]

Responder a