2 # Get the locations for the files from a single place to avoid confusion
4 # Copyright (C) 2001 Cluster File Systems, Inc.
6 # This code is issued under the GNU General Public License.
7 # See the file COPYING in this distribution
8 OBDDIR="`dirname $0`/.."
11 . $OBDDIR/demos/config.sh
17 # module configuration
18 if [ "$MODCONF" -a -f $MODCONF ]; then
19 if [ -z "`grep -i "alias *char-major-$OBDMAJ *obdclass" $MODCONF`" ]; then
20 if [ -d /etc/modutils ]; then
21 # Debian-style modules configuration.
22 echo "alias char-major-${OBDMAJ} obdclass" > /etc/modutils/obd
25 echo "alias char-major-${OBDMAJ} obdclass" >>$MODCONF
32 if [ "$LOOPDEV" -a "$TMPFILE" -a -f $TMPFILE ]; then
33 echo "$TMPFILE exists; I'm unwilling to overwrite it. Remove [N/y]?" 1>&2
35 [ -f $TMPFILE ] && exit 1
37 [ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=$TMPSIZE
41 if [ "$LOOPDEV" ]; then
42 insmod loop > /dev/null 2>&1
43 if [ -a "`losetup $LOOPDEV 2> /dev/null`" ]; then
44 echo "It appears that $LOOPDEV is in use. Unable to continue" 1>&2
45 echo "You need to clean up $LOOPDEV (via cleanup.sh),"
46 echo "or you can change which device is used in demos/config.sh" 1>&2
48 [ "$TMPFILE" ] && rm $TMPFILE
51 losetup $LOOPDEV $TMPFILE
54 # Ensure that we have the correct devices for OBD to work
55 [ ! -c /dev/obd0 ] && mknod /dev/obd0 c $OBDMAJ 0
56 [ ! -c /dev/obd1 ] && mknod /dev/obd1 c $OBDMAJ 1
57 [ ! -c /dev/obd2 ] && mknod /dev/obd2 c $OBDMAJ 2
60 if [ "$BASEDEV" ]; then
62 # mke2fs -r 0 -b 4096 $BASEDEV
64 echo "\$BASEDEV not defined in demos/config.sh. Please fix!"
65 [ "$LOOPDEV" ] && losetup -d $LOOPDEV
66 [ "$TMPFILE" ] && rm $TMPFILE