Commit 787d0759 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'clientside'

This is the client reorganization! All of the code that makes up the
client side (the stuff we install on images and mfs's) has been moved
into a single place; the clientside subdir. The eventual plan is to
turn this into a separate git submodule, but for now it lives inside
of the emulab repo.

There are two modes of installation.

1. Build as part of a full emulab build; The top level configure and
   makefile operate as before; the clientside directory is built and
   the client and client-install targets do what they always do. Ditto
   the various mfs and subboss targets.

2. In the clientside directory, there is a new configure script that
   covers just this subdir. chdir into clientside, run configure with
   no options or defs file, and then build/install. This will be a lot
   esier to handle for user wanting to simply update existing images
   with the latest clientside.

Notes:

1. I used "git mv" so the history will follow the files when you do a
   git log, but only if you use the --follow option.

2. configure has been updated to 2.63 cause the old one we were using
   did not support some of the substitutions I wanted.
parents 27bac658 828b1fee
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Testbed Makefile
......@@ -30,7 +30,7 @@ include Makeconf
# Then things that depend on stuff we just did:
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
SUBDIRS = lib db assign www @optional_subdirs@ ipod security sensors \
SUBDIRS = lib db assign www @optional_subdirs@ clientside ipod security sensors \
pxe tbsetup account tmcd utils backend tip capture ipod vis \
sensors os xmlrpc install/newnode_sshkeys mote tools/whol \
tools/svn wiki bugdb collab protogeni node_usage install
......@@ -192,53 +192,39 @@ client-mkdirs:
-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)
client:
@$(MAKE) -C lib/libtb client
ifeq ($(EVENTSYS),1)
@$(MAKE) -C event client
endif
@$(MAKE) -C lib client
@$(MAKE) -C clientside client
@$(MAKE) -C os client
ifneq ($(SYSTEM),CYGWIN_NT-5.1)
@$(MAKE) -C capture client
@$(MAKE) -C tip client
@$(MAKE) -C tools client
endif
@$(MAKE) -C sensors client
@$(MAKE) -C tmcd client
client-install: client client-mkdirs
ifeq ($(EVENTSYS),1)
@$(MAKE) -C event client-install
endif
@$(MAKE) -C lib client-install
@$(MAKE) -C clientside client-install
@$(MAKE) -C os client-install
ifneq ($(SYSTEM),CYGWIN_NT-5.1)
@$(MAKE) -C capture client-install
@$(MAKE) -C tip client-install
@$(MAKE) -C tools client-install
endif
@$(MAKE) -C sensors client-install
@$(MAKE) -C tmcd client-install
subboss: client
@$(MAKE) -C os subboss
@$(MAKE) -C utils subboss
subboss-install: subboss
ifeq ($(EVENTSYS),1)
@$(MAKE) -C event client-install
endif
@$(MAKE) -C clientside client-install
ifneq ($(SYSTEM),CYGWIN_NT-5.1)
@$(MAKE) -C capture client-install
@$(MAKE) -C tip client-install
@$(MAKE) -C tools client-install
endif
@$(MAKE) -C sensors client-install
@$(MAKE) -C utils subboss-install
@$(MAKE) -C os subboss-install
@$(MAKE) -C db subboss-install
@$(MAKE) -C tmcd subboss-install
@$(MAKE) -C clientside/tmcc subboss-install
@$(MAKE) -C rc.d subboss-install
@$(MAKE) -C dhcpd subboss-install
@$(MAKE) -C tbsetup client-install
# Hack: this should probably be done by a subboss-install
# script, but there isn't a huge need for that yet
@rm -f $(INSTALL_RCDIR)/isc-dhcpd
......@@ -260,6 +246,18 @@ client-tarball:
echo "Creating tarball..."
tar czf emulab-client.tar.gz -C $(TARBALLDESTDIR) .
client-src-tarball:
@rm -f emulab-client-src.tar.gz
tar clzf emulab-client-src.tar.gz -C clientside
# This is not finished yet.
client-shadow-rpm:
-$(RM) -rf rpmbuild
$(MKDIR_P) rpmbuild/SOURCES rpmbuild/SRPMS
$(CP) emulab-client-src.tar.gz rpmbuild/SOURCES
$(RPM) -v -bs --nodeps --define='_topdir $(TOPDIR)/rpmbuild' \
clientside/shadow.spec
destdircheck:
@if [ -z "$(DESTDIR)" ]; then \
echo "You must define DESTDIR for this target!"; \
......@@ -278,58 +276,55 @@ mfsoscheck:
mfs: mfsoscheck
@$(MAKE) -C os mfs
@$(MAKE) -C sensors mfs
@$(MAKE) -C tmcd mfs
@$(MAKE) -C clientside mfs
mfs-nostatic: mfsoscheck
@NOSTATIC=1 $(MAKE) -C os mfs
@NOSTATIC=1 $(MAKE) -C sensors mfs
@NOSTATIC=1 $(MAKE) -C tmcd mfs
@NOSTATIC=1 $(MAKE) -C clientside mfs
mfs-install: destdircheck mfs client-mkdirs
@$(MAKE) -C os mfs-install
@$(MAKE) -C sensors mfs-install
@$(MAKE) -C tmcd mfs-install
@$(MAKE) -C clientside mfs-install
mfs-nostatic-install: destdircheck mfs-nostatic client-mkdirs
@$(MAKE) -C os mfs-install
@$(MAKE) -C sensors mfs-install
@$(MAKE) -C tmcd mfs-install
@$(MAKE) -C clientside mfs-install
frisbee-mfs: mfsoscheck
@$(MAKE) -C cdrom/groklilo client
@$(MAKE) -C os frisbee-mfs
@$(MAKE) -C tmcd frisbee-mfs
@$(MAKE) -C clientside frisbee-mfs
frisbee-mfs-nostatic: mfsoscheck
@NOSTATIC=1 $(MAKE) -C cdrom/groklilo client
@NOSTATIC=1 $(MAKE) -C os frisbee-mfs
@NOSTATIC=1 $(MAKE) -C tmcd frisbee-mfs
@NOSTATIC=1 $(MAKE) -C clientside frisbee-mfs
frisbee-mfs-install: destdircheck frisbee-mfs
@CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C cdrom/groklilo client-install
@$(MAKE) -C os frisbee-mfs-install
@$(MAKE) -C tmcd frisbee-mfs-install
@$(MAKE) -C clientside frisbee-mfs-install
frisbee-mfs-nostatic-install: destdircheck frisbee-mfs-nostatic
@CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C cdrom/groklilo client-install
@$(MAKE) -C os frisbee-mfs-install
@$(MAKE) -C tmcd frisbee-mfs-install
@$(MAKE) -C clientside frisbee-mfs-install
cdboot: mfsoscheck client
@echo "CD/Dongle files built"
cdboot-install: destdircheck cdboot
@$(MAKE) -C cdrom client-install
@$(MAKE) -C tmcd/freebsd6 cdboot-install
@$(MAKE) -C clientside/tmcc/freebsd6 cdboot-install
flashboot: mfsoscheck client
@echo "Flash dongle files built"
flashboot-install: destdircheck flashboot
@$(MAKE) -C tmcd/freebsd6 cdboot-install
@$(MAKE) -C clientside/tmcc/freebsd6 cdboot-install
@$(MAKE) -C os frisbee-mfs-install
@$(MAKE) -C flash client-install
@$(MAKE) -C clientside frisbee-mfs-install
#
# A check to see if this is a 'real' install. Kinda hacky, but as far as I can
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
# Get rid of a bunch of nasty built-in implicit rules,
......@@ -56,7 +56,10 @@ CFLAGS += $(LOCALCFLAGS)
clean:
distclean: clean
# This is to avoid warnings about duplicate targets.
distclean: default-clean
default-clean:
rm -f GNUmakefile
#
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Most of the configure-substitution magic is done here.
......@@ -83,6 +83,7 @@ ELVIN_COMPAT = @ELVIN_COMPAT@
HAVE_MEZZANINE = @HAVE_MEZZANINE@
GTK_CONFIG = @GTK_CONFIG@
BRAINSTEM_DIR = @BRAINSTEM_DIR@
WITH_EMULAB = @WITH_EMULAB@
host_cpu = @host_cpu@
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
SYSTEM := $(shell uname -s)
include $(OBJDIR)/Makeconf
SUBDIRS =
ifeq ($(WITH_EMULAB),0)
#
# lib is a common directory, and is added to the clientside tarball.
# So not do not build it when building full emulab tree; already done.
#
SUBDIRS += lib
endif
# These must be after lib.
SUBDIRS += event tools os sensors tmcc
ifeq ($(WITH_EMULAB),1)
all: all-subdirs
install:all boss-install-subdirs
else
all: client-subdirs
install:
@echo "Choose an appropriate install target, and make sure you "
@echo "you are on a node of that type. Basically, do not do a "
@echo "client-install on boss, cause you will be hating life!"
endif
include $(TESTBED_SRCDIR)/GNUmakerules
client: client-subdirs
client-install: client client-mkdirs client-install-subdirs
control-install: control-install-subdirs
subboss: subboss-subdirs
subboss-install: client subboss-install-subdirs
post-install: post-install-subdirs
clean: clean-subdirs
distclean: distclean-subdirs
mfs: mfs-subdirs
mfs-install: client-mkdirs mfs-install-subdirs
frisbee-mfs: frisbee-mfs-subdirs
frisbee-mfs-install: client-mkdirs frisbee-mfs-install-subdirs
client-mkdirs:
-mkdir -p $(DESTDIR)$(CLIENT_BINDIR)
-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
.PHONY: $(SUBDIRS)
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
# Get rid of a bunch of nasty built-in implicit rules,
# to avoid bogus circular dependencies and make things go faster.
# Use the `-r' command line option to make to get even better performance.
.SUFFIXES:
#
# Various install targets.
#
$(INSTALL_BINDIR)/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_BINDIR)
$(INSTALL_PROGRAM) $< $@
$(INSTALL_SBINDIR)/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_SBINDIR)
$(INSTALL_PROGRAM) $< $@
$(INSTALL_LIBDIR)/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBDIR)
$(INSTALL_PROGRAM) $< $@
$(INSTALL_LIBEXECDIR)/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBEXECDIR)
$(INSTALL_PROGRAM) $< $@
$(INSTALL_ETCDIR)/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_ETCDIR)
$(INSTALL_DATA) $< $@
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_SCRIPTS)): $(INSTALL_SBINDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_SBINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_SCRIPTS)): $(INSTALL_BINDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_BINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_SCRIPTS)): $(INSTALL_LIBEXECDIR)/%: %
echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_LIBEXECDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@
CFLAGS += $(LOCALCFLAGS)
clean:
distclean: clean
rm -f GNUmakefile
#
# Where to find source files.
# Using specific patterns instead of the catch-all VPATH variable
# avoids hitting miscellaneous wrong targets in other directories
# when configuring in the source directory.
#
vpath %.in $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath %.c $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath %.cc $(SRCDIR) $(MOSTLY_SRCDIRS)
vpath % $(SRCDIR) $(MOSTLY_SRCDIRS)
#
# Define rules which we blew away with .SUFFIXES
#
%.o: %.c
$(CC) -c -o $@ $(CFLAGS) $<
%.o: %.cc
$(CXX) -c -o $@ $(CXXFLAGS) $<
%.o: %.C
$(CXX) -c -o $@ $(CXXFLAGS) $<
%_xdr.h: %.x
rpcgen -h $< > $@
%_xdr.c: %.x %_xdr.h
rpcgen -c $< > $@
%: %-debug
$(STRIP) -o $@$(EXE) $<$(EXE)
%-version.c:
echo >$@ "char build_info[] = \"Built on `date` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"
#
# Rules to regen configure written files.
#
%: %.in $(OBJDIR)/config.status
@echo "Regenerating $@"
cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status
ifeq ($(TESTS),)
.PHONY: check
else
check: $(TESTS)
@export SRCDIR=${SRCDIR}; for tst in $^; do \
if test `basename $$tst .sh` != `basename $$tst`; then \
tst="sh $$tst"; \
fi; \
if $$tst; then \
echo "PASS: $$tst"; \
else \
echo "FAIL: $$tst"; \
exit 1; \
fi \
done
endif
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Most of the configure-substitution magic is done here.
# All the other makefiles in the NodeOS include
# this fragment
#
# Need the PATH because the older autoconf does not support
# AC_PATH_TOOL which is needed for cross-compilation to work.
export PATH = @PATH@
export CC = @CC@
export CXX = @CXX@
export LD = @CC@ ${CFLAGS}
export STRIP = @STRIP@
export RANLIB = @RANLIB@
export AR = @AR@
export ELVIN_CONFIG = @ELVIN_CONFIG@
prefix = @prefix@
exec_prefix = @exec_prefix@
host_cpu = @host_cpu@
TBROOT = @prefix@
INSTALL_TOPDIR = @exec_prefix@
INSTALL_DIR = @exec_prefix@
INSTALL_LIBDIR = @libdir@
INSTALL_BINDIR = @bindir@
INSTALL_SBINDIR = @sbindir@
INSTALL_LIBEXECDIR = @libexecdir@
INSTALL_ETCDIR = @sysconfdir@
INSTALL_INCDIR = @includedir@
INSTALL_WWWDIR = @exec_prefix@/www
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL@ -m 755
EXE = @EXEEXT@
INSTALL_DATA = @INSTALL@ -m 444
SUDO = @SUDO@
CLIENT_ETCDIR = @CLIENT_ETCDIR@
CLIENT_BINDIR = @CLIENT_BINDIR@
CLIENT_VARDIR = @CLIENT_VARDIR@
CLIENT_MANDIR = @CLIENT_MANDIR@
LOG_TESTBED = @LOG_TESTBED@
EVENTSYS = @EVENTSYS@
ELVIN_COMPAT = @ELVIN_COMPAT@
WITH_EMULAB = @WITH_EMULAB@
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
tranformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else