Installation manual

36 5. Debian and other Software Packages
All in all, our installation of laptop-net is hideous and slow. But it works.
5. 9. PCMCIA-CS
Although we don’tneed to compile anykernel modules from the pcmcia-cs packge, we want to compile the cor-
responding tools. The reason herefore is simple: The pcmcia tools distributed in the binary package are not
“trusting”, i.e. we can not change the pcmcia schemes as a normal user.Tochange this, we have toinstall the
pcmcia-source package, unpack the tar-ball, reconfigure the kernel, configure the pcmcia package and finally
compile and install the newpackage.
Debian package for PCMCIA sources:
pcmcia−sources
Building and installing the pcmcia-cs package:
#> cd /usr/src
#> tar xzf pcmcia−cs.tar.gz
#> cd kernel−source−2.4.19
#> make oldconfig; make dep
#> cd ../modules/pcmcia−cs
#> make config
#> cp config.* debian
#> debian/rules binary−cs
#> cd ..
#> mv pcmcia−cs_3.1.33−6_i386.deb /usr/local/debian/dists/woody/main/binary−i386/local
#> cd /usr/local/debian
#> echo "pcmcia−cs_3.1.33−6_i386.deb" >> override.local
#> dpkg−scanpackages dists/woody/main/binary−i386/local override.local > \
>dists/woody/main/binary−i386/Packages
#> apt−get update
#> apt−get install −−reinstall pcmcia−cs
We also want to integrate our PCMCIA setup with the laptop-net infrastructure. Webase our configuration on the
presupposition that laptop-net is always up, running and watching the status of eth0. Furthermore, we assume
that eth0 will always be associated with the internal ethernet adaptor,sothat our ethernet PC-card will always
showupaseth1. Lastly,wewant that eth1 gets managed by laptop-net only in the case, when no network is at-
tached to eth0.
To doso, we use a script /usr/local/packages/laptop-net/pcmcia, which we call from the PCMCIA network script
/etc/pcmcia/network.opts.
/usr/local/packages/laptop-net/pcmcia:
#!/bin/sh
INTERFACE="eth0"
PROF_CHANGE=/usr/share/laptop−net/profile−change
IFTEST=‘ifconfig | grep −A 1 "${INTERFACE}" | tail −1 | sed −e "s/:/ /" | awk ’{print $3}’‘
if [ −z "${IFTEST}" ]; then
${PROF_CHANGE} $*
exit 0
Update of /etc/pcmcia/network.opts:
#Extra stuff to do after setting up the interface
start_fn() { /usr/local/packages/laptop−net/pcmcia $DEVICE; return; }
#Extra stuff to do before shutting down the interface
stop_fn() { /usr/local/packages/laptop−net/pcmcia $DEVICE down; return; }