Commit 1b09c71e authored by Mike Hibler's avatar Mike Hibler

Mike's latest flaming hack to deal with the latest in DHCP issues:

figuring out how to cope with the new dhclient in FreeBSD 6 and above which
only handles a single interface.
parent 34c6e5b9
......@@ -2310,6 +2310,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/linux-sg/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile \
tmcd/freebsd6/netif-emulab \
tmcd/cygwinxp/GNUmakefile \
tmcd/openbsd/GNUmakefile tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
......
......@@ -748,6 +748,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/linux-sg/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile \
tmcd/freebsd6/netif-emulab \
tmcd/cygwinxp/GNUmakefile \
tmcd/openbsd/GNUmakefile tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
......
......@@ -46,12 +46,8 @@ endif
endif
ifeq ($(SYSTEM),FreeBSD)
FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/')
ifeq ($(FBSDVERSION),FreeBSD5)
MDSUBDIR = freebsd5
else
MDSUBDIR = freebsd
endif
FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/freebsd\1/')
MDSUBDIR = $(FBSDVERSION)
endif
ifeq ($(SYSTEM),CYGWIN_NT-5.1)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
#
# XXX ONLY RUN THIS INSTALL ON A FREEBSD 6 TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = tmcd/freebsd6
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: supfile netif-emulab $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
SYSETCDIR = $(DESTDIR)/etc
JAILDIR = $(SYSETCDIR)/jail
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(DESTDIR)/usr/local/etc/rc.d
ISMFS = $(ETCDIR)/ismfs
INSTALL = /usr/bin/install -c
install client-install: basefbsd-install etc-install \
sup-install script-install bin-install
simple-install: script-install bin-install
dir-install:
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/rc.d
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/rc.conf.d
$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/db
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/jails
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/logs
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/sup
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/boot
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/lock
-rm -rf $(DESTDIR)/etc/testbed
ln -s emulab $(DESTDIR)/etc/testbed
-rm -rf $(DESTDIR)/usr/local/etc/testbed
ln -s emulab $(DESTDIR)/usr/local/etc/testbed
basefbsd-install: dir-install
(cd ../freebsd5; $(MAKE) all install)
rm -f $(SYSETCDIR)/rc.conf.d/dhclient
sup-install: dir-install supfile
$(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile
bin-install: dir-install
etc-install: dir-install sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(ETCDIR)/master.passwd
sysetc-install: dir-install netif-emulab
$(INSTALL) -m 444 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 555 ./netif-emulab $(SYSETCDIR)/rc.d/netif-emulab
script-install: dir-install
# $(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
# $FreeBSD: src/etc/group,v 1.32 2005/06/06 20:19:56 brooks Exp $
#
wheel:*:0:root,toor
daemon:*:1:
kmem:*:2:root,toor
sys:*:3:root,toor
tty:*:4:root,toor
operator:*:5:root,toor
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
staff:*:20:root,toor
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
guest:*:31:root,toor
bind:*:53:
proxy:*:62:
authpf:*:63:
_pflogd:*:64:
_dhcp:*:65:
uucp:*:66:
dialer:*:68:
network:*:69:
sfs:*:77:
www:*:80:
nogroup:*:65533:
nobody:*:65534:
# $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $
#
root:kEi.I6fTKyJDg:0:0::0:0:Charlie &:/root:/bin/csh
toor:kEi.I6fTKyJDg:0:0::0:0:Chaplin &:/root:/bin/csh
daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/usr/games:/usr/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
sfs:*:77:77::0:0:SFS pseudo-user:/:/usr/sbin/nologin
www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
#
# Emulab version of netif to DHCP on all interfaces simultaneously.
# Runs before the standard netif, and effectively neuters that script.
# Note the dependencies below. Every script that declares that it must run
# BEFORE netif is listed as a REQUIRE here so that we are properly ordered
# w.r.t. those scripts.
#
# PROVIDE: netif-emulab
# REQUIRE: atm1 ipfilter mountcritlocal pccard serial sppp sysctl
# REQUIRE: adjkerntz hostname ipfs ipnat kldxref random
# BEFORE: netif
# KEYWORD: nojail
. /etc/rc.subr
. /etc/network.subr
name="netif-emulab"
start_cmd="cnet_start"
stop_cmd="cnet_stop"
_cmdifn=
# this is a separate function so we can redirect all the output below
cnet_dhcp()
{
#
# Argh! FreeBSD >= 6 has rewritten dhclient and it no longer takes
# the -i option. So we remove that option here.
#
dhclient_flags=`echo $dhclient_flags | sed -e 's/-i [0-9][0-9]*//'`
for _if in $*; do
${dhclient_program} ${dhclient_flags} $_if &
done
wait
}
cnet_start()
{
rm -f @CLIENT_VARDIR@/boot/controlif
# Find all the relevant networks IFs.
_ifs=""
network_interfaces=`ifconfig -l | sed -e 's/lo0//'`
for _if in $network_interfaces; do
case $_if in
lo*|gif*|faith*|tun*|plip*)
;;
*)
_ifs="$_ifs $_if"
;;
esac
done
echo "Emulab looking for control net among: $_ifs ..."
cnet_dhcp $_ifs >@CLIENT_VARDIR@/logs/netif-emulab.log 2>&1
if [ -e @CLIENT_VARDIR@/boot/controlif ]; then
echo "Emulab control net is `cat @CLIENT_VARDIR@/boot/controlif`"
else
echo "*** No Emulab control net found!"
fi
}
cnet_stop()
{
rm -f @CLIENT_VARDIR@/boot/controlif
}
load_rc_config $name
run_rc_command $*
sendmail_enable="NO"
sshd_enable="YES"
nfs_client_enable="YES"
nfs_client_flags="-n 8"
# For SFS/Jails
rpcbind_enable="YES"
mountd_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 8"
# Emulab ntp configuration
# ntpstart will take care of running ntpdate, so leave it disabled
ntpd_enable="YES"
ntpd_program="/usr/local/etc/emulab/ntpstart"
ntpd_flags="/usr/sbin/ntpd -p /var/run/ntpd.pid"
# no displays
blanktime="NO"
# no dump by default
dumpdev="NO"
rc_info="YES"
#
# FreeBSD has no way to say "DHCP on all available interfaces" without
# spelling out here what all those interfaces are. So here we just say
# to (statically) configure the loopback device. The real network
# interfaces are identified in rc.conf.d/dhclient for use by the
# rc.d/dhclient script.
#
# FreeBSD >= 6 has changed things yet again. Now, the rc.d/dhclient script
# expects to be called with an interface argument and apparently is not
# intended to be used as part of the default /etc/rc bootup. Instead, it
# is called manually from rc.d/netif for each interface. So we now hook
# that script via rc.conf.d/netif and run dhclient on all interfaces from
# there.
#
network_interfaces="lo0"
#
# Argh! dhclient in FreeBSD 5 has a new auto-background "feature",
# it dives into the background after 10 seconds regardless of whether
# it has received a response. This is fubar for us. Unfortunately,
# we cannot just crank this number through the roof because it is based
# on a polling interval which actually has a rational purpose. The timeout
# is actually (2 * polling_interval) where polling_interval is how often
# dhclient rechecks an interface without link. We need to keep this value
# reasonable in the event that we boot up and don't immediately have link
# on the control net. So lets try 15 seconds (30 second auto-background
# timeout) and see how things go.
#
dhclient_flags="-i 15"
#
# Bump as needed.
#
FBSD60-STD base=@CLIENT_VARDIR@ prefix=/ preserve release=20060105
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