Whamcloud - gitweb
Update copyright and license information.
[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 #
6 # Copyright (C) 2001  Cluster File Systems, Inc.
7 #
8 # This code is issued under the GNU General Public License.
9 # See the file COPYING in this distribution
10 #set -vx
11
12 # Major number for OBD devices
13 OBDMAJ=186
14
15 # Module configuration file
16 [ -f /etc/conf.modules ] && MODCONF=/etc/conf.modules
17 [ -z "$MODCONF" -a -f /etc/modules.conf ] && MODCONF=/etc/modules.conf
18
19 # If LOOPDEV is empty (""), then no loopback device will be configured.
20 # If TMPFILE is empty (""), then no temporary file will be created for loop.
21 [ "$TMPFILE" ] || TMPFILE="/tmp/obdfs.tmpfile"
22 [ "$TMPSIZE" ] || TMPSIZE=10240
23 [ -b /dev/loop/0 ] && LOOPDEV=/dev/loop/0
24 [ -z "$LOOPDEV" -a -b /dev/loop0 ] && LOOPDEV="/dev/loop0"
25
26 # If LOOPDEV is empty, then it is assumed that BASEDEV is a real block device
27 # that doesn't mind being overwritten - don't use a partition with data on it!!
28 BASEDEV="$LOOPDEV"
29
30 # The following are mount points for the filesystems during the test.
31 MNTOBD="/mnt/obd"
32 MNTSNAP="/mnt/snap"
33 MNTSNAP2="/mnt/snap2"
34
35 # This is where the snapshot table will be stored:
36 SNAPTABLE="/tmp/obdfs.snaptable"
37
38 # A simple routine called by most of the scripts to help debugging.  The
39 # kernel code has a lot of debugging statements, so this helps us keep
40 # track of what is going on in user-land to generate the kernel messages.
41 plog () {
42     if [ "$1" = "log" ]; then
43         shift
44         logger -p kern.info "******** $* **********"
45         echo "$*"
46     else
47         logger -p kern.info "****start**** $* *****"
48         echo "$*"
49         $*
50         logger -p kern.info "*****end***** $* *****"
51     fi
52 }
53
54 # A routine to display a command, and prompt user if it should be run
55 qrun () {
56     echo
57     echo -n "Run '$*' [Y/n]?'";
58     read JUNK
59
60     case $JUNK in
61         n*|N*) echo "'$*' not run" ;;
62         *) plog $* ;;
63     esac
64 }