Commit b33e9635 authored by Kirk Webb's avatar Kirk Webb
Browse files

Stargate client-side boot support.

Similar to linux, but the sg linux distribution is based on debian, so some
things are a little different.

WARNING: if you do a client-install in a cross-compile environment
(with DESTDIR set), watch out for bogus symlinks in <root>/etc/rc*.d!
Have to fix these up by hand in this case.

Also note that the stargate rc script doesn't yet start the robot pilot
daemon - Tim said he needed to do finalize some stuff w.r.t. this, so
he would take care of modifying the rc script.

The ntp settings are still not ideal.  Even though the root fs is on a
journalling jffs filesys, its still not good to write to it regularly.  Need
to point the ntp drift file off into /var (ramfs)
parent 8b02ba00
......@@ -1994,6 +1994,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux/GNUmakefile tmcd/linux/supfile \
tmcd/linux/sethostname.dhclient \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/linux-sg/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/cygwinxp/GNUmakefile \
tmcd/openbsd/GNUmakefile tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
......
......@@ -695,6 +695,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux/GNUmakefile tmcd/linux/supfile \
tmcd/linux/sethostname.dhclient \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/linux-sg/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/cygwinxp/GNUmakefile \
tmcd/openbsd/GNUmakefile tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
......
......@@ -60,6 +60,10 @@ MDSUBDIR = cygwinxp
TMSLIBS += -lminires
endif
ifeq ($(host_cpu),arm)
MDSUBDIR = linux-sg
endif
ifeq ($(EVENTSYS),1)
TMCDCFLAGS = `elvin-config --cflags vin4c` \
-I$(TESTBED_SRCDIR)/event/lib -DEVENTSYS
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
#
# XXX ONLY RUN THIS INSTALL ON A 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/linux-sg
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
DESTDIR =
SYSETCDIR = $(DESTDIR)/etc
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
export RCDIR = $(SYSETCDIR)
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
export DEFRUNLVLDIR = $(RCDIR)/rc2.d
install client-install: baselinux-install common-install etc-install \
sup-install script-install bin-install
@echo "Remember to install the PEM files if necessary"
simple-install: common-install script-install bin-install
dir-install:
baselinux-install: dir-install
(cd ../linux; $(MAKE) client-install)
common-install: dir-install
(cd ../common; $(MAKE) local-install)
sup-install: dir-install
bin-install: dir-install
etc-install: dir-install sysetc-remove sysetc-install
sysetc-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/dhcpcd.exe $(SYSETCDIR)/dhcpc/dhcpcd.exe
$(INSTALL) -m 755 $(SRCDIR)/elvin.sh $(RCDIR)/init.d/elvin
$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
$(INSTALL) -m 755 $(SRCDIR)/mountallwrapper.sh \
$(RCDIR)/init.d/mountallwrapper.sh
$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
$(INSTALL) -m 755 $(SRCDIR)/wireless.opts \
$(SYSETCDIR)/pcmcia/wireless.opts
-ln -sf $(RCDIR)/init.d/mountallwrapper.sh \
$(RCDIR)/rcS.d/S05mountallwrapper.sh
sysetc-remove:
-rm -f $(SYSETCDIR)/dhclient*
-rm -f $(RCDIR)/rc.local
-rm -f $(RCDIR)/rcS.d/S05mountall.sh
-rm -f $(SYSETCDIR)/network-scripts/ifcfg-eth*
script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/rc.stargate $(BINDIR)/rc/rc.stargate
sfs-install:
############
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
# source interface parameters.
. $1
if [ x$2 = xdown ]
then
exit 0
fi
#
# Remember our server IP, real hostname, router IP, etc.
#
echo $DHCPSIADDR > $BOOTDIR/bossip
echo $HOSTNAME > $BOOTDIR/realname
echo $GATEWAY > $BOOTDIR/routerip
echo $IPADDR > $BOOTDIR/myip
echo $NETMASK > $BOOTDIR/mynetmask
if [ -n "$INTERFACE" ]; then
echo $INTERFACE > $BOOTDIR/controlif
fi
#
# See if the Testbed configuration software wants to change the hostname.
#
$BINDIR/sethostname.dhclient >$LOGDIR/dhclient.log 2>&1
#
# Killing off dhcpcd appears to unconfig the interface, so lets keep it
# around..
#
exit 0
#!/bin/sh
case "$1" in
start)
# Need to compensate for some weird race that's happening.
sleep 5
/usr/local/sbin/elvind && echo " elvind started."
;;
stop)
killall elvind
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0
#!/bin/sh
#
# Modified filesys mount hack originally from the Platx distribution
#
# Do the real work of mountall
/etc/init.d/mountall.sh
echo Done with default mountall.
# Make space for /var in ramfs
if [ ! -d /mnt/ramfs/var ]; then
mkdir /mnt/ramfs/var
fi
if [ ! -d /mnt/ramfs/tmp ]; then
mkdir /mnt/ramfs/tmp
chmod 777 /mnt/ramfs/tmp
fi
if [ ! -L /var ]; then
# Keep a record of the directories needed by /var since /var is going away.
# This hack replaces the previous hack of deleting /var at build time.
# This really only does something the first boot of a file system.
mkdir /mnt/holdvar
cp -R /var/* /mnt/holdvar
# Put /var on ramfs
rm -rf /var
ln -s /mnt/ramfs/var /var
rm -rf /tmp
ln -s /mnt/ramfs/tmp /tmp
fi
# Copy needed /var contents to ramfs /var
cp -R /mnt/holdvar/* /var
# Add additional directories (Some may not need to be done.)
mkdir -p /var/lib/misc
mkdir -p /var/local
mkdir -p /var/log/kernel
mkdir -p /var/opt
mkdir -p /var/run
mkdir -p /var/spool
mkdir -p /var/lock/subsys
mkdir -p /var/netstate
mkdir -p /var/tmp
mkdir -p /var/db
mkdir -p /var/emulab/boot/tmcc
mkdir -p /var/emulab/db
mkdir -p /var/emulab/jails
mkdir -p /var/emulab/lock
mkdir -p /var/emulab/logs
#!/bin/sh
#
# Start ntpd - Emulab style.
#
. /etc/emulab/paths.sh
case "$1" in
start)
if [ -x $BINDIR/ntpstart ]; then
$BINDIR/ntpstart /usr/sbin/ntpd && echo " ntpd started"
fi
;;
stop)
killall ntpd
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2004 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
case "$1" in
start)
echo "Executing Stargate-specific startup.."
# Replace new regmon with old since our code doesn't
# work with the new one yet..
if [ -r $ETCDIR/regmon.o ]; then
/sbin/rmmod regmon
/sbin/insmod -f $ETCDIR/regmon.o
fi
# Start the mote -> sg LEDS mirror
# Probably ought to move this to $BINDIR, but I'm not
# sure it's even installed from client-install yet!
if [ -x /usr/local/bin/moteleds ]; then
/usr/local/bin/moteleds -d -s -m
fi
# Start the robot control process
#cd /usr/local/etc/emulab
#/usr/local/bin/gorobot -d >> /tmp/gorobot.log
;;
stop)
# nothing yet..
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
#
# testbed Do some testbed stuff,
#
# description: On shutdown, it informs the testbed we are rebooting
# and terminates any lingering daemons.
RETVAL=0
# See how we were called.
case "$1" in
start)
# Fire off testbed startup.
$BINDIR/rc/rc.testbed
touch /var/lock/subsys/testbed
;;
stop)
rm /var/lock/subsys/testbed
echo "Shutting down testbed daemons ..."
killall trafgen
killall program-agent
killall slothd
killall healthd
killall watchdog
killall evproxy
killall linktest
killall emulab-syncd
echo "Informing the testbed we're rebooting ..."
$BINDIR/tmcc state SHUTDOWN
RETVAL=$?
;;
status)
echo "Peachy"
;;
restart)
echo "Done"
;;
reload)
echo "Done"
;;
*)
echo "Usage: testbed {start|stop|restart|reload|status}"
exit 1
esac
exit $RETVAL
......@@ -29,13 +29,14 @@ all: supfile $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
DESTDIR =
SYSETCDIR = $(DESTDIR)/etc
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(SYSETCDIR)/rc.d
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
SYSETCDIR ?= $(DESTDIR)/etc
ETCDIR ?= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR ?= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR ?= $(DESTDIR)$(CLIENT_VARDIR)
RCDIR ?= $(SYSETCDIR)/rc.d
INSTALL ?= /usr/bin/install -c
COMMON ?= $(SRCDIR)/../common
DEFRUNLVLDIR ?= $(RCDIR)/rc3.d
install client-install: common-install etc-install \
sup-install script-install bin-install
......@@ -50,7 +51,7 @@ dir-install:
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/init.d
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc1.d
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc3.d
$(INSTALL) -m 755 -o root -g wheel -d $(DEFRUNLVLDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc6.d
$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR)
$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR)
......@@ -94,7 +95,7 @@ sysetc-install: dir-install ifcfgs
$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc3.d/S96testbed
-ln -sf $(RCDIR)/init.d/testbed $(DEFRUNLVLDIR)/S96testbed
-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc1.d/K12testbed
-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc6.d/K12testbed
$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/cron.pend
......@@ -107,7 +108,7 @@ sysetc-install: dir-install ifcfgs
$(SYSETCDIR)/cron.pend; \
fi
$(INSTALL) -m 755 $(SRCDIR)/elvin.sh $(RCDIR)/init.d/elvin
-ln -sf $(RCDIR)/init.d/elvin $(RCDIR)/rc3.d/S96elvin
-ln -sf $(RCDIR)/init.d/elvin $(DEFRUNLVLDIR)/S96elvin
-ln -sf $(RCDIR)/init.d/elvin $(RCDIR)/rc1.d/K12elvin
-ln -sf $(RCDIR)/init.d/elvin $(RCDIR)/rc6.d/K12elvin
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local
......@@ -136,7 +137,7 @@ script-install: dir-install $(SCRIPTS)
sfs-install:
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs
$(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/init.d/sfs
-ln -sf $(RCDIR)/init.d/nfs $(RCDIR)/rc3.d/S20nfs
-ln -sf $(RCDIR)/init.d/nfs $(DEFRUNLVLDIR)/S20nfs
-ln -sf $(RCDIR)/init.d/sfs $(RCDIR)/rc6.d/K19sfs
$(INSTALL) -m 644 $(SRCDIR)/exports $(ETCDIR)/exports
$(INSTALL) -m 644 $(SRCDIR)/sfsrwsd_config $(ETCDIR)/sfs/sfsrwsd_config
......
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