Commit 38bc8fa1 authored by Mike Hibler's avatar Mike Hibler

Preliminary support for Ubuntu Linux.

 * added new tmcd directory with Ubuntu (really, Debian) specifics
 * fixed up GNUmakefiles to not do "-g wheel" when creating directories
 * other, relatively minor tweaks
parent 6a8cb53b
...@@ -2502,7 +2502,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -2502,7 +2502,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux/sethostname.dhclient \ tmcd/linux/sethostname.dhclient \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \ tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/fedora/GNUmakefile tmcd/fedora/supfile \ tmcd/fedora/GNUmakefile tmcd/fedora/supfile \
tmcd/linux-sg/GNUmakefile \ tmcd/linux-sg/GNUmakefile tmcd/ubuntu7/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \ tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \ tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \
tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \ tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \
......
...@@ -882,7 +882,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -882,7 +882,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux/sethostname.dhclient \ tmcd/linux/sethostname.dhclient \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \ tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/fedora/GNUmakefile tmcd/fedora/supfile \ tmcd/fedora/GNUmakefile tmcd/fedora/supfile \
tmcd/linux-sg/GNUmakefile \ tmcd/linux-sg/GNUmakefile tmcd/ubuntu7/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \ tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \ tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \
tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \ tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \
......
#!/usr/bin/perl -w -T #!/usr/bin/perl -w -T
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group. # Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -2679,8 +2679,7 @@ sub TimeStamp() ...@@ -2679,8 +2679,7 @@ sub TimeStamp()
sub PATH_NICE() sub PATH_NICE()
{ {
if ($platform eq LINUX) { return "/bin/nice" if (-x "/bin/nice");
return "/bin/nice"; return "/usr/bin/nice" if (-x "/usr/bin/nice");
} return "nice";
return "/usr/bin/nice";
} }
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group. # Copyright (c) 2000-2004, 2006, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -63,7 +63,7 @@ real-client: all ...@@ -63,7 +63,7 @@ real-client: all
real-client-install: real-client-install:
cp -p $(INSTALL_FILES) $(DESTDIR)$(CLIENT_BINDIR) cp -p $(INSTALL_FILES) $(DESTDIR)$(CLIENT_BINDIR)
if [ -x $(INSTALL_NSE) ]; then \ if [ -x $(INSTALL_NSE) ]; then \
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/usr/local/bin; \ $(INSTALL) -m 755 -o root -d $(DESTDIR)/usr/local/bin; \
cp -p $(INSTALL_NSE) $(DESTDIR)/usr/local/bin; \ cp -p $(INSTALL_NSE) $(DESTDIR)/usr/local/bin; \
fi fi
......
...@@ -45,7 +45,7 @@ endif ...@@ -45,7 +45,7 @@ endif
$(MAKE) -C genhostsfile client $(MAKE) -C genhostsfile client
client-install: client client-install: client
$(INSTALL) -m 755 -o root -g wheel -d $(LBINDIR) -mkdir -p $(LBINDIR)
$(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile $(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile
-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)/man1 -mkdir -p $(DESTDIR)$(CLIENT_MANDIR)/man1
$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/install-tarfile.1 $(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/install-tarfile.1
...@@ -83,7 +83,7 @@ cdboot-install: mfs-install frisbee-mfs ...@@ -83,7 +83,7 @@ cdboot-install: mfs-install frisbee-mfs
$(MAKE) -e -C growdisk client-install $(MAKE) -e -C growdisk client-install
remote-install: remote-install:
$(INSTALL) -m 755 -o root -g wheel -d $(LBINDIR) -mkdir -p $(LBINDIR)
$(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile $(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile
$(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm $(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm
......
...@@ -185,7 +185,7 @@ install: $(INSTALL_BINDIR)/imagezip $(INSTALL_BINDIR)/imageunzip $(INSTALL_BINDI ...@@ -185,7 +185,7 @@ install: $(INSTALL_BINDIR)/imagezip $(INSTALL_BINDIR)/imageunzip $(INSTALL_BINDI
client: all client: all
client-install: client client-install: client
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/usr/local/bin $(INSTALL) -m 755 -o root -d $(DESTDIR)/usr/local/bin
$(INSTALL_PROGRAM) -s imagezip$(EXE) $(DESTDIR)/usr/local/bin/imagezip$(EXE) $(INSTALL_PROGRAM) -s imagezip$(EXE) $(DESTDIR)/usr/local/bin/imagezip$(EXE)
$(INSTALL_PROGRAM) -s imageunzip$(EXE) $(DESTDIR)/usr/local/bin/imageunzip$(EXE) $(INSTALL_PROGRAM) -s imageunzip$(EXE) $(DESTDIR)/usr/local/bin/imageunzip$(EXE)
$(INSTALL_PROGRAM) -s imagedump$(EXE) $(DESTDIR)/usr/local/bin/imagedump$(EXE) $(INSTALL_PROGRAM) -s imagedump$(EXE) $(DESTDIR)/usr/local/bin/imagedump$(EXE)
......
...@@ -43,7 +43,7 @@ client: all ...@@ -43,7 +43,7 @@ client: all
client-install: client client-install: client
$(INSTALL_PROGRAM) emulab-syncd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-syncd$(EXE) $(INSTALL_PROGRAM) emulab-syncd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-syncd$(EXE)
$(INSTALL_PROGRAM) emulab-sync$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-sync$(EXE) $(INSTALL_PROGRAM) emulab-sync$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-sync$(EXE)
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)$(CLIENT_MANDIR)/man1 $(INSTALL) -m 755 -o root -d $(DESTDIR)$(CLIENT_MANDIR)/man1
$(INSTALL_DATA) $(SRCDIR)/emulab-syncd.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-syncd.1 $(INSTALL_DATA) $(SRCDIR)/emulab-syncd.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-syncd.1
$(INSTALL_DATA) $(SRCDIR)/emulab-sync.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-sync.1 $(INSTALL_DATA) $(SRCDIR)/emulab-sync.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-sync.1
......
...@@ -9,7 +9,7 @@ EVENTSYS = @EVENTSYS@ ...@@ -9,7 +9,7 @@ EVENTSYS = @EVENTSYS@
OBJDIR = .. OBJDIR = ..
SUBDIR = tmcd SUBDIR = tmcd
SYSTEM := $(shell uname -s) SYSTEM := $(shell $(TESTBED_SRCDIR)/utils/osstuff.sh -o)
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
...@@ -36,10 +36,6 @@ TMLIBS += -lssl -lcrypto ...@@ -36,10 +36,6 @@ TMLIBS += -lssl -lcrypto
SSLOBJ = ssl.o SSLOBJ = ssl.o
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
RHLVERSION := $(shell cat /etc/redhat-release | sed -e 's/Red Hat Linux release \([0-9]\).*/Linux\1/')
ifeq ($(RHLVERSION),)
RHLVERSION := $(shell cat /etc/redhat-release | sed -e 's/Fedora Core release \([0-9]\).*/Fedora\1/')
endif
ifneq ($(LDSTATIC),) ifneq ($(LDSTATIC),)
NOKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NOKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
else else
...@@ -53,34 +49,46 @@ TMLIBS += -lkrb5support ...@@ -53,34 +49,46 @@ TMLIBS += -lkrb5support
endif endif
endif endif
TMLIBS += -ldl TMLIBS += -ldl
ifeq ($(findstring Fedora,$(RHLVERSION)),Fedora) endif
MDSUBDIR = fedora
else #
ifeq ($(RHLVERSION),Linux9) # Take care of historic naming fubars:
MDSUBDIR = linux9 # Redhat 7.x -> linux
else # Redhat 9.0 -> linux9
# Fedora 4/6 -> fedora
# Stargate 1 -> linux-sg
# FreeBSD 4.x -> freebsd
# Windows XP -> cygwinxp
#
MDSUBDIR := $(shell $(TESTBED_SRCDIR)/utils/osstuff.sh -t)
ifeq ($(SYSTEM),Linux)
ifeq ($(MDSUBDIR),redhat7)
MDSUBDIR = linux MDSUBDIR = linux
endif endif
ifeq ($(MDSUBDIR),redhat9)
MDSUBDIR = linux9
endif
ifeq ($(findstring fedora,$(MDSUBDIR)),fedora)
MDSUBDIR = fedora
endif
ifeq ($(MDSUBDIR),stargate1)
MDSUBDIR = linux-sg
endif endif
endif endif
ifeq ($(SYSTEM),FreeBSD) ifeq ($(SYSTEM),FreeBSD)
FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/freebsd\1/') ifeq ($(MDSUBDIR),freebsd4)
ifeq ($(FBSDVERSION),freebsd4)
MDSUBDIR = freebsd MDSUBDIR = freebsd
else
MDSUBDIR = $(FBSDVERSION)
endif endif
endif endif
ifeq ($(SYSTEM),CYGWIN_NT-5.1) ifeq ($(SYSTEM),Cygwin)
# Cygwin on Windows XP (a.k.a. NT 5.1) - resembles the Linux case. # Cygwin on Windows XP (a.k.a. NT 5.1) - resembles the Linux case.
ifeq ($(MDSUBDIR),CYGWIN_NT-5.1)
MDSUBDIR = cygwinxp MDSUBDIR = cygwinxp
TMSLIBS += -lminires TMSLIBS += -lminires
endif endif
ifeq ($(host_cpu),arm)
MDSUBDIR = linux-sg
endif endif
ifeq ($(EVENTSYS),1) ifeq ($(EVENTSYS),1)
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group. # Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -50,16 +50,16 @@ other-install: ...@@ -50,16 +50,16 @@ other-install:
(cd ../../tools; $(MAKE) DESTDIR=$(DESTDIR) client-install) (cd ../../tools; $(MAKE) DESTDIR=$(DESTDIR) client-install)
dir-install: dir-install:
$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR) $(INSTALL) -m 755 -o root -d $(ETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR) $(INSTALL) -m 755 -o root -d $(BINDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR) $(INSTALL) -m 755 -o root -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR) $(INSTALL) -m 755 -o root -d $(VARDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/db $(INSTALL) -m 755 -o root -d $(VARDIR)/db
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/jails $(INSTALL) -m 755 -o root -d $(VARDIR)/jails
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/logs $(INSTALL) -m 755 -o root -d $(VARDIR)/logs
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/boot $(INSTALL) -m 755 -o root -d $(VARDIR)/boot
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/lock $(INSTALL) -m 755 -o root -d $(VARDIR)/lock
$(INSTALL) -m 755 -o root -g wheel -d $(TBBINDIR) $(INSTALL) -m 755 -o root -d $(TBBINDIR)
path-install: dir-install path-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/paths.pm $(ETCDIR)/paths.pm $(INSTALL) -m 755 $(SRCDIR)/paths.pm $(ETCDIR)/paths.pm
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group. # Copyright (c) 2000-2004, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -77,8 +77,8 @@ sysetc-install: dir-install ###ifcfgs ...@@ -77,8 +77,8 @@ sysetc-install: dir-install ###ifcfgs
# Watchdog assumes the ssh keys are in /etc/ssh. # Watchdog assumes the ssh keys are in /etc/ssh.
ln -f -s /etc /etc/ssh ln -f -s /etc /etc/ssh
# Boot log files have to be writable by root under rc.cygwin . # Boot log files have to be writable by root under rc.cygwin .
$(INSTALL) -c -m 775 -o root -g wheel -d /var/log $(INSTALL) -c -m 775 -o root -d /var/log
$(INSTALL) -c -m 775 -o root -g wheel -d /var/db $(INSTALL) -c -m 775 -o root -d /var/db
# Need an /etc/shells file for rc.acounts. # Need an /etc/shells file for rc.acounts.
$(INSTALL) -m 755 $(SRCDIR)/shells /etc/shells $(INSTALL) -m 755 $(SRCDIR)/shells /etc/shells
...@@ -89,7 +89,7 @@ script-install: dir-install $(SCRIPTS) ...@@ -89,7 +89,7 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm $(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare $(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown $(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown
$(INSTALL) -c -m 755 -o root -g wheel -d /sbin $(INSTALL) -c -m 755 -o root -d /sbin
$(INSTALL) -m 755 $(SRCDIR)/reboot /sbin/reboot $(INSTALL) -m 755 $(SRCDIR)/reboot /sbin/reboot
# Put the tcsh desktop startup script in the CygWin root directory. # Put the tcsh desktop startup script in the CygWin root directory.
$(INSTALL) -m 755 $(SRCDIR)/cygwin-tcsh.bat / $(INSTALL) -m 755 $(SRCDIR)/cygwin-tcsh.bat /
......
...@@ -47,23 +47,23 @@ install client-install: common-install etc-install \ ...@@ -47,23 +47,23 @@ install client-install: common-install etc-install \
simple-install: common-install script-install bin-install simple-install: common-install script-install bin-install
dir-install: dir-install:
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR) $(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/sysconfig $(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/sysconfig
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/sysconfig/network-scripts $(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR) $(INSTALL) -m 755 -o root -g root -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/init.d $(INSTALL) -m 755 -o root -g root -d $(RCDIR)/init.d
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc1.d $(INSTALL) -m 755 -o root -g root -d $(RCDIR)/rc1.d
$(INSTALL) -m 755 -o root -g wheel -d $(DEFRUNLVLDIR) $(INSTALL) -m 755 -o root -g root -d $(DEFRUNLVLDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc6.d $(INSTALL) -m 755 -o root -g root -d $(RCDIR)/rc6.d
$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR) $(INSTALL) -m 755 -o root -g root -d $(ETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR) $(INSTALL) -m 755 -o root -g root -d $(BINDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR) $(INSTALL) -m 755 -o root -g root -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR) $(INSTALL) -m 755 -o root -g root -d $(VARDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/db $(INSTALL) -m 755 -o root -g root -d $(VARDIR)/db
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/jails $(INSTALL) -m 755 -o root -g root -d $(VARDIR)/jails
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/logs $(INSTALL) -m 755 -o root -g root -d $(VARDIR)/logs
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/sup $(INSTALL) -m 755 -o root -g root -d $(VARDIR)/sup
$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/boot $(INSTALL) -m 755 -o root -g root -d $(VARDIR)/boot
-rm -rf $(DESTDIR)/etc/testbed -rm -rf $(DESTDIR)/etc/testbed
ln -s emulab $(DESTDIR)/etc/testbed ln -s emulab $(DESTDIR)/etc/testbed
-rm -rf $(DESTDIR)/usr/local/etc/testbed -rm -rf $(DESTDIR)/usr/local/etc/testbed
...@@ -74,7 +74,7 @@ common-install: dir-install ...@@ -74,7 +74,7 @@ common-install: dir-install
sup-install: dir-install supfile sup-install: dir-install supfile
$(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile $(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile
$(INSTALL) -m 750 -o root -g wheel -d $(DESTDIR)/root/.cvsup $(INSTALL) -m 750 -o root -g root -d $(DESTDIR)/root/.cvsup
$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth $(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth
bin-install: dir-install bin-install: dir-install
...@@ -103,7 +103,7 @@ sysetc-install: dir-install ifcfgs ...@@ -103,7 +103,7 @@ sysetc-install: dir-install ifcfgs
$(INSTALL) -m 755 $(SRCDIR)/tbprepare $(RCDIR)/init.d/tbprepare $(INSTALL) -m 755 $(SRCDIR)/tbprepare $(RCDIR)/init.d/tbprepare
-ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc1.d/K89tbprepare -ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc1.d/K89tbprepare
-ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc6.d/K89tbprepare -ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc6.d/K89tbprepare
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/cron.pend $(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/cron.pend
if [ -e $(SYSETCDIR)/cron.daily/slocate.cron ]; then \ if [ -e $(SYSETCDIR)/cron.daily/slocate.cron ]; then \
mv -f $(SYSETCDIR)/cron.daily/slocate.cron \ mv -f $(SYSETCDIR)/cron.daily/slocate.cron \
$(SYSETCDIR)/cron.pend; \ $(SYSETCDIR)/cron.pend; \
...@@ -113,7 +113,9 @@ sysetc-install: dir-install ifcfgs ...@@ -113,7 +113,9 @@ sysetc-install: dir-install ifcfgs
$(SYSETCDIR)/cron.pend; \ $(SYSETCDIR)/cron.pend; \
fi fi
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local $(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local
-ln -sf $(RRCDIR)/rc.local $(SYSETCDIR)/rc.local if [ "$(RCDIR)" != "$(SYSETCDIR)" ]; then \
ln -sf $(RRCDIR)/rc.local $(SYSETCDIR)/rc.local; \
fi
sysetc-remove: sysetc-remove:
-rm -f $(RCDIR)/*/S95anacron $(RCDIR)/*/K05anacron -rm -f $(RCDIR)/*/S95anacron $(RCDIR)/*/K05anacron
...@@ -137,7 +139,7 @@ script-install: dir-install $(SCRIPTS) ...@@ -137,7 +139,7 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk $(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
sfs-install: sfs-install:
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs $(INSTALL) -m 755 -o root -g root -d $(DESTDIR)/etc/sfs
$(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/init.d/sfs $(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/init.d/sfs
-ln -sf $(RRCDIR)/init.d/nfs $(DEFRUNLVLDIR)/S20nfs -ln -sf $(RRCDIR)/init.d/nfs $(DEFRUNLVLDIR)/S20nfs
-ln -sf $(RRCDIR)/init.d/sfs $(RCDIR)/rc6.d/K19sfs -ln -sf $(RRCDIR)/init.d/sfs $(RCDIR)/rc6.d/K19sfs
......
#!/bin/sh #!/bin/sh
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group. # Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
. /etc/emulab/paths.sh . /etc/emulab/paths.sh
...@@ -55,7 +55,7 @@ if [ "$new_network_number" = "10.200.1.0" ]; then ...@@ -55,7 +55,7 @@ if [ "$new_network_number" = "10.200.1.0" ]; then
if `$BINDIR/tmcc bossinfo >/dev/null 2>&1`; then if `$BINDIR/tmcc bossinfo >/dev/null 2>&1`; then
break break
fi fi
echo "${interface}: waiting for DNS.." >>$LOGDIR/dhclient-exit.log 2>&1 echo "`date`: ${interface}: waiting for DNS.." >>$LOGDIR/dhclient-exit.log 2>&1
sleep $i sleep $i
done done
fi fi
...@@ -63,7 +63,7 @@ fi ...@@ -63,7 +63,7 @@ fi
# #
# See if the Testbed configuration software wants to change the hostname. # See if the Testbed configuration software wants to change the hostname.
# #
$BINDIR/sethostname.dhclient >$LOGDIR/dhclient.log 2>&1 $BINDIR/sethostname.dhclient >>$LOGDIR/dhclient.log 2>&1
echo "`date`: ${interface}: ${reason}: done" >>$LOGDIR/dhclient-exit.log 2>&1 echo "`date`: ${interface}: ${reason}: done" >>$LOGDIR/dhclient-exit.log 2>&1
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group. # Copyright (c) 2000-2004, 2006, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -590,7 +590,16 @@ sub os_useradd($$$$$$$$$) ...@@ -590,7 +590,16 @@ sub os_useradd($$$$$$$$$)
# Map the shell into a full path. # Map the shell into a full path.
$shell = MapShell($shell); $shell = MapShell($shell);
if (system("$USERADD -M -u $uid -g $gid $glist -p '$pswd' ". #
# -M is Redhat only option? Overrides default CREATE_HOME.
# So we see if CREATE_HOME is set and if so, use -M.
#
my $marg = "";
if (!system("grep -q CREATE_HOME /etc/login.defs")) {
$marg = "-M";
}
if (system("$USERADD $marg -u $uid -g $gid $glist -p '$pswd' ".
"-d $homedir -s $shell -c \"$gcos\" $login") != 0) { "-d $homedir -s $shell -c \"$gcos\" $login") != 0) {
warn "*** WARNING: $USERADD $login error.\n"; warn "*** WARNING: $USERADD $login error.\n";
return -1; return -1;
......
...@@ -14,7 +14,7 @@ require 'ctime.pl'; ...@@ -14,7 +14,7 @@ require 'ctime.pl';
# #
my $DUMPDATES = "/etc/dumpdates"; my $DUMPDATES = "/etc/dumpdates";
my @DBFILES = (); my @DBFILES = ();
my @SYSVARDIRS = ("lib/dhcp", "spool/clientmqueue", "log/audit"); my @SYSVARDIRS = ("lib/dhcp", "lib/dhcp3", "spool/clientmqueue", "log/audit");
my @VARDIRS = ("logs", "db", "jails", "boot", "lock"); my @VARDIRS = ("logs", "db", "jails", "boot", "lock");
my @SOCKETS = ("/dev/log", "/var/run/acpid.socket"); my @SOCKETS = ("/dev/log", "/var/run/acpid.socket");
my $FSTAB = "/etc/fstab"; my $FSTAB = "/etc/fstab";
...@@ -89,7 +89,7 @@ foreach my $dbfile (@DBFILES) { ...@@ -89,7 +89,7 @@ foreach my $dbfile (@DBFILES) {
# #
if (!$noumount && -e "/share/freebsd") { if (!$noumount && -e "/share/freebsd") {
print "Unmounting NFS filesystems ...\n"; print "Unmounting NFS filesystems ...\n";
if (!system("umount -t nfs")) { if (!system("umount -at nfs")) {
# #
# Note that this command will not remove anything if the NFS unmounts # Note that this command will not remove anything if the NFS unmounts
# failed (and we didn't catch it) because the directories in question # failed (and we didn't catch it) because the directories in question
......
#!/bin/bash #!/bin/bash
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group. # Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
. /etc/emulab/paths.sh . /etc/emulab/paths.sh
...@@ -11,16 +11,13 @@ ...@@ -11,16 +11,13 @@
# #
# description: Clean up node using Emulab's prepare script. # description: Clean up node using Emulab's prepare script.
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration. # Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then if [ -f /etc/sysconfig/network ]; then
exit 0 . /etc/sysconfig/network
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi fi
. /etc/sysconfig/network
RETVAL=0 RETVAL=0
# Oh, give me a break! Linux rc greps for keywords "daemon |action " to # Oh, give me a break! Linux rc greps for keywords "daemon |action " to
...@@ -36,14 +33,21 @@ case "$1" in ...@@ -36,14 +33,21 @@ case "$1" in
# Note: /var/lock/subsys/tbprepare will be created later, as needed. # Note: /var/lock/subsys/tbprepare will be created later, as needed.
;; ;;
stop) stop)
rm /var/lock/subsys/tbprepare #
echo "Running Testbed prepare script ..." # Note the Ubuntu does not use the /var/lock/subsys files
$BINDIR/prepare 2>&1 | tee /prepare.log # so we will get here on every shutdown, not just when the
$BINDIR/logboot /prepare.log # subsys file exists.
rm -f /prepare.log #
echo "Informing the testbed we're rebooting ..." if [ -f /var/lock/subsys/tbprepare ]; then
$BINDIR/tmcc state SHUTDOWN rm -f /var/lock/subsys/tbprepare
RETVAL=$? echo "Running Testbed prepare script ..."
$BINDIR/prepare 2>&1 | tee /prepare.log
$BINDIR/logboot /prepare.log
rm -f /prepare.log
echo "Informing the testbed we're rebooting ..."
$BINDIR/tmcc state SHUTDOWN
RETVAL=$?
fi
;; ;;
status) status)
echo "Peachy" echo "Peachy"
......
...@@ -13,17 +13,20 @@ ...@@ -13,17 +13,20 @@
# and terminates any lingering daemons. # and terminates any lingering daemons.
# Source function library. # Source function library.
. /etc/rc.d/init.d/functions if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
# Source networking configuration. # Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then if [ -f /etc/sysconfig/network ]; then
exit 0 . /etc/sysconfig/network
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
NETWORKING=yes
fi fi
. /etc/sysconfig/network
# Check that networking is up. # Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0 [ "${NETWORKING}" = "no" ] && exit 0
RETVAL=0 RETVAL=0
...@@ -35,7 +38,7 @@ case "$1" in ...@@ -35,7 +38,7 @@ case "$1" in
# Note, /var/lock/subsys/testbed will be created at that time. # Note, /var/lock/subsys/testbed will be created at that time.
;; ;;
stop) stop)
rm /var/lock/subsys/testbed rm -f /var/lock/subsys/testbed /var/emulab/boot/controlif
echo "Shutting down testbed daemons (some may fail)..." echo "Shutting down testbed daemons (some may fail)..."
echo -n " trafgen: " echo -n " trafgen: "
killproc trafgen killproc trafgen
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved.
#
#
# XXX ONLY RUN THIS INSTALL ON AN UBUNTO LINUX 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/ubuntu7
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 ifcfgs
include $(TESTBED_SRCDIR)/GNUmakerules
SYSETCDIR = $(DESTDIR)/etc
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(SYSETCDIR)
RRCDIR = /etc
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
install client-install: common-install etc-install \
script-install bin-install sysetc-fixup
@echo "Remember to install the PEM files if necessary"
simple-install: common-install script-install bin-install
dir-install:
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp3
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/network
common-install: dir-install
(cd ../common; $(MAKE) DESTDIR=$(DESTDIR) local-install)
bin-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) bin-install)
$(INSTALL) -m 755 $(SRCDIR)/findcnet $(BINDIR)/findcnet
etc-install: dir-install common-sysetc-install
common-sysetc-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) RRCDIR=$(RRCDIR) sysetc-install)
sysetc-fixup:
rm -rf $(SYSETCDIR)/modules.conf $(SYSETCDIR)/cron.pend $(SYSETCDIR)/sysconfig $(SYSETCDIR)/init.d/ntpd
mv $(SYSETCDIR)/dhclient-enter-hooks $(SYSETCDIR)/dhcp3/
mv $(SYSETCDIR)/dhclient-exit-hooks $(SYSETCDIR)/dhcp3/
rm -f $(RRCDIR)/rc.local $(SYSETCDIR)/rc.local
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(SYSETCDIR)/rc.local
$(INSTALL) -m 755 $(SRCDIR)/interfaces $(SYSETCDIR)/network/interfaces
$(INSTALL) -m 755 $(SRCDIR)/ntp.sh $(RCDIR)/init.d/ntp
script-install: dir-install $(SCRIPTS)
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) script-install)
sfs-install:
#!/bin/sh
#
# Find the Emulab control network interface.
#
# When called the first time (an invocation on any interface when
# /var/emulab/boot/controlif does not exist) we run DHCP and find the
# control network.
#
# On all invocations, we check the contents of that file against the
# interface we were called with and return "cnet" if we are the control
# net. Otherwise we just return the physical interface name.
#
set -e
export LANG=C
iface="$1"
. /etc/emulab/paths.sh
#
# We use /var/run to store the current idea of the cnet interface
# because we want it to go away on reboot.
#
cnetfile="/var/run/cnet"
cnetif=""
if [ ! -f $cnetfile ]; then
cp /dev/null $cnetfile
#
# Find a list of candidate interfaces.
#
_iflist=""
for _if in `ifconfig -s -a | awk '{ print $1 }' | grep -v Iface`; do
case $_if in
eth*)
_iflist="$_iflist $_if"
;;
*)
;;
esac
done
echo "`date`: $iface: findcnet running dhclient on: $_iflist"
#
# If dhclient returns success, then it has configured the first interface
# and gone into background mode. At that point we don't care about it any
# more and just kill it. We also shutdown all the other interfaces (which
# dhclient will leave "up").
#
if [ -x /sbin/dhclient ] && /sbin/dhclient -q $_iflist ; then