#!/bin/rc # ramfossil score/vacfile [ramsrv name] [fossil fsname] # creates a small fossil in ram and initializes it with the provided score score=$1 if(~ $1 *.vac) score=`{cat $1} if(~ $#1 0){ echo no rootscore! exit } ramsrv=$2 fos=$3 if(~ $#ramsrv 0) ramsrv=ramdisk if(~ $#fos 0) fos=ram score=`{echo $score |sed 's/vac://'} echo fsys main config /n/$ramsrv/fossil >/tmp/ramfosconf echo fsys main open -c 3000 >>/tmp/ramfosconf echo srv -p $fos^fscons >>/tmp/ramfosconf echo srv -A $fos^fossil >>/tmp/ramfosconf ramfs -S $ramsrv mount -c /srv/$ramsrv /n/$ramsrv touch /n/$ramsrv/fossil dd -if /dev/zero -of /n/$ramsrv/fossil -count 200000 if(test -d /bin/fossil){ fossil/conf -w /n/$ramsrv/fossil /tmp/ramfosconf fossil/flfmt -y -v $score /n/$ramsrv/fossil fossil/fossil -f /n/$ramsrv/fossil exit } fossilconf -w /n/$ramsrv/fossil /tmp/ramfosconf flfmt -y -v $1 /n/$ramsrv/fossil fossil -f /n/$ramsrv/fossil