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

More Stupid Script Tricks to DHCP on all interfaces without modifying

standard scripts.  The current FreeBSD 5 image uses this.
parent 1e7ba41c
......@@ -62,6 +62,9 @@ cdboot-install: destdircheck basefbsdcdboot-install etc-install \
simple-install: script-install bin-install # jail-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)
......@@ -94,11 +97,11 @@ etc-install: dir-install sysetc-install
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(ETCDIR)/master.passwd
sysetc-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 444 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 444 $(SRCDIR)/rc.dhclient $(SYSETCDIR)/rc.conf.d/dhclient
script-install: dir-install
# $(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/dhclient $(BINDIR)/dhclient
jail-install: dir-install
$(INSTALL) -m 755 -o root -g wheel -d $(JAILDIR)
......
#!/bin/sh
. /etc/emulab/paths.sh
trap 'exit 0' 15
echo $* >> /tmp/dh
cnet=`$BINDIR/control_interface`
if [ -z "$cnet" ]; then
echo "WARNING: unknown control net interface, DHCP on all..."
/sbin/dhclient
else
/sbin/dhclient $cnet
fi
exit 0
......@@ -15,18 +15,16 @@ ntpd_enable="YES"
ntpd_program="/usr/local/etc/emulab/ntpstart"
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.
# 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"
# no displays
blanktime="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.
#
network_interfaces="lo0"
#
# In rc.conf, we have told it to just to configure lo0. Then when the
# rc.d/dhclient script is executed, it sources this (/etc/rc.conf.d/dhclient)
# file where we identify all the actual interfaces and mark them as
# DHCPable.
#
# We do this work here rather than directly in rc.conf because rc.conf
# is sourced by every startup rc file and even some periodic scripts.
# No point in doing all this work a million times for no reason.
#
network_interfaces=`ifconfig -l | sed -e 's/lo0//'`
for _if in $network_interfaces; do
eval ifconfig_${_if}="DHCP"
done
Supports Markdown
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