[SCRIPT] pctel.slaxbuild for PCTEL modems
Posted: 28 Dec 2010, 20:18
Pctel Modems have linux drivers see this page for more information
http://linmodems.technion.ac.il/packag ... come.html
If you see the welcome page above, you will see I participated a bit in the helping of getting the driver to work, but if it were not for slax-remix by fanthom & community, it would not have been possible either , I tested code without being harmed
Copy + paste code and save as
run from terminal
and run
to generate pctel module.
http://linmodems.technion.ac.il/packag ... come.html
If you see the welcome page above, you will see I participated a bit in the helping of getting the driver to work, but if it were not for slax-remix by fanthom & community, it would not have been possible either , I tested code without being harmed
Copy + paste code and save as
Code: Select all
pctel.slaxbuild
Code: Select all
chmod +x pctel.slaxbuild
Code: Select all
/pctel.slaxbuild
Code: Select all
#!/bin/bash
PKG=pctel-0.9.7-9-rht-11
TMP=/tmp/pctel-$$
# download the source from linmodems page, uncomment if you want to download pctel source
# wget http://linmodems.technion.ac.il/packages/pctel/pctel-0.9.7-9-rht-11.tar.gz
#set -e
tar -zxvf $PKG*
cd $PKG/src
# run ./configure -auto for the type of modem you have
# you can have pct789,,,cm8738, i8xx, sis, via686a
./configure -auto # otherwise change this to your modem type :)
make
make install DESTDIR=$TMP
mkdir -p $TMP/etc/udev/rules.d/
echo "KERNEL==\"ttyS_PCTEL0\", SYMLINK=\"modem\"" > $TMP/etc/udev/rules.d/70-pctel.rules
sleep 3
rm -rf /lib/modules/`uname -r`/misc/pctel.o
rm -rf /lib/modules/`uname -r`/misc/ptserial.o
sleep 3
cd ../../
mkdir -p $TMP/etc/rc.d/
echo "#!/bin/bash " >> $TMP/etc/rc.d/rc.pctel
echo "#==========================================================" >> $TMP/etc/rc.d/rc.pctel
echo "# Startup script for PCTEL modem modules " >> $TMP/etc/rc.d/rc.pctel
echo "# " >> $TMP/etc/rc.d/rc.pctel
echo "# copied from http://kristol.org/david/dell-i8200/#pctel " >> $TMP/etc/rc.d/rc.pctel
echo "# and modified for Slax Linux Live/Slax Remix CD by " >> $TMP/etc/rc.d/rc.pctel
echo "# Antonio A. Olivares " >> $TMP/etc/rc.d/rc.pctel
echo "# olivares14031@gmail.com,discuss@linmodems.org " >> $TMP/etc/rc.d/rc.pctel
echo "#==========================================================" >> $TMP/etc/rc.d/rc.pctel
echo " " >> $TMP/etc/rc.d/rc.pctel
echo "/sbin/depmod -a " >> $TMP/etc/rc.d/rc.pctel
echo " " >> $TMP/etc/rc.d/rc.pctel
echo "if ! [[ -e /dev/modem ]] &> /dev/null; then " >> $TMP/etc/rc.d/rc.pctel
echo " { " >> $TMP/etc/rc.d/rc.pctel
echo " echo \"Linking /dev/ttyS_PCTEL0 to /dev/modem to let kppp access modem\" " >> $TMP/etc/rc.d/rc.pctel
echo " ln -s /dev/ttyS_PCTEL0 /dev/modem " >> $TMP/etc/rc.d/rc.pctel
echo " } " >> $TMP/etc/rc.d/rc.pctel
echo "fi " >> $TMP/etc/rc.d/rc.pctel
echo " " >> $TMP/etc/rc.d/rc.pctel
echo "# See how we were called. " >> $TMP/etc/rc.d/rc.pctel
echo " case \"\$1\" in " >> $TMP/etc/rc.d/rc.pctel
echo " start) " >> $TMP/etc/rc.d/rc.pctel
echo " echo -n \"Starting pctel . . .\" " >> $TMP/etc/rc.d/rc.pctel
echo " modprobe linmodem" >> $TMP/etc/rc.d/rc.pctel
echo " modprobe pctel" >> $TMP/etc/rc.d/rc.pctel
echo " modprobe pctel_hw" >> $TMP/etc/rc.d/rc.pctel
echo " echo \"done\" " >> $TMP/etc/rc.d/rc.pctel
echo " ;;" >> $TMP/etc/rc.d/rc.pctel
echo " stop)" >> $TMP/etc/rc.d/rc.pctel
echo " echo -n \"Shutting down pctel . . .\"" >> $TMP/etc/rc.d/rc.pctel
echo " modprobe -r pctel" >> $TMP/etc/rc.d/rc.pctel
echo " modprobe -r pctel_hw" >> $TMP/etc/rc.d/rc.pctel
echo " modprobe -r linmodem" >> $TMP/etc/rc.d/rc.pctel
echo " echo \"done\"" >> $TMP/etc/rc.d/rc.pctel
echo " ;;" >> $TMP/etc/rc.d/rc.pctel
echo " status)" >> $TMP/etc/rc.d/rc.pctel
echo " ;;" >> $TMP/etc/rc.d/rc.pctel
echo " restart)" >> $TMP/etc/rc.d/rc.pctel
echo " \$0 stop" >> $TMP/etc/rc.d/rc.pctel
echo " \$0 start" >> $TMP/etc/rc.d/rc.pctel
echo " ;;" >> $TMP/etc/rc.d/rc.pctel
echo " *)" >> $TMP/etc/rc.d/rc.pctel
echo " echo \"Usage: pctel {start|stop|restart|status}\" " >> $TMP/etc/rc.d/rc.pctel
echo " exit 1" >> $TMP/etc/rc.d/rc.pctel
echo " esac" >> $TMP/etc/rc.d/rc.pctel
echo " " >> $TMP/etc/rc.d/rc.pctel
echo " exit 0" >> $TMP/etc/rc.d/rc.pctel
chmod +x $TMP/etc/rc.d/rc.pctel
# copy build script
mkdir -p $TMP/usr/src/slaxbuilds/
cp $0 $TMP/usr/src/slaxbuilds/
find $TMP -type d | xargs chmod -v 755
find $TMP | grep .gz | xargs gunzip
find $TMP | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded
dir2lzm $TMP $PKG.sq4.lzm
rm -Rf $TMP
rm -Rf $PKG
chmod 755 $PKG.sq4.lzm