Commit 4694bd7e authored by Robert Ricci's avatar Robert Ricci

Support for DHCP interface selection on FreeBSD. The script

/etc/testbed/nodetype uses the CPU speed (gleaned from /var/run/dmesg.boot
by cpuspeed.awk) to distinguish between pc600s and pc850s. The start_if.*
scripts use this to determine whether the node should attempt to dhcp
on this interface.

NOTE: When using the start_if.* scripts, NO interfaces should be set
to DHCP in /etc/rc.conf - this will break things.
parent 4960a7cf
......@@ -42,3 +42,7 @@ install:
$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth /root/.cvsup/auth
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
/etc/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/nodetype /etc/testbed/nodetype
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk /etc/testbed/cpuspeed.awk
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp0 /etc/start_if.fxp0
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp4 /etc/start_if.fxp4
#!/usr/bin/awk -f
/^CPU:.*\(8[0-9][0-9]\.[0-9]+\-MHz/ {
print "850";
next
}
/^CPU:.*\(6[0-9][0-9]\.[0-9]+\-MHz/ {
print "600";
next
}
/^CPU:.*/ {
print "0";
next
}
#!/bin/sh
if [ -x '/etc/testbed/cpuspeed.awk' ]; then
cpuspeed=`/etc/testbed/cpuspeed.awk /var/run/dmesg.boot`;
else
cpuspeed='';
fi
if [ x$cpuspeed = x ] || [ $cpuspeed = 0 ]; then
echo "unknown";
else
echo pc$cpuspeed;
fi
#!/bin/sh
# This interface should only DHCP if this node is a pc850
if [ `/etc/testbed/nodetype` = 'pc850' ]; then
dhcp_interfaces="$dhcp_interfaces fxp0";
fi
#!/bin/sh
# This interface should only DHCP if this node is a pc600
if [ `/etc/testbed/nodetype` = 'pc600' ]; then
dhcp_interfaces="$dhcp_interfaces fxp4";
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment