checking hardware type automatically

Jens Ruehmkorf ruehmkorf at informatik.Uni-Koeln.DE
Wed Aug 8 04:35:41 CEST 2001


Hi Matthew, hi Roland!

> > But now I have the problem to get the type of hardware determined by
> > fai. We use three different server and I need to distinguish beetween
> > them (mainly for hardware monitoring). I used to check for the pci
> > host
>
> Typically I set a classname based on the hardware involved, as per the
> following script:
>
> # Ethernet cards
> if grep -q RTL-8139 /proc/pci; then
>          echo RTL8139
> fi
>
> [...]

Granted that your /usr/share/misc/pci.ids in your nfs-root is up-to-date
using lspci is probably a better idea. grep'ing in /proc/pci does nothing
else, but the database linux/drivers/pci/pci.ids might be too old when
using 2.2-kernels for the installation.

If I get Roland right he uses a setup where he doesn't know the MACs in
advance but rather assigns IPs within a specific range using dhcp.

> Then have scripts and package lists based on these classes.  If you
> needed perfect classification, you could do it based on something
> unique to each machine - say, the ethernet HW address.  If their from
> different manufacturers, often they'll have separate prefixes.

Yes. Whenever you can guarantee that your NICs are from different vendors,
you can use the 24bit company-id to distinguish between them (the first
six hex numbers). See http://standards.ieee.org/regauth/oui/index.shtml
for a recent public list.

So it's just a question which vendor Roland's NICs are from. But besides
that I don't know a better solution than using lspci.

good luck,

--
Jens



More information about the linux-fai mailing list