export PATH=$PATH:/sbin:/usr/sbin
if [ -d /r ]; then
- R=/r
+ R=/r
fi
PTLCTL=$SRCDIR/../../portals/linux/utils/ptlctl
LOOPNUM=0; export LOOPNUM
if [ -b /dev/loop0 ]; then
- LOOP=/dev/loop
+ LOOP=/dev/loop
else
- if [ -b /dev/loop/0 ]; then
- LOOP=/dev/loop/
- else
- echo "Cannot find /dev/loop0 or /dev/loop/0";
- exit -1
- fi
+ if [ -b /dev/loop/0 ]; then
+ LOOP=/dev/loop/
+ else
+ echo "Cannot find /dev/loop0 or /dev/loop/0" 1>&2 && exit -1
+ fi
fi
# Return the next unused loop device on stdout and in the $LOOPDEV
list_mods() {
$DEBCTL modules > $R/tmp/ogdb
- echo "The GDB module script is in /tmp/ogdb. Press enter to continue"
- read
-}
-
-setup() {
- [ -c /dev/portals ] || mknod /dev/portals c 10 240
-
- insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1
- insmod $SRCDIR/../../portals/linux/qswnal/kqswnal.o
- insmod $SRCDIR/../../portals/linux/socknal/ksocknal.o || exit -1
-
- [ "$NETWORK" = "tcp" ] && ($ACCEPTOR $PORT)
-
- [ -c /dev/obd ] || mknod /dev/obd c 10 241
-
- insmod $SRCDIR/../../obd/class/obdclass.o || exit -1
- insmod $SRCDIR/../../obd/rpc/ptlrpc.o || exit -1
- insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1
- insmod $SRCDIR/../../obd/ext2obd/obdext2.o || exit -1
- insmod $SRCDIR/../../obd/filterobd/obdfilter.o || exit -1
- insmod $SRCDIR/../../obd/ost/ost.o || exit -1
- insmod $SRCDIR/../../obd/osc/osc.o || exit -1
- insmod $SRCDIR/../../obd/obdecho/obdecho.o || exit -1
- insmod $SRCDIR/../../obd/mds/mds.o || exit -1
- insmod $SRCDIR/../../obd/mdc/mdc.o || exit -1
- insmod $SRCDIR/../../obd/llight/llite.o || exit -1
-
- list_mods
-
- [ -d /mnt/lustre ] || mkdir /mnt/lustre
+ echo "The GDB module script is in /tmp/ogdb"
}
setup_portals() {
if [ -z "$NETWORK" -o -z "$LOCALHOST" -o -z "$SERVER" ]; then
- echo "$0: NETWORK or LOCALHOST or SERVER is not set"
+ echo "$0: NETWORK or LOCALHOST or SERVER is not set" 1>&2
exit -1
fi
+ [ -c /dev/portals ] || mknod /dev/portals c 10 240
+
+ insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1
+
case $NETWORK in
elan) if [ "$PORT" ]; then
- echo "$0: NETWORK is elan but PORT is set"
+ echo "$0: NETWORK is elan but PORT is set" 1>&2
exit -1
fi
+ insmod $SRCDIR/../../portals/linux/qswnal/kqswnal.o
;;
tcp) if [ -z "$PORT" ]; then
- echo "$0: NETWORK is tcp but PORT is not set"
+ echo "$0: NETWORK is tcp but PORT is not set" 1>&2
exit -1
fi
+ insmod $SRCDIR/../../portals/linux/socknal/ksocknal.o || exit -1
+ $ACCEPTOR $PORT
;;
- *) echo "$0: unknown NETWORK \'$NETWORK\'"
+ *) echo "$0: unknown NETWORK \'$NETWORK\'" 1>&2
exit -1
;;
esac
EOF
}
+setup_lustre() {
+ [ -c /dev/obd ] || mknod /dev/obd c 10 241
+
+ insmod $SRCDIR/../../obd/class/obdclass.o || exit -1
+ insmod $SRCDIR/../../obd/rpc/ptlrpc.o || exit -1
+ insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1
+ insmod $SRCDIR/../../obd/ext2obd/obdext2.o || exit -1
+ insmod $SRCDIR/../../obd/filterobd/obdfilter.o || exit -1
+ insmod $SRCDIR/../../obd/ost/ost.o || exit -1
+ insmod $SRCDIR/../../obd/osc/osc.o || exit -1
+ insmod $SRCDIR/../../obd/obdecho/obdecho.o || exit -1
+ insmod $SRCDIR/../../obd/mds/mds.o || exit -1
+ insmod $SRCDIR/../../obd/mdc/mdc.o || exit -1
+ insmod $SRCDIR/../../obd/llight/llite.o || exit -1
+
+ list_mods
+
+ [ -d /mnt/lustre ] || mkdir /mnt/lustre
+}
+
setup_ldlm() {
- [ -c /dev/portals ] || mknod /dev/portals c 10 240
+ [ -c /dev/portals ] || mknod /dev/portals c 10 240
- insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1
+ insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1
- insmod $SRCDIR/../../obd/class/obdclass.o || exit -1
- insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1
+ insmod $SRCDIR/../../obd/class/obdclass.o || exit -1
+ insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1
- list_mods
+ list_mods
}