diff --git a/clientside/GNUmakefile.in b/clientside/GNUmakefile.in index 15bacf857f7069f0ee2c2995f6ff073abd38fad7..24501a3dafe255bf0f769f70096fe11314f83d7c 100644 --- a/clientside/GNUmakefile.in +++ b/clientside/GNUmakefile.in @@ -25,6 +25,8 @@ TESTBED_SRCDIR = @top_srcdir@ OBJDIR = @top_builddir@ SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR)) SYSTEM := $(shell uname -s) +ARCH := $(shell uname -p) +REL := $(shell $(SRCDIR)/tmcc/osstuff.sh -r) include $(OBJDIR)/Makeconf @@ -62,7 +64,7 @@ newnode-mfs: newnode-mfs-subdirs newnode-mfs-install: client-mkdirs newnode-mfs-install-subdirs TARBALLDESTDIR = /var/tmp/emulab-client -client-tarball: +tarball-check: @if [ `id -u` -ne 0 ]; then \ echo '*** Must run as root!'; \ false; \ @@ -72,6 +74,8 @@ client-tarball: echo "Remove it and try again."; \ false; \ fi + +client-tarball: tarball-check echo "Building and installing client-side in $(TARBALLDESTDIR)..." DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install echo "Creating tarball..." @@ -81,6 +85,43 @@ client-mkdirs: -mkdir -p $(DESTDIR)$(CLIENT_BINDIR) -mkdir -p $(DESTDIR)$(CLIENT_MANDIR) +freenas-os-check: + @if [ "$(SYSTEM)" != "FreeBSD" -o "$(ARCH)" != "amd64" -o \ + \( "$(REL)" != "9.2" -a "$(REL)" != "8.3" \) ]; then \ + echo "Must run on FreeBSD 8.3 or 9.2 amd64"; \ + false; \ + fi + +# +# XXX when we have a real freenas9 target, all the moving files around +# should be done there... +# +freenas-tarball: freenas-os-check tarball-check + echo "Building and installing client-side in $(TARBALLDESTDIR)..." + DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install + echo "Tweaking for FreeNAS..." + (cd $(TARBALLDESTDIR); \ + mkdir -p cfg cfg/rc.d cfg/local data local; \ + mv etc/emulab cfg/emulab; \ + mv usr/local/etc/emulab local/emulab; \ + mv var/emulab data/emulab; \ + ln -sf /data/emulab conf/base/var/emulab; \ + rm -rf var data/emulab/sup; \ + mkdir -p data/emulab/shadow data/emulab/vms; \ + chflags noschg sbin/init; \ + rm -rf boot etc root sbin usr/*; \ + mv local usr/local; \ + ln -sf /usr/local/emulab cfg/local/emulab) + (cd $(SRCDIR)/tmcc/freenas8; \ + cp genvmtype $(TARBALLDESTDIR)/cfg/emulab/; \ + cp testbed $(TARBALLDESTDIR)/cfg/rc.d/; \ + cp bscontrol.proxy.pl $(TARBALLDESTDIR)/usr/local/emulab/bscontrol.proxy; \ + cp freenas-config libfreenas.pm libvnode_blockstore.pm $(TARBALLDESTDIR)/usr/local/emulab/; \ + rm -f $(TARBALLDESTDIR)/usr/local/emulab/rc/rc.kname; \ + chmod -R g-w $(TARBALLDESTDIR)/usr/local/emulab) + echo "Creating tarball freenas-client.tar.gz..." + tar czf freenas-client.tar.gz -C $(TARBALLDESTDIR) . + # # Attempt to find a git commit hash and stash in /etc/emulab. # diff --git a/clientside/tmcc/common/rc.bootsetup b/clientside/tmcc/common/rc.bootsetup index 0f013d3f7183e3f581cbfe00f5b1bda16573a0e0..020607b76f9ec200f8f9626b2d7f370d904666c4 100755 --- a/clientside/tmcc/common/rc.bootsetup +++ b/clientside/tmcc/common/rc.bootsetup @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (c) 2004-2013 University of Utah and the Flux Group. +# Copyright (c) 2004-2014 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -409,10 +409,14 @@ sub doboot() # Kill off pubsubd and start clusterd. # system("killall pubsubd"); - print("Starting pubsub cluster daemon\n"); - system("/usr/local/libexec/clusterd -s $eventserver"); - if ($?) { - fatal("Error running clusterd"); + if (-x "/usr/local/libexec/clusterd") { + print("Starting pubsub cluster daemon\n"); + system("/usr/local/libexec/clusterd -s $eventserver"); + if ($?) { + fatal("Error running clusterd"); + } + } else { + print STDERR "WARNING: clusterd not installed, not started\n"; } } elsif (!(REMOTE() && !REMOTEDED()) && !GENVNODE()) { diff --git a/clientside/tmcc/freenas8/bscontrol.proxy.pl b/clientside/tmcc/freenas8/bscontrol.proxy.pl old mode 100644 new mode 100755