summaryrefslogtreecommitdiff
path: root/rc/bin/inst/moveoldfs
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-12 15:53:55 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-12 15:53:55 +0000
commit67e93d6a0a4f15192638e131413b9d64c4269c76 (patch)
tree88fd1d17c4be283683a96ced44159e3ce6b6f2f7 /rc/bin/inst/moveoldfs
parent7208d528bd42f981f2535403f72e4c0d7d8df643 (diff)
downloadplan9front-67e93d6a0a4f15192638e131413b9d64c4269c76.tar.xz
updating cwfs and moving installer in /rc/bin
Diffstat (limited to 'rc/bin/inst/moveoldfs')
-rwxr-xr-xrc/bin/inst/moveoldfs72
1 files changed, 72 insertions, 0 deletions
diff --git a/rc/bin/inst/moveoldfs b/rc/bin/inst/moveoldfs
new file mode 100755
index 000000000..819beeb39
--- /dev/null
+++ b/rc/bin/inst/moveoldfs
@@ -0,0 +1,72 @@
+#!/bin/rc
+
+# desc: move an old third edition plan 9 file system out of the way
+# prereq: mountfs
+
+rootfiles=(\
+ 386\
+ 68000\
+ 68020\
+ LICENSE\
+ NOTICE\
+ acme\
+ adm\
+ alpha\
+ arm\
+ cron\
+ dist\
+ fd\
+ lib\
+ lp\
+ mail\
+ mips\
+ mnt\
+ n\
+ power\
+ rc\
+ sparc\
+ sys\
+ tmp\
+ usr/glenda\
+ wrap\
+)
+
+switch($1){
+case checkready
+ if(! test -d /n/kfs/wrap){
+ moveoldfs=done
+ export moveoldfs
+ }
+
+case go
+ if(test -d /n/kfs/wrap){
+ echo 'You have a Third Edition Plan 9 installation on '^$fs^'.'
+ echo 'We need to move the old file system out of the way (into /3e)'
+ echo 'in order to continue.'
+ echo
+ prompt 'Move old file system' y n
+ switch($rd){
+ case y
+ kname=`{kfsname $fs}
+ log Moving old Plan 9 installation into /3e on kfs
+ logprog disk/kfscmd -n$kname 'create /3e sys sys 555 d' >>[2]/srv/log
+ logprog disk/kfscmd -n$kname 'create /3e/usr sys sys 555 d' >>[2]/srv/log
+ for(i in $rootfiles)
+ if(test -e /n/kfs/$i)
+ logprog disk/kfscmd -n$kname 'rename /'^$i^' /3e/'^$i
+ # copy extant /adm/users in case there have been modifications
+ logprog disk/kfscmd -n$kname 'create /adm adm adm 555 d' >>[2]/srv/log
+ logprog cp /n/kfs/3e/adm/users /n/kfs/adm/users >>[2]/srv/log
+
+ case n
+ echo 'Okay, but we can''t continue.'
+ echo
+ }
+ }
+
+case checkdone
+ if(test -d /n/kfs/wrap){
+ moveoldfs=notdone
+ export moveoldfs
+ }
+}