Whamcloud - gitweb
demos/*: update demos to handle module autoloading (Steve Bruggeman)
authoradilger <adilger>
Fri, 25 Feb 2000 06:39:39 +0000 (06:39 +0000)
committeradilger <adilger>
Fri, 25 Feb 2000 06:39:39 +0000 (06:39 +0000)
lustre/demos/Makefile
lustre/demos/basesetup.sh
lustre/demos/config.sh
lustre/demos/obdfssetup.sh
lustre/demos/snap3set.sh
lustre/demos/snapsetup.sh

index 8876cf9..85e6e5b 100644 (file)
@@ -4,4 +4,6 @@ perms:
        @-chmod a+x *.sh
 
 clean: 
+       -rm -f *~ *.orig
 
+install:
index fcf382f..b5796ec 100755 (executable)
@@ -5,13 +5,21 @@ OBDDIR="`dirname $0`/.."
 # source config info
 . $OBDDIR/demos/config.sh
 
+# 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
+    fi
+fi
+
+
 # temp file
 if [ "$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
 fi
-[ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=10k
+[ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=$TMPSIZE
 
 
 # loop device
index fd87c13..51f4df5 100644 (file)
@@ -7,9 +7,14 @@
 # Major number for OBD devices
 OBDMAJ=186
 
+# Module configuration file
+[ -f /etc/conf.modules ] && MODCONF=/etc/conf.modules
+[ -z "$MODCONF" -a -f /etc/modules.conf ] && MODCONF=/etc/modules.conf
+
 # If LOOPDEV is empty (""), then no loopback device will be configured.
 # If TMPFILE is empty (""), then no temporary file will be created for loop.
-TMPFILE="/tmp/obdfs.tmpfile"
+[ "$TMPFILE" ] || TMPFILE="/tmp/obdfs.tmpfile"
+[ "$TMPSIZE" ] || TMPSIZE=10240
 LOOPDEV="/dev/loop0"
 
 # If LOOPDEV is empty, then it is assumed that BASEDEV is a real block device
index bf37c39..81ca302 100755 (executable)
@@ -11,13 +11,13 @@ if [ x$? != x0 ]; then
     exit 4;
 fi
 
-insmod $OBDDIR/class/obdclass.o
-insmod $OBDDIR/ext2obd/obdext2.o
-insmod $OBDDIR/obdfs/obdfs.o
+#insmod $OBDDIR/class/obdclass.o
+#insmod $OBDDIR/ext2obd/obdext2.o
+#insmod $OBDDIR/obdfs/obdfs.o
 
 plog log "ATTACHING /dev/obd0, SETUP $BASEDEV"
 $OBDDIR/class/obdcontrol -f << EOF
-attach ext2_obd 
+attach obdext2
 setup $BASEDEV
 quit
 EOF
index 88645a2..c314f30 100755 (executable)
@@ -21,7 +21,7 @@ q
 y
 snapset 0 $SNAPTABLE
 device /dev/obd3
-attach snap_obd 0 3 0
+attach obdsnap 0 3 0
 setup
 quit
 EOF
index d2e7f73..b8b5eaa 100755 (executable)
@@ -25,7 +25,7 @@ fi
 
 plog umount $MNTOBD
 
-plog insmod $OBDDIR/snap/obdsnap.o
+#plog insmod $OBDDIR/snap/obdsnap.o
 
 rm -f $SNAPTABLE
 
@@ -49,10 +49,10 @@ q
 y
 snapset 0 $SNAPTABLE
 device /dev/obd1
-attach snap_obd 0 1 0
+attach obdsnap 0 1 0
 setup
 device /dev/obd2
-attach snap_obd 0 2 0
+attach obdsnap 0 2 0
 setup
 quit
 EOF