# check if running in source directory
# will probably need to create variable for each module.
if [ -f $SRCDIR/Makefile.am ]; then
+ USEDEV=yes
PORTALS=$SRCDIR/../../portals
LUSTRE=$SRCDIR/..
OBDCTL=$LUSTRE/utils/obdctl
else
+ USEDEV=no
# should have configure set the paths here
BINDIR=/usr/sbin
PORTALS=/lib/modules
[ "$DEBUG_WAIT" = "yes" ] && echo -n "Press ENTER to continue" && read
}
+# start acceptor for a given network and port.
+# not all networks need an acceptor
+start_acceptor() {
+ case $NETWORK in
+ elan) [ "$PORT" ] && fail "$0: NETWORK is elan but PORT is set"
+ ;;
+ tcp) [ "$PORT" ] || fail "$0: NETWORK is tcp but PORT is not set"
+ $ACCEPTOR $PORT
+ ;;
+ *) fail "$0: unknown NETWORK '$NETWORK'" ;;
+
+}
+
# We need at least one setup file to be given. It can be passed on
# the command-line, or it can be found in the home directory, or it
# can even be sourced into the current shell environment.
[ -c /dev/portals ] || mknod /dev/portals c 10 240
- do_insmod $PORTALS/linux/oslib/portals.o || exit -1
+ if [ "$USEDEV" = "yes ]; then
+ do_insmod $PORTALS/linux/oslib/portals.o || exit -1
- case $NETWORK in
- elan) [ "$PORT" ] && fail "$0: NETWORK is elan but PORT is set"
- do_insmod $PORTALS/linux/qswnal/kqswnal.o || exit -1
- ;;
- tcp) [ "$PORT" ] || fail "$0: NETWORK is tcp but PORT is not set"
- do_insmod $PORTALS/linux/socknal/ksocknal.o || exit -1
- $ACCEPTOR $PORT
- ;;
- *) fail "$0: unknown NETWORK '$NETWORK'" ;;
+ case $NETWORK in
+ elan) do_insmod $PORTALS/linux/qswnal/kqswnal.o || exit -1
+ ;;
+ tcp) do_insmod $PORTALS/linux/socknal/ksocknal.o || exit -1
+ ;;
+ *) fail "$0: unknown NETWORK '$NETWORK'" ;;
esac
+ start_acceptor
+
$PTLCTL <<- EOF
setup $NETWORK
mynid $LOCALHOST
setup_lustre() {
[ -c /dev/obd ] || mknod /dev/obd c 10 241
- do_insmod $LUSTRE/obdclass/obdclass.o || exit -1
- do_insmod $LUSTRE/ptlrpc/ptlrpc.o || exit -1
- do_insmod $LUSTRE/ldlm/ldlm.o || exit -1
- do_insmod $LUSTRE/extN/extN.o || \
+ if [ "$USEDEV" = "yes" ]; then
+ do_insmod $LUSTRE/obdclass/obdclass.o || exit -1
+ do_insmod $LUSTRE/ptlrpc/ptlrpc.o || exit -1
+ do_insmod $LUSTRE/ldlm/ldlm.o || exit -1
+ do_insmod $LUSTRE/extN/extN.o || \
echo "info: can't load extN.o module, not fatal if using ext3"
- do_insmod $LUSTRE/mds/mds.o || exit -1
- #do_insmod $LUSTRE/mds/mds_ext2.o || exit -1
- #do_insmod $LUSTRE/mds/mds_ext3.o || exit -1
- do_insmod $LUSTRE/mds/mds_extN.o || \
+ do_insmod $LUSTRE/mds/mds.o || exit -1
+ #do_insmod $LUSTRE/mds/mds_ext2.o || exit -1
+ #do_insmod $LUSTRE/mds/mds_ext3.o || exit -1
+ do_insmod $LUSTRE/mds/mds_extN.o || \
echo "info: can't load mds_extN.o module, needs extN.o"
- do_insmod $LUSTRE/obdecho/obdecho.o || exit -1
- #do_insmod $LUSTRE/obdext2/obdext2.o || exit -1
- do_insmod $LUSTRE/obdfilter/obdfilter.o || exit -1
- do_insmod $LUSTRE/ost/ost.o || exit -1
- do_insmod $LUSTRE/osc/osc.o || exit -1
- do_insmod $LUSTRE/mdc/mdc.o || exit -1
- do_insmod $LUSTRE/lov/lov.o || exit -1
- do_insmod $LUSTRE/llite/llite.o || exit -1
+ do_insmod $LUSTRE/obdecho/obdecho.o || exit -1
+ #do_insmod $LUSTRE/obdext2/obdext2.o || exit -1
+ do_insmod $LUSTRE/obdfilter/obdfilter.o || exit -1
+ do_insmod $LUSTRE/ost/ost.o || exit -1
+ do_insmod $LUSTRE/osc/osc.o || exit -1
+ do_insmod $LUSTRE/mdc/mdc.o || exit -1
+ do_insmod $LUSTRE/lov/lov.o || exit -1
+ do_insmod $LUSTRE/llite/llite.o || exit -1
+ fi
echo "$R/tmp/lustre-log" > /proc/sys/portals/debug_path
list_mods
# formatting anything.
# FIXME: check if device is already formatted.
def prepare_obd(obd):
- obdname = obd.getAttribute('name')
- (dev, size, fstype, format) = getDeviceInfo(obd)
- print "OBD: ", dev, size, fstype, format
+ (name, dev, size, fstype, format) = getOBDInfo(obd)
+ print "OBD: ", name, dev, size, fstype, format
## if not is_block(dev):
## dev = init_loop(dev, size, fstype)
## if (format == 'yes'):
## mkfs(fstype, dev)
-def prepare_ost(node):
+def prepare_ost(ost):
+ name = getOSTInfo(ost)
print 'prepare ost'
def prepare_mds(node):
# XML processing
# extract device attributes for an obd
-def getDeviceInfo(obd):
+def getOBDInfo(obd):
+ obdname = obd.getAttribute('name')
dev = obd.getElementsByTagName('device')[0]
dev.normalize();
try:
fstype = getText(obd, 'fstype')
format = getText(obd, 'autoformat')
- return (dev.firstChild.data, size, fstype, format)
+ return (obdname, dev.firstChild.data, size, fstype, format)
+
+# extract device attributes for an obd
+def getOSTInfo(node):
+ name = node.getAttribute('name')
+ return (name)
# Get the text content from the first matching child
def getText(node, tag):