#!/bin/rc # freeze a fossil for preservation # fossilize [partition] [fsname] rfork en fossil=$1 fsname=$2 if (~ $#fsname 0) fsname=$sysname if(! test -e /dev/sd*) bind -b '#S' /dev if(~ $fossil ''){ fossil=`{ls /dev/fs/fossil* /dev/sd*/fossil* >[2]/dev/null} if(~ $fossil ''){ echo 'no fossil partition found, please specify a target fossil' >[1=2] exit no.fossil } if(! ~ $#fossil 1){ echo 'found multiple partitions named fossil, please specify which is the target' >[1=2] exit toomany.fossils } } if(! test -e /n/9fat/plan9.ini){ part=`{ls /dev/fs/9fat /dev/sd*/9fat >[2]/dev/null} if(~ $#part 0) { echo '9fat?' >[1=2] exit no.9fat } part=$part(1) if(! test -f /srv/dos) dossrv >/dev/null [2]/dev/null mount -c /srv/dos /n/9fat $part if(! test -e /n/9fat/plan9.ini){ echo '9fat?' >[1=2] exit no.plan9ini } } if(test -e /bin/fossilast) last=`{fossilast $fossil} if not last=`{fossil/last $fossil} if(! ~ $last vac*){ echo 'no score?!' >[2=1] exit no.score } echo $last $fossil $venti >>/n/9fat/scores.$fsname echo $last $fsname echo $last $fsname >[1=2] exit ''