Installation manual
5. 8. Laptop-Net 33
Addition of Intel e100 driverto/etc/default/laptop-net:
#MODULE_NAME="eepro100"
MODULE_NAME="e100"
Addition of Intel e100 driverto/usr/share/laptop-net/shared.sh:
case "${MODULE_NAME}" in
#3c59x | 8139too | au1000_eth | eepro100 | epic100 | fealnx | hamachi \
3c59x | 8139too | au1000_eth | e100 | eepro100 | epic100 | fealnx | hamachi \
case "${MODULE_NAME}" in
#3c59x | eepro100 | epic100 | old_tulip | pcnet32 | rtl8139 | sis900 \
3c59x | e100 | eepro100 | epic100 | old_tulip | pcnet32 | rtl8139 | sis900 \
Next, the automatic ARP detection of our IP address does not work in all cases. For this reason we have topuz-
zle together our own method of automagically determining our network.
We hav e hacked together a little script, which can do the automatic network detection by pinging the gatewayfor
static interfaces and by analysing the responses of the DHCP client. Being based on a shell script, this method is
rather slow. Having to wait for ping-timeouts, it is evenslower.But it seems to work. It would still be a good idea
to write a small C program for this job.Tointegrate it into the laptop-net package, we have tomodify /usr/share/
laptop-net/shared.sh.
Modification of /usr/share/laptop-net/shared.sh for ping-discovery:
#ARP_DISCOVERY=/usr/lib/laptop−net/arp−discovery
ARP_DISCOVERY=/usr/local/packages/laptop−net/ping−discovery
Shell script for ping-discovery:
#!/bin/sh
#/usr/local/packages/laptop−net/ping−discovery:
if [ −z "$1" ]; then
echo "Usage: ping_discovery <interface > <ip−map>"
exit 1
fi
INTERFACE="$1"
IPMAPFILE="$2"
SCHEME_DIR=/var/lib/laptop−net/schemes
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
#Load available schemes from /etc/laptop−net/ip−map.
SCHEME=‘grep −v −E "(ˆ$|#)" ${IPMAPFILE} | awk ’{print $1}’‘
if [ −z "$SCHEME" ]; then
echo "@NO−CHOICES@"
exit 1
fi
#Allow for extremely long negotation times with stoopid switches
sleep 30
#Test interface configuration: if already configured, return scheme; if
#unknown configuration, bring the interface down; if not configured, continue
IFTEST=‘ifconfig | grep −A 1 "${INTERFACE}" | tail −1 | sed −e "s/:/ /" | awk ’{print $3}’‘
if [ −n "${IFTEST}" ]; then
for s in ${SCHEME}; do
IFACE=${SCHEME_DIR}/$s
ADDRESS=‘grep "address" ${IFACE} | awk ’{print $2}’‘
if [ "${IFTEST}" = "${ADDRESS}" ]; then
echo $s
exit 0
fi
done
ifconfig ${INTERFACE} down
fi
#−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
#Loop over all non−DHCP schemes, try to bring up the interface and ping the
#gateway
for s in ${SCHEME}; do
IFACE=${SCHEME_DIR}/$s
DHCP=‘grep "dhcp" $IFACE‘