changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/9fs

changeset 7243: 34f64dcbbc25
parent: 6cebe846dd29
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
1 #!/bin/rc
2 # 9fs filesystem [mountpoint] - srv & mount filesystem, usually from plan 9
3 
4 rfork e
5 switch($1){
6 case ''
7  echo usage: 9fs service '[mountpoint]' >[1=2]
8  exit usage
9 case 9fat esp pidos dos
10  if(~ $#2 1)
11  part=`{ls $2 >[2]/dev/null}
12  if not if(~ $1 pidos)
13  part=`{ls /dev/sdM*/dos >[2]/dev/null}
14  if not
15  part=`{ls /dev/fs/$1 /dev/sd*/$1 >[2]/dev/null}
16  if(~ $#part 0) {
17  echo 'no '$1' partition found' >[1=2]
18  exit no.$1
19  }
20  part=$part(1)
21 
22  if(! test -f /srv/dos)
23  dossrv >/dev/null </dev/null >[2]/dev/null
24 
25  unmount /n/$1 >/dev/null >[2]/dev/null
26  mount -c /srv/dos /n/$1 $part
27  if(~ $1 9fat){
28  unmount /n/9 >/dev/null >[2]/dev/null
29  mount -c /srv/dos /n/9 $part
30  }
31 case dump other
32  mount -C /srv/boot /n/$1 $1
33 case sources
34  srv -nqC tcp!sources.cs.bell-labs.com sources /n/sources
35 case sourcesdump
36  9fs sources
37  mount -nC /srv/sources /n/sourcesdump main/archive
38 case sourcessnap
39  9fs sources
40  mount -nC /srv/sources /n/sourcessnap main/snapshot
41 case atom
42  srv -nq tcp!atom.9atom.org atom && mount -nC /srv/atom /n/atom atom
43 case atomdump
44  9fs atom && mount -nC /srv/atom /n/atomdump atomdump
45 case 9pio
46  srv -nq tcp!9p.io 9pio && mount -nC /srv/9pio /n/9pio
47 case 9front
48  9fs 9front.org
49  for(i in 9front extra fqa hardware iso lists pkg sites)
50  bind /n/9front.org/$i /n/$i
51 case 9bugs
52  9fs contrib.9front.org
53  bind /n/contrib.9front.org/bugs /n/bugs
54 case 9contrib
55  9fs contrib.9front.org
56  for(i in contrib sources)
57  bind /n/contrib.9front.org/$i /n/$i
58 case 9grep
59  9fs tcp!9front.org!7734
60  bind -b /n/9front.org!7734 /n/lists
61 # arbitrary venti archives
62 case vac:*
63  vacfs <{echo $1}
64 case *.vac
65  if (test -e $1)
66  score=$1
67  if not if (! ~ $1 /* && test -e $home/lib/vac/$1)
68  score=$home/lib/vac/$1
69  if not if (! ~ $1 /* && test -e /lib/vac/$1)
70  score=/lib/vac/$1
71  if not {
72  echo $0: $1: no such score file >[1=2]
73  exit 'no score file'
74  }
75  vacfs -m /n/`{basename $1 .vac} `{cat $score}
76 case wiki
77  srv -m 'net!plan9.bell-labs.com!wiki' wiki /mnt/wiki
78 case *
79  switch($#*){
80  case 1
81  srv -m $1
82  case *
83  srv -m $1 $1 $2
84  }
85 }