Whamcloud - gitweb
demos/*: update demos to handle module autoloading (Steve Bruggeman)
[fs/lustre-release.git] / lustre / demos / config.sh
1 #!/bin/sh
2 # File which holds configuation parameters in a single place to avoid any
3 # mismatch between scripts (especially the cleanup scripts, which are
4 # destructive).
5 #set -vx
6
7 # Major number for OBD devices
8 OBDMAJ=186
9
10 # Module configuration file
11 [ -f /etc/conf.modules ] && MODCONF=/etc/conf.modules
12 [ -z "$MODCONF" -a -f /etc/modules.conf ] && MODCONF=/etc/modules.conf
13
14 # If LOOPDEV is empty (""), then no loopback device will be configured.
15 # If TMPFILE is empty (""), then no temporary file will be created for loop.
16 [ "$TMPFILE" ] || TMPFILE="/tmp/obdfs.tmpfile"
17 [ "$TMPSIZE" ] || TMPSIZE=10240
18 LOOPDEV="/dev/loop0"
19
20 # If LOOPDEV is empty, then it is assumed that BASEDEV is a real block device
21 # that doesn't mind being overwritten - don't use a partition with data on it!!
22 BASEDEV="$LOOPDEV"
23
24 # The following are mount points for the filesystems during the test.
25 MNTOBD="/mnt/obd"
26 MNTSNAP="/mnt/snap"
27 MNTSNAP2="/mnt/snap2"
28
29 # This is where the snapshot table will be stored:
30 SNAPTABLE="/tmp/obdfs.snaptable"
31
32 # A simple routine called by most of the scripts to help debugging.  The
33 # kernel code has a lot of debugging statements, so this helps us keep
34 # track of what is going on in user-land to generate the kernel messages.
35 plog () {
36     if [ "$1" = "log" ]; then
37         shift
38         logger -p kern.info "******** $* **********"
39         echo "$*"
40     else
41         logger -p kern.info "****start**** $* *****"
42         echo "$*"
43         $*
44         logger -p kern.info "*****end***** $* *****"
45     fi
46 }
47
48 # A routine to display a command, and prompt user if it should be run
49 qrun () {
50     echo
51     echo -n "Run '$*' [Y/n]?'";
52     read JUNK
53
54     case $JUNK in
55         n*|N*) echo "'$*' not run" ;;
56         *) plog $* ;;
57     esac
58 }