#!/bin/sh
-SRCDIR="`dirname $0`"
-. $SRCDIR/common.sh
-
-NETWORK=tcp
-LOCALHOST=localhost
-SERVER=localhost
-PORT=1234
-
-setup_portals
-setup_lustre
-
-old_fs ext2 /tmp/ost 80000
-OST=$LOOPDEV
-MDSFS=ext2
-old_fs ${MDSFS} /tmp/mds 10000
-MDS=$LOOPDEV
-
-echo 0xffffffff > /proc/sys/portals/debug
-
-$OBDCTL <<EOF
-device 0
-attach mds MDSDEV
-setup ${MDS} ${MDSFS}
-device 1
-attach obdfilter OBDDEV
-setup ${OST} ext2
-device 2
-attach ost OSTDEV
-setup 1
-device 3
-attach ptlrpc RPCDEV
-setup
-device 4
-attach ldlm LDLMDEV
-setup
-device 5
-attach osc OSCDEV
-setup -1
-quit
-EOF
-
-mount -t lustre_lite -o device=5 none /mnt/lustre
+export PATH=`dirname $0`/../utils:$PATH
+
+LCONF=${LCONF:-lconf}
+NAME=${NAME:-local}
+LLMOUNT=${LLMOUNT:-llmount}
+
+config=$NAME.xml
+mkconfig=$NAME.sh
+
+if [ "$PORTALS" ]; then
+ portals_opt="--portals=$PORTALS"
+fi
+
+if [ "$LUSTRE" ]; then
+ lustre_opt="--lustre=$LUSTRE"
+fi
+
+if [ "$LDAPURL" ]; then
+ conf_opt="--ldapurl $LDAPURL --config $NAME"
+else
+ if [ ! -f $config -o $mkconfig -nt $config ]; then
+ sh $mkconfig $config || exit 1
+ fi
+ conf_opt="$config"
+fi
+
+[ "$NODE" ] && node_opt="--node $NODE"
+
+${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt $@ $conf_opt || exit 2
+
+if [ "$MOUNT2" ]; then
+ $LLMOUNT -v `hostname`:/mds1/client $MOUNT2 || exit 3
+fi
+