Novell Home

Imaging with Token Ring Cards

Novell Cool Solutions: Feature
By Martin Buckley

Digg This - Slashdot This

Posted: 30 May 2001
 

Version: ZENworks for Desktops 3

We got an interesting question from Germany the other day, as follows:

Uwe Buckesfeld wrote:

First of all, thanks in general for all the great tricks presented in Cool Solutions.

I have ZfD3 here and I am one of the last dinosaurs using 16 MBit Token ring. I want to get ZfD3 imaging running with Olicom cards, and I'm desperate after testing around: I'm not able to get the linux drivers for my Olicom cards up and running.

Do you guys know about anybody who got imaging running with token ring?

If you say "TR? No. Doesn't work. Will never work. Waste your time in a better way." that would be okay, too. I would be a nice boy and start wasting my time somehow else.

This is our kind of inquiry: a rare invitation to tell someone to go waste their time in a better way. Couldn't resist it. We poked around fully expecting a No, and got the following Cool but Untested and Unsupported (in other words, just like everything else at Cool Solutions) trick that Uwe can try. The Evil ZENworks Scientist is full of surprises.

Objective

To automatically detect and use either Token Ring or Ethernet NIC in Linux boot process.

How it was done

The file /bin/network.s in the archive file root.tgz on disk 2 was modified to search the process /proc/pci for the existence of key words of either "Token Ring" or "Ethernet". Based on the findings, a variable "%NETDEVICE" is set to either "tr0" for Token Ring or "eth0" for Ethernet.

The file GREP was added to the root.tgz archive to perform the search.

Changes from original

Modified NETWORK.S to replace "eth0" with the variable "%NETDEVICE". This variable gets set by GREPing /proc/pci for the existence of either "tr0" for Token Ring or "eth0" for Ethernet. Full modified script to follow.

---Start network.s file---

#network.s
#Sets up the network interface

checkiflaptop()
{
if [ ! $PCMCIADETECTED ]
then
insmod -f $MODPATH/pcmcia/pcmcia_core.o > /dev/null 2>&1
if [ $? != "0" ] ; then unset PCMCIADETECTED; return ; fi
export PCMCIADETECTED=YES
fi

if [ ! $PCMCIACONTROLLER ]
then
insmod -f $MODPATH/pcmcia/i82365.o > /dev/null 2>&1
if [ $? != "0" ]; then
insmod -f $MODPATH/pcmcia/tcic.o > /dev/null 2>&1
if [ $? != "0" ] ; then unset PCMCIACONTROLLER; return ; fi
export PCMCIACONTROLLER=TCIC
else
export PCMCIACONTROLLER=I82365
fi
fi

if [ ! $DRIVERSERVICELOADED ]
then
insmod -f $MODPATH/pcmcia/ds.o > /dev/null 2>&1
if [ $? != "0" ]; then unset DRIVERSERVICELOADED; return ; fi
export DRIVERSERVICELOADED=YES
fi

cardmgr -o > /dev/null 2>&1
}

#Automatic detection of Ethernet or Token Ring NIC
# Developed by Jason Rivard and Tom Birkenbach of Novell.
if cat /proc/pci | grep -q -i 'token ring'
then
export NETDEVICE="tr0"
else
if cat /proc/pci | grep -q -i 'ethernet'
then
export NETDEVICE="eth0"
else
echo No device detected.
fi
fi
#All further references to "$NETDEVICE"
#are in place of previous value of "eth0".

ifconfig $NETDEVICE up > /dev/null 2>&1
if [ $? != "0" ]
then
checkiflaptop
ifconfig $NETDEVICE up > /dev/null 2>&1
if [ $? != "0" ]
then
for file in $( ls $MODPATH/net ); do
insmod -f $MODPATH/net/$file > /dev/null 2>&1
ifconfig $NETDEVICE up > /dev/null 2>&1
if [ $? = "0" ]; then DRIVERFOUND=YES; fi
done
if [ ! $DRIVERFOUND ]; then echo "Unable to detect network card. Check documentation for list of supported cards"; fi
fi

fi
if [ ! $IPADDR ]
then
echo Getting DHCP info from the server. Please Wait.
pump -h localhost.localdomain.com -i $NETDEVICE
if [ $? != 0 ] ; then export NWUNREACHABLE=YES; fi
ifconfig $NETDEVICE multicast > /dev/null 2>&1
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 > /dev/null 2>&1
else
ifconfig $NETDEVICE $IPADDR netmask $NETMASK multicast > /dev/null 2>&1
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 > /dev/null 2>&1
if [ $GATEWAY ]; then route add default gw $GATEWAY > /dev/null 2>&1; fi
rm -f /etc/resolv.conf > /dev/null 2>&1
echo "search $DNSDOMAINSUFFIX" > /etc/resolv.conf
for str in $DNSNAMESERVER; do echo "nameserver $str" >> /etc/resolv.conf; done
fi

echo Proxy IP Address is set to $PROXYADDR
---End network.s file---

GREP version 2.2 was added to the ROOT.TGZ file into the /bin directory. This version is used because it is compatible with the 2.2.14 kernel.

For testing, DRIVER.CONF was modified so that insmod used the -f parameter to force the driver install regardless of the version of the kernel it was compiled on. This doesn't seem necessary when insmod is running in a script.

In the Token Ring environment where this was developed, the IBM Token Ring PCI series of NICs were used. These are based on the Olympic chipset and therefore no additional drivers were needed. The Linux Olympic driver is named OLYMPIC.O. Another Token Ring driver, IBMTR.O was included in case other IBM Token Ring cards are added to the network. For testing purposed, the AMD PCNet Ethernet driver was added for testing from within VMWare. This driver is PCNET32.O.

Notes

The script files can NOT be edited with typical Windows based editors. Linux editors or special Windows based Linux/UNIX editors should be used.

Here are the files to download:

About the Author

By night Martin Buckley is the Evil ZENworks Scientist -- cooking up ZENworks solutions and hatching dastardly integrations. By day he is the ZENworks for Desktops Product Manager. Based in Provo, UT and Nottingham, England - he's always on the road. Be warned.

You can contact Martin at martin_buckley@novell.com or at ezs@myrealbox.com.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell