Whamcloud - gitweb
- add manual pages with configuration help.
[fs/lustre-release.git] / lustre / demos / basesetup.sh
index c301630..3b0bad8 100755 (executable)
@@ -1,20 +1,35 @@
 #! /bin/sh
 # Get the locations for the files from a single place to avoid confusion
+#
+# Copyright (C) 2001  Cluster File Systems, Inc.
+#
+# This code is issued under the GNU General Public License.
+# See the file COPYING in this distribution
 OBDDIR="`dirname $0`/.."
 
 # source config info
 . $OBDDIR/demos/config.sh
 
+insmod obdclass
+insmod obdext2
+insmod obdfs
+
 # module configuration
 if [ "$MODCONF" -a -f $MODCONF ]; then
     if [ -z "`grep -i "alias  *char-major-$OBDMAJ  *obdclass" $MODCONF`" ]; then
-         echo "alias char-major-${OBDMAJ} obdclass" >>$MODCONF
+       if [ -d /etc/modutils ]; then
+           # Debian-style modules configuration.
+           echo "alias char-major-${OBDMAJ} obdclass" > /etc/modutils/obd
+           update-modules
+       else
+           echo "alias char-major-${OBDMAJ} obdclass" >>$MODCONF
+       fi
     fi
 fi
 
 
 # temp file
-if [ "$TMPFILE" -a -f $TMPFILE ]; then 
+if [ "$LOOPDEV" -a "$TMPFILE" -a -f $TMPFILE ]; then 
     echo "$TMPFILE exists; I'm unwilling to overwrite it.  Remove [N/y]?" 1>&2
     rm -i $TMPFILE
     [ -f $TMPFILE ] && exit 1
@@ -43,7 +58,8 @@ fi
 
 
 if [ "$BASEDEV" ]; then
-    mke2fs -r 0 -b 4096 $BASEDEV
+    # echo "No mke2fs!!"
+     mke2fs -r 0 -b 4096 $BASEDEV
 else
     echo "\$BASEDEV not defined in demos/config.sh.  Please fix!"
     [ "$LOOPDEV" ] && losetup -d $LOOPDEV