Commit ff2335dd authored by Mike Hibler's avatar Mike Hibler
Browse files

1. Better control net detection.

   No longer rely on looking at kernel boot time messages and extracting
   a hardware signature to determine the nodetype to then determine the
   control net.  Now we just DHCP on all interfaces and decree that the
   interface that answers is our control net interface.

   An extraordinary number of sleezy tricks were needed to get FBSD4,
   FBSD5, and RHL to DHCP on all interfaces without changing any standard
   scripts.

   For now, the nodetype/cpuspeed/chipset scripts still exist for the
   benefit of healthd, which uses the output of nodetype to determine
   what kernel module to load.  We should fix this.

   Side-effect: pump, the old RHL DHCP client, is history!  For older
   RHL releases, you will need a version of dhclient.

   Side-effect: in Linux, all non-control net interfaces are left up
   but without a legit IP address.  This is a consequence of dhclient.
   In FBSD, it was trivial to clean this up, RHL will take a little
   more work.  Up or down, it shouldn't matter.

2. Add an mfs-install make target, a scaled-down version of the client
   install.  Added a mandatory DESTDIR check so you don't accidentally
   install in the wrong place on boss.
parent 9371ad97
......@@ -93,6 +93,11 @@ install: $(INSTALL_SBINDIR)/tmcd \
client-install: client
@$(MAKE) -C $(MDSUBDIR) install
mfs: client
mfs-install: mfs
@$(MAKE) -C $(MDSUBDIR) mfs-install
$(INSTALL_BINDIR)/tmcd/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_BINDIR)/tmcd
......
......@@ -41,19 +41,21 @@ INSTALL = /usr/bin/install -c
injail: $(SRCDIR)/jail/injail.c
$(CC) $(CFLAGS) -O2 -o injail $<
destdircheck:
@if [ -z "$(DESTDIR)" ]; then \
echo "You must define DESTDIR for this target!"; \
false; \
fi
install client-install: common-install etc-install \
sup-install script-install bin-install jail-install
@echo "Remember to install the PEM files if necessary"
mfs-install: common-install etc-install \
mfs-install: destdircheck common-install etc-install \
script-install bin-install
cp $(SRCDIR)/mfs-rc.conf $(SYSETCDIR)/rc.conf
echo >$(ISMFS) "This file indicates its the MFS. DO NOT DELETE!"
destdircheck:
@if [ -z "$(DESTDIR)" ]; then \
echo "You must define DESTDIR for this target!"; \
false; \
@if [ ! -f $(ISMFS) ]; then \
echo >$(ISMFS) "This file indicates its the MFS. DO NOT DELETE!"; \
fi
cdboot-install: destdircheck common-install etc-install \
......@@ -133,11 +135,6 @@ sysetc-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
$(SYSETCDIR)/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp0 $(SYSETCDIR)/start_if.fxp0
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp1 $(SYSETCDIR)/start_if.fxp1
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp4 $(SYSETCDIR)/start_if.fxp4
$(INSTALL) -m 755 $(SRCDIR)/start_if.xl0 $(SYSETCDIR)/start_if.xl0
$(INSTALL) -m 755 $(SRCDIR)/start_if.em0 $(SYSETCDIR)/start_if.em0
$(INSTALL) -m 755 $(SRCDIR)/periodic.conf $(SYSETCDIR)/periodic.conf
$(INSTALL) -m 755 $(SRCDIR)/testbed.sh $(RCDIR)/testbed.sh
$(INSTALL) -m 755 $(SRCDIR)/elvind.sh $(RCDIR)/elvind.sh
......@@ -152,14 +149,14 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/rc.kname $(BINDIR)/rc/rc.kname
$(INSTALL) -m 755 $(SRCDIR)/rc.mfs $(BINDIR)/rc/rc.mfs
$(INSTALL) -m 755 ./sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 $(SRCDIR)/dhclient $(BINDIR)/dhclient
$(INSTALL) -m 755 $(SRCDIR)/nodetype $(BINDIR)/nodetype
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
$(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown
$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
$(INSTALL) -m 755 $(SRCDIR)/mkextrafs.pl $(BINDIR)/mkextrafs.pl
$(INSTALL) -m 755 $(SRCDIR)/control_interface \
$(BINDIR)/control_interface
$(INSTALL) -m 755 $(SRCDIR)/control_interface $(BINDIR)/control_interface
sfs-install:
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs
......
......@@ -7,31 +7,8 @@
. /etc/emulab/paths.sh
if [ -r $BOOTDIR/control_interface ]; then
cat $BOOTDIR/control_interface
if [ -r $BOOTDIR/controlif ]; then
cat $BOOTDIR/controlif
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
echo 'unknown'
fi
#!/bin/sh
#
# Ignore interfaces passed in and just dhcp on all of them.
# Since we are invoked by telling rc.conf to DHCP on lo0, we must
# also correctly reset lo0's state.
#
ifconfig lo0 down
ifconfig lo0 inet 127.0.0.1
/sbin/dhclient $flags
exit $?
......@@ -20,7 +20,7 @@ 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
echo $interface > $BOOTDIR/controlif
fi
#
......
......@@ -9,6 +9,16 @@ blanktime="NO"
update_motd="NO"
ntpdate_enable="YES"
ntpdate_flags="boss.emulab.net"
ntpdate_flags="boss"
nfs_client_enable="YES"
#
# Tricks to for DHCP on all interfaces.
# Specify a DHCP for lo0 to force rc.network to call the
# dhcp_program. That program is a script of ours which invokes the
# real dhclient with all interfaces (no args) and properly configure lo0.
#
network_interfaces="lo0"
ifconfig_lo0="DHCP"
dhcp_program="/usr/local/etc/emulab/dhclient"
......@@ -208,3 +208,4 @@ foreach my $file (@DEADFILES) {
warn("*** could not remove $BINDIR/$file\n");
}
}
system("rm -f /etc/start_if*");
# -- 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.
......@@ -10,9 +7,9 @@ sshd_enable="YES"
nfs_client_flags="-n 8"
# For SFS/Jails
portmap_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 8"
nfs_bufpackets="24"
xntpd_enable="YES"
xntpd_program="/usr/local/etc/emulab/ntpstart"
......@@ -22,3 +19,13 @@ ntpdate_flags="boss"
# no displays
blanktime="NO"
#
# Tricks to for DHCP on all interfaces.
# Specify a DHCP for lo0 to force rc.network to call the
# dhcp_program. That program is a script of ours which invokes the
# real dhclient with all interfaces (no args) and properly configure lo0.
#
network_interfaces="lo0"
ifconfig_lo0="DHCP"
dhcp_program="/usr/local/etc/emulab/dhclient"
#!/bin/sh
. /etc/emulab/paths.sh
if [ `$BINDIR/control_interface` = 'em0' ]; then
dhcp_interfaces="$dhcp_interfaces em0";
fi
#!/bin/sh
. /etc/emulab/paths.sh
if [ `$BINDIR/control_interface` = 'fxp0' ]; then
dhcp_interfaces="$dhcp_interfaces fxp0";
fi
#!/bin/sh
. /etc/emulab/paths.sh
if [ `$BINDIR/control_interface` = 'fxp1' ]; then
dhcp_interfaces="$dhcp_interfaces fxp1";
fi
#!/bin/sh
. /etc/emulab/paths.sh
if [ `$BINDIR/control_interface` = 'fxp4' ]; then
dhcp_interfaces="$dhcp_interfaces fxp4";
fi
#!/bin/sh
. /etc/emulab/paths.sh
if [ `$BINDIR/control_interface` = 'xl0' ]; then
dhcp_interfaces="$dhcp_interfaces xl0";
fi
......@@ -24,7 +24,7 @@ SCRIPTS = sethostname sethostname.dhclient
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: pump.conf supfile $(SCRIPTS)
all: supfile $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -85,21 +85,12 @@ etc-install: dir-install sysetc-remove sysetc-install
$(INSTALL) -m 600 $(SRCDIR)/gshadow $(ETCDIR)/gshadow
$(INSTALL) -m 644 $(SRCDIR)/hosts $(ETCDIR)/hosts
sysetc-install: dir-install pump.conf
$(INSTALL) -m 644 ./pump.conf $(SYSETCDIR)/pump.conf
sysetc-install: dir-install ifcfgs
$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks $(SYSETCDIR)/dhclient-enter-hooks
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks $(SYSETCDIR)/dhclient-exit-hooks
$(INSTALL) -m 644 $(SRCDIR)/modules.conf $(SYSETCDIR)/modules.conf
$(INSTALL) -m 755 $(SRCDIR)/ifcfg-eth0 \
$(SYSETCDIR)/sysconfig/network-scripts/ifcfg-eth0
$(INSTALL) -m 755 $(SRCDIR)/ifcfg-eth1 \
$(SYSETCDIR)/sysconfig/network-scripts/ifcfg-eth1
$(INSTALL) -m 755 $(SRCDIR)/ifcfg-eth2 \
$(SYSETCDIR)/sysconfig/network-scripts/ifcfg-eth2
$(INSTALL) -m 755 $(SRCDIR)/ifcfg-eth3 \
$(SYSETCDIR)/sysconfig/network-scripts/ifcfg-eth3
$(INSTALL) -m 755 $(SRCDIR)/ifcfg-eth4 \
$(SYSETCDIR)/sysconfig/network-scripts/ifcfg-eth4
$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc3.d/S96testbed
......@@ -126,22 +117,19 @@ sysetc-remove:
script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/rc.linux $(BINDIR)/rc/rc.linux
$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/ixpboot $(BINDIR)/ixpboot
$(INSTALL) -m 755 $(SRCDIR)/rc.ixp $(BINDIR)/rc/rc.ixp
$(INSTALL) -m 755 ./sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 ./sethostname.dhclient $(BINDIR)/sethostname.dhclient
$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(BINDIR)/rc/rc.healthd
$(INSTALL) -m 755 $(SRCDIR)/healthd.conf $(BINDIR)/healthd.conf
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
$(INSTALL) -m 755 $(SRCDIR)/nodetype $(BINDIR)/nodetype
$(INSTALL) -m 755 $(SRCDIR)/mkextrafs.pl $(BINDIR)/mkextrafs.pl
$(INSTALL) -m 755 $(SRCDIR)/control_interface \
$(BINDIR)/control_interface
$(INSTALL) -m 755 $(SRCDIR)/control_interface $(BINDIR)/control_interface
$(INSTALL) -m 755 $(SRCDIR)/nodetype $(BINDIR)/nodetype
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
sfs-install:
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs
......@@ -155,3 +143,7 @@ sfs-install:
$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/root
$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/var
$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/usr
# create ifcfg-eth? files
ifcfgs: $(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
$(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
......@@ -7,25 +7,8 @@
. /etc/emulab/paths.sh
if [ -r $BOOTDIR/control_interface ]; then
cat $BOOTDIR/control_interface
if [ -r $BOOTDIR/controlif ]; then
cat $BOOTDIR/controlif
else
NODETYPE=`$BINDIR/nodetype`
case $NODETYPE in
pc300|pc1500|pc2000|pc3000|pc2400-orbit|pc733|pcL440GX)
echo 'eth0'
;;
i2|pc2400-aero)
echo 'eth1'
;;
pc850)
echo 'eth2'
;;
pc600|pc850a)
echo 'eth4'
;;
*)
echo 'unknown'
;;
esac
echo 'unknown'
fi
......@@ -25,7 +25,7 @@ if [ x$reason = xREBOOT ] || [ x$reason = xBOUND ] || \
echo $new_ip_address > $BOOTDIR/myip
echo $new_subnet_mask > $BOOTDIR/mynetmask
if [ -n "$interface" ]; then
echo $interface > $BOOTDIR/control_interface
echo $interface > $BOOTDIR/controlif
fi
#
......
DEVICE="eth1"
. /etc/emulab/paths.sh
if [ "`control_interface`" = "$DEVICE" ]; then
BOOTPROTO="dhcp"
ONBOOT="yes"
else
ONBOOT="no"
fi
IPADDR=""
NETMASK=""
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
DEVICE="eth2"
. /etc/emulab/paths.sh
if [ "`control_interface`" = "$DEVICE" ]; then
BOOTPROTO="dhcp"
ONBOOT="yes"
else
ONBOOT="no"
fi
IPADDR=""
NETMASK=""
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
DEVICE="eth3"
. /etc/emulab/paths.sh
if [ "`control_interface`" = "$DEVICE" ]; then
BOOTPROTO="dhcp"
ONBOOT="yes"
else
ONBOOT="no"
fi
IPADDR=""
NETMASK=""
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
DEVICE="eth4"
. /etc/emulab/paths.sh
if [ "`control_interface`" = "$DEVICE" ]; then
BOOTPROTO="dhcp"
ONBOOT="yes"
else
ONBOOT="no"
fi
IPADDR=""
NETMASK=""
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
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