Commit 16c1bc02 authored by Mike Hibler's avatar Mike Hibler

Prep work for DHCP discovery of control net interface:

- have pump/dhclient script record the DHCP'ed interface in
  /var/emulab/boot/control_interface

- change control_interface script to first check for that file
  and use the contents if it exists

Note that, as of this commit, we are still telling pump/dhclient which
interface to DHCP on (i.e., we still determine the control net interface
the old way to invoke pump/dhclient) so this commit is not that useful.

What still has to be done is to change the startup to invoke dhclient/pump
on all interfaces.  This turns out to be a royal, royal PITA.

Stay tuned...
parent 63b02309
......@@ -7,27 +7,31 @@
. /etc/emulab/paths.sh
NODETYPE=`$BINDIR/nodetype`
case $NODETYPE in
pc300|pc733|pc850|i2|pc1800)
echo 'fxp0'
;;
pcL440GX)
echo 'fxp1'
;;
pc600|pc850a)
echo 'fxp4'
;;
pc1500|pc2000)
echo 'xl0'
;;
pc2400-aero)
echo 'em0'
;;
pc3000|pc2400-orbit)
echo 'fxp0'
;;
*)
echo 'unknown';
;;
esac
if [ -r $BOOTDIR/control_interface ]; then
cat $BOOTDIR/control_interface
else
NODETYPE=`$BINDIR/nodetype`
case $NODETYPE in
pc300|pc733|pc850|i2|pc1800)
echo 'fxp0'
;;
pcL440GX)
echo 'fxp1'
;;
pc600|pc850a)
echo 'fxp4'
;;
pc1500|pc2000)
echo 'xl0'
;;
pc3000|pc2400-aero)
echo 'em0'
;;
pc2400-orbit)
echo 'fxp0'
;;
*)
echo 'unknown'
;;
esac
fi
......@@ -16,6 +16,9 @@ then
echo $new_routers > $BOOTDIR/routerip
echo $new_ip_address > $BOOTDIR/myip
echo $new_subnet_mask > $BOOTDIR/mynetmask
if [ -n "$interface" ]; then
echo $interface > $BOOTDIR/control_interface
fi
fi
#
......@@ -25,7 +28,7 @@ fi
#
if [ -x $BINDIR/sethostname ]
then
$BINDIR/sethostname $new_domain_name >$LOGDIR/dhclient.log 2>&1
$BINDIR/sethostname $new_domain_name >$LOGDIR/dhclient.log 2>&1
fi
#
......
# -- sysinstall generated deltas -- #
# Created: Wed Jun 13 16:59:03 2001
# Enable network daemons for user convenience.
# This file now contains just the overrides from /etc/defaults/rc.conf
# please make all changes to this file.
sendmail_enable="NO"
sshd_enable="YES"
nfs_client_enable="YES"
......@@ -15,7 +8,6 @@ rpcbind_enable="YES"
mountd_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 8"
nfs_bufpackets="24"
# Emulab ntp configuration
# ntpstart will take care of running ntpdate, so leave it disabled
......@@ -26,13 +18,15 @@ ntpd_flags="/usr/sbin/ntpd -p /var/run/ntpd.pid"
rc_info="YES"
# Bah! Need to list all possible DHCP'able interfaces to keep
# new scripts from trying to statically configure them
# new scripts from trying to statically configure them.
# As with FreeBSD 4.x, there is no way to easily say DHCP on everything.
ifconfig_em0="DHCP"
ifconfig_fxp0="DHCP"
ifconfig_fxp1="DHCP"
ifconfig_fxp2="DHCP"
ifconfig_fxp3="DHCP"
ifconfig_fxp4="DHCP"
ifconfig_xl0="DHCP"
dhclient_program="/usr/local/etc/emulab/dhclient"
# no displays
blanktime="NO"
......@@ -7,21 +7,25 @@
. /etc/emulab/paths.sh
NODETYPE=`$BINDIR/nodetype`
case $NODETYPE in
pc300|pc1500|pc2000|pc3000|pc2400-aero|pc2400-orbit|pc733|pcL440GX)
echo 'eth0'
;;
i2)
echo 'eth1'
;;
pc850)
echo 'eth2'
;;
pc600|pc850a)
echo 'eth4'
;;
*)
echo 'unknown';
;;
esac
if [ -r $BOOTDIR/control_interface ]; then
cat $BOOTDIR/control_interface
else
NODETYPE=`$BINDIR/nodetype`
case $NODETYPE in
pc300|pc1500|pc2000|pc3000|pc2400-aero|pc2400-orbit|pc733|pcL440GX)
echo 'eth0'
;;
i2)
echo 'eth1'
;;
pc850)
echo 'eth2'
;;
pc600|pc850a)
echo 'eth4'
;;
*)
echo 'unknown'
;;
esac
fi
......@@ -11,7 +11,7 @@
# We maintain/install both variants though to make life easier.
#
date >> $LOGDIR/dhclient.log
date > $LOGDIR/dhclient.log
echo "$reason" >> $LOGDIR/dhclient.log
#
......@@ -24,19 +24,14 @@ if [ x$reason = xREBOOT ] || [ x$reason = xBOUND ] || \
echo $new_routers > $BOOTDIR/routerip
echo $new_ip_address > $BOOTDIR/myip
echo $new_subnet_mask > $BOOTDIR/mynetmask
if [ -n "$interface" ]; then
echo $interface > $BOOTDIR/control_interface
fi
#
# See if the Testbed configuration software wants to change the hostname.
#
$BINDIR/sethostname.dhclient >>$LOGDIR/dhclient.log 2>&1
#
# Once we have an IP address, we can stop dhclient so that it doesn't get
# in the way
#
# I'd love to use the dhclient.pid file, but it helpfully has not been
# created at this point
#killall dhclient
fi
exit 0
......@@ -41,6 +41,8 @@ use libtmcc;
my ($action,$iface,$ip) = @ARGV;
open(STDERR, ">$LOGDIR/pump.log");
if (defined($action)) {
if ($action ne "up" && $action ne "renewal") {
exit 0;
......@@ -117,5 +119,11 @@ if (system("hostname", "${nickname}${domain}")) {
exit 1;
}
# stash off the interface name to use as our control net
if (defined($iface) && $iface =~ /^([-\w\.]+)$/) {
$iface = $1;
system("echo $iface > $BOOTDIR/control_interface");
}
print STDERR "Done!\n";
exit 0;
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