diff options
author | John Ankarström <john@ankarstrom.se> | 2021-01-28 21:33:30 +0000 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-01-28 21:33:30 +0000 |
commit | 51b5b02f52cc6f314029f3f2fe97afdc26ba0f25 (patch) | |
tree | 711d1efadeb78ad9b2d9f7b629350358838bc626 /patch/9fs-local-sources | |
parent | f3fd330cddade1c66d0f101d5cc6f657c4cd1bb6 (diff) | |
download | plan9-51b5b02f52cc6f314029f3f2fe97afdc26ba0f25.tar.gz |
Add various patches
Diffstat (limited to 'patch/9fs-local-sources')
-rwxr-xr-x | patch/9fs-local-sources/9fs | 87 | ||||
-rwxr-xr-x | patch/9fs-local-sources/9fs.orig | 85 | ||||
-rw-r--r-- | patch/9fs-local-sources/email | 1 | ||||
-rw-r--r-- | patch/9fs-local-sources/files | 1 | ||||
-rw-r--r-- | patch/9fs-local-sources/notes | 0 | ||||
-rw-r--r-- | patch/9fs-local-sources/readme | 3 |
6 files changed, 177 insertions, 0 deletions
diff --git a/patch/9fs-local-sources/9fs b/patch/9fs-local-sources/9fs new file mode 100755 index 0000000..a4a4fc0 --- /dev/null +++ b/patch/9fs-local-sources/9fs @@ -0,0 +1,87 @@ +#!/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 +case 9fat esp pidos dos + if(~ $#2 1) + part=`{ls $2 >[2]/dev/null} + if not if(~ $1 pidos) + part=`{ls /dev/sdM*/dos >[2]/dev/null} + if not + part=`{ls /dev/fs/$1 /dev/sd*/$1 >[2]/dev/null} + if(~ $#part 0) { + echo 'no '$1' partition found' >[1=2] + exit no.$1 + } + part=$part(1) + + if(! test -f /srv/dos) + dossrv >/dev/null </dev/null >[2]/dev/null + + 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 + } +case dump other + mount -C /srv/boot /n/$1 $1 +case sources + bind -c $home/sources /n/sources +case rsources + srv -nqC tcp!sources.cs.bell-labs.com sources /n/sources +case sourcesdump + 9fs sources + mount -nC /srv/sources /n/sourcesdump main/archive +case sourcessnap + 9fs sources + mount -nC /srv/sources /n/sourcessnap main/snapshot +case atom + 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 +case 9pio + srv -nq tcp!9p.io 9pio && mount -nC /srv/9pio /n/9pio +case 9front + 9fs 9front.org + for(i in 9front extra fqa hardware iso lists pkg sites) + bind /n/9front.org/$i /n/$i +case 9bugs + 9fs contrib.9front.org + bind /n/contrib.9front.org/bugs /n/bugs +case 9contrib + 9fs contrib.9front.org + for(i in contrib sources) + bind /n/contrib.9front.org/$i /n/$i +case 9grep + 9fs tcp!9front.org!7734 + bind -b /n/9front.org!7734 /n/lists +# 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} +case wiki + srv -m 'net!9p.io!wiki' wiki /mnt/wiki +case * + switch($#*){ + case 1 + srv -m $1 + case * + srv -m $1 $1 $2 + } +} diff --git a/patch/9fs-local-sources/9fs.orig b/patch/9fs-local-sources/9fs.orig new file mode 100755 index 0000000..c60a9c9 --- /dev/null +++ b/patch/9fs-local-sources/9fs.orig @@ -0,0 +1,85 @@ +#!/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 +case 9fat esp pidos dos + if(~ $#2 1) + part=`{ls $2 >[2]/dev/null} + if not if(~ $1 pidos) + part=`{ls /dev/sdM*/dos >[2]/dev/null} + if not + part=`{ls /dev/fs/$1 /dev/sd*/$1 >[2]/dev/null} + if(~ $#part 0) { + echo 'no '$1' partition found' >[1=2] + exit no.$1 + } + part=$part(1) + + if(! test -f /srv/dos) + dossrv >/dev/null </dev/null >[2]/dev/null + + 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 + } +case dump other + mount -C /srv/boot /n/$1 $1 +case sources + srv -nqC tcp!sources.cs.bell-labs.com sources /n/sources +case sourcesdump + 9fs sources + mount -nC /srv/sources /n/sourcesdump main/archive +case sourcessnap + 9fs sources + mount -nC /srv/sources /n/sourcessnap main/snapshot +case atom + 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 +case 9pio + srv -nq tcp!9p.io 9pio && mount -nC /srv/9pio /n/9pio +case 9front + 9fs 9front.org + for(i in 9front extra fqa hardware iso lists pkg sites) + bind /n/9front.org/$i /n/$i +case 9bugs + 9fs contrib.9front.org + bind /n/contrib.9front.org/bugs /n/bugs +case 9contrib + 9fs contrib.9front.org + for(i in contrib sources) + bind /n/contrib.9front.org/$i /n/$i +case 9grep + 9fs tcp!9front.org!7734 + bind -b /n/9front.org!7734 /n/lists +# 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} +case wiki + srv -m 'net!9p.io!wiki' wiki /mnt/wiki +case * + switch($#*){ + case 1 + srv -m $1 + case * + srv -m $1 $1 $2 + } +} diff --git a/patch/9fs-local-sources/email b/patch/9fs-local-sources/email new file mode 100644 index 0000000..191feb6 --- /dev/null +++ b/patch/9fs-local-sources/email @@ -0,0 +1 @@ +john@ankarstrom.se diff --git a/patch/9fs-local-sources/files b/patch/9fs-local-sources/files new file mode 100644 index 0000000..5273d26 --- /dev/null +++ b/patch/9fs-local-sources/files @@ -0,0 +1 @@ +/rc/bin/9fs 9fs diff --git a/patch/9fs-local-sources/notes b/patch/9fs-local-sources/notes new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/patch/9fs-local-sources/notes diff --git a/patch/9fs-local-sources/readme b/patch/9fs-local-sources/readme new file mode 100644 index 0000000..10e7ca3 --- /dev/null +++ b/patch/9fs-local-sources/readme @@ -0,0 +1,3 @@ +9fs: Make 'sources' bind /n/sources to $home/sources + +The remote sources are relegated to 'rsources'. |