2 # Get the locations for the files from a single place to avoid confusion
3 OBDDIR="`dirname $0`/.."
4 [ "$OBDDIR" = "" ] && OBDDIR=".."
5 . $OBDDIR/demos/config.sh
7 #if [ "$TMPFILE" -a -f $TMPFILE ]; then
8 # echo "$TMPFILE exists; I'm unwilling to overwrite it." 1>&2
12 # We assume the loop module will be installed by kerneld if required.
13 # If not, the following line should be uncommented.
16 if [ "$LOOPDEV" -a "`losetup $LOOPDEV 2> /dev/null`" ]; then
17 echo "It appears that $LOOPDEV is in use. Unable to continue" 1>&2
18 echo "You need to clean up $LOOPDEV (via cleanup.sh),"
19 echo "or you can change which device is used in demos/config.sh" 1>&2
23 # Ensure that we have the correct devices for OBD to work
24 [ ! -c /dev/obd0 ] && mknod /dev/obd0 c $OBDMAJ 0
25 [ ! -c /dev/obd1 ] && mknod /dev/obd1 c $OBDMAJ 1
26 [ ! -c /dev/obd2 ] && mknod /dev/obd2 c $OBDMAJ 2
28 [ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=10k
30 [ "$LOOPDEV" ] && losetup $LOOPDEV $TMPFILE
31 if [ "$BASEDEV" ]; then
32 mke2fs -b 4096 $BASEDEV
34 echo "\$BASEDEV not defined in demos/config.sh. Please fix!"