#!/bin/rc

rfork e

if (! test -f /bin/fs) fn rovlfs { /usr/chaokul/rovlfs/8.out $* }

switch($#*) {
#case 0; area=omni
case 1; area=$1 mnt=/sys/src
case 2; area=$1 mnt=$2
case *; echo usage: $0 area-name '[mntpnt]'; exit 'bad usage'
}

echo area $area...

dir=$home/trees/$area

test -d /tmp/$area || mkdir /tmp/$area
test -d $dir || mkdir $dir
test -d $dir/files || mkdir $dir/files

cat > $dir/rules << EOF
/tmp/$area ext<8>
/tmp/$area ext<q>
$home/trees/$area/files all<>
EOF

fs -f $dir/rules -h $dir/holedb $mnt