# 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