2011-03-30 14:14:36 +00:00
|
|
|
#!/bin/rc
|
|
|
|
# 9fs filesystem [mountpoint] - srv & mount filesystem, usually from plan 9
|
|
|
|
|
|
|
|
rfork e
|
|
|
|
switch($1){
|
|
|
|
case ''
|
|
|
|
echo usage: 9fs service '[mountpoint]' >[1=2]
|
|
|
|
exit usage
|
2015-05-31 17:48:44 +00:00
|
|
|
case 9fat esp pidos dos
|
2012-07-30 15:58:17 +00:00
|
|
|
if(~ $#2 1)
|
|
|
|
part=`{ls $2 >[2]/dev/null}
|
2015-05-31 17:48:44 +00:00
|
|
|
if not if(~ $1 pidos)
|
|
|
|
part=`{ls /dev/sdM*/dos >[2]/dev/null}
|
2012-07-30 15:58:17 +00:00
|
|
|
if not
|
2015-05-31 17:48:44 +00:00
|
|
|
part=`{ls /dev/fs/$1 /dev/sd*/$1 >[2]/dev/null}
|
2011-04-22 20:14:08 +00:00
|
|
|
if(~ $#part 0) {
|
2015-05-31 17:48:44 +00:00
|
|
|
echo 'no '$1' partition found' >[1=2]
|
|
|
|
exit no.$1
|
2011-04-22 20:14:08 +00:00
|
|
|
}
|
|
|
|
part=$part(1)
|
|
|
|
|
|
|
|
if(! test -f /srv/dos)
|
|
|
|
dossrv >/dev/null </dev/null >[2]/dev/null
|
|
|
|
|
2015-05-31 17:48:44 +00:00
|
|
|
unmount /n/$1 >/dev/null >[2]/dev/null
|
|
|
|
mount -c /srv/dos /n/$1 $part
|
|
|
|
if(~ $1 9fat){
|
|
|
|
unmount /n/9 >/dev/null >[2]/dev/null
|
|
|
|
mount -c /srv/dos /n/9 $part
|
|
|
|
}
|
2016-07-02 19:15:39 +00:00
|
|
|
case dump other
|
|
|
|
mount -C /srv/boot /n/$1 $1
|
2011-03-30 14:14:36 +00:00
|
|
|
case sources
|
2012-04-27 15:51:20 +00:00
|
|
|
srv -nqC tcp!sources.cs.bell-labs.com sources /n/sources
|
2011-03-30 14:14:36 +00:00
|
|
|
case sourcesdump
|
|
|
|
9fs sources
|
2012-04-27 15:51:20 +00:00
|
|
|
mount -nC /srv/sources /n/sourcesdump main/archive
|
2011-03-30 14:14:36 +00:00
|
|
|
case sourcessnap
|
|
|
|
9fs sources
|
2012-04-27 15:51:20 +00:00
|
|
|
mount -nC /srv/sources /n/sourcessnap main/snapshot
|
2014-01-03 21:25:55 +00:00
|
|
|
case atom
|
2014-01-03 21:53:21 +00:00
|
|
|
srv -nq tcp!atom.9atom.org atom && mount -nC /srv/atom /n/atom atom
|
|
|
|
case atomdump
|
|
|
|
9fs atom && mount -nC /srv/atom /n/atomdump atomdump
|
2015-11-03 00:12:15 +00:00
|
|
|
case 9pio
|
|
|
|
srv -nq tcp!9p.io 9pio && mount -nC /srv/9pio /n/9pio
|
2015-11-07 01:00:03 +00:00
|
|
|
case 9front
|
|
|
|
9fs 9front.org
|
2016-05-04 23:26:26 +00:00
|
|
|
for(i in 9front extra fqa hardware iso lists pkg sites)
|
2015-11-07 01:00:03 +00:00
|
|
|
bind /n/9front.org/$i /n/$i
|
2018-04-02 23:54:58 +00:00
|
|
|
case 9bugs
|
|
|
|
9fs contrib.9front.org
|
|
|
|
bind /n/contrib.9front.org/bugs /n/bugs
|
|
|
|
case 9contrib
|
2015-11-07 01:00:03 +00:00
|
|
|
9fs contrib.9front.org
|
2018-04-02 23:54:58 +00:00
|
|
|
for(i in contrib sources)
|
2015-11-07 01:00:03 +00:00
|
|
|
bind /n/contrib.9front.org/$i /n/$i
|
2018-04-02 23:54:58 +00:00
|
|
|
case 9grep
|
|
|
|
9fs tcp!9front.org!7734
|
|
|
|
bind -b /n/9front.org!7734 /n/lists
|
2011-04-23 16:28:58 +00:00
|
|
|
# arbitrary venti archives
|
|
|
|
case vac:*
|
|
|
|
vacfs <{echo $1}
|
|
|
|
case *.vac
|
|
|
|
if (test -e $1)
|
|
|
|
score=$1
|
|
|
|
if not if (! ~ $1 /* && test -e $home/lib/vac/$1)
|
|
|
|
score=$home/lib/vac/$1
|
|
|
|
if not if (! ~ $1 /* && test -e /lib/vac/$1)
|
|
|
|
score=/lib/vac/$1
|
|
|
|
if not {
|
|
|
|
echo $0: $1: no such score file >[1=2]
|
|
|
|
exit 'no score file'
|
|
|
|
}
|
|
|
|
vacfs -m /n/`{basename $1 .vac} `{cat $score}
|
2011-03-30 14:14:36 +00:00
|
|
|
case wiki
|
|
|
|
srv -m 'net!plan9.bell-labs.com!wiki' wiki /mnt/wiki
|
|
|
|
case *
|
|
|
|
switch($#*){
|
|
|
|
case 1
|
|
|
|
srv -m $1
|
|
|
|
case *
|
|
|
|
srv -m $1 $1 $2
|
|
|
|
}
|
|
|
|
}
|