Novell is now a part of Micro Focus

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.


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---

#Sets up the network interface

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

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

insmod -f $MODPATH/pcmcia/ds.o > /dev/null 2>&1
if [ $? != "0" ]; then unset DRIVERSERVICELOADED; return ; 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'
export NETDEVICE="tr0"
if cat /proc/pci | grep -q -i 'ethernet'
export NETDEVICE="eth0"
echo No device detected.
#All further references to "$NETDEVICE"
#are in place of previous value of "eth0".

ifconfig $NETDEVICE up > /dev/null 2>&1
if [ $? != "0" ]
ifconfig $NETDEVICE up > /dev/null 2>&1
if [ $? != "0" ]
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
if [ ! $DRIVERFOUND ]; then echo "Unable to detect network card. Check documentation for list of supported cards"; fi

if [ ! $IPADDR ]
echo Getting DHCP info from the server. Please Wait.
pump -h -i $NETDEVICE
if [ $? != 0 ] ; then export NWUNREACHABLE=YES; fi
ifconfig $NETDEVICE multicast > /dev/null 2>&1
route add -net netmask dev eth0 > /dev/null 2>&1
ifconfig $NETDEVICE $IPADDR netmask $NETMASK multicast > /dev/null 2>&1
route add -net netmask 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

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.


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 or at

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

© Copyright Micro Focus or one of its affiliates