]> git.lizzy.rs Git - plan9front.git/blobdiff - rc/bin/inst/mountcwfs
/lib/rob: Just write the code.
[plan9front.git] / rc / bin / inst / mountcwfs
old mode 100644 (file)
new mode 100755 (executable)
index 3af4486..8a203ef
@@ -2,10 +2,12 @@
 
 # desc: choose and mount file system partition
 
+service=cwfs
+
 switch($1){
 case go
        echo
-       echo The please choose your $fstype partitions
+       echo Please choose your $fstype partitions
        echo
 
        files=(`{ls /dev/sd*/fscache* /dev/fs/fscache* >[2]/dev/null})
@@ -19,6 +21,8 @@ case go
        prompt $default 'Cwfs cache partition' $files
        fs=$rd
        export fs
+       fsflags=()
+       export fsflags
 
        files=(`{ls /dev/sd*/fsworm* /dev/fs/fsworm* >[2]/dev/null})
        if(! ~ $#files 0)
@@ -52,18 +56,15 @@ case go
 
        log Starting $fstype file server for $fs
        unmount /n/newfs >[2]/dev/null
-       echo halt >>/srv/cwfs.cmd >[2]/dev/null
-       rm -f /srv/cwfs /srv/cwfs.cmd
+       echo halt >>/srv/$service.cmd >[2]/dev/null
+       rm -f /srv/$service /srv/$service.cmd
 
        if(~ $ream yes){
                if(! test -f /tmp/fsconfig){
                        {
-                               echo service cwfs
+                               echo service $service
                                echo config $fs
-
-                               # new config option
                                echo noauth
-
                                echo filsys main c'('$fs')('$fsworm')'
                                echo filsys dump o
                                if(! ~ $fsother ''){
@@ -75,7 +76,7 @@ case go
                        } >/tmp/fsconfig
                }
                echo 'Reaming filesystem'
-               if(! $fstype -f $fs -c </tmp/fsconfig){
+               if(! $fstype -f $fs -C -c </tmp/fsconfig){
                        mountfs=ready
                        export mountfs
                        exit oops
@@ -83,52 +84,49 @@ case go
        }
        if not {
                echo 'Entering manual configuration mode. when done, type end'
-               if(! $fstype -n cwfs -f $fs -c){
+               if(! $fstype -n $service -f $fs -c){
                        mountfs=ready
                        export mountfs
                        exit oops
                }
        }
 
-       log Configuering $fstype file server for $fs
+       log Configuring $fstype file server for $fs
        {
+               echo noattach
                echo allow
                echo users default
                echo cfs main
                echo create /adm adm adm 775 d
                echo create /adm/users adm adm 664
-               echo create /usr sys sys 775 d
                echo create /dist sys sys 775 d
+               echo create /usr sys sys 775 d
                echo newuser $user
-               echo newuser sys +$user
                echo newuser adm +$user
+               echo newuser sys +$user
                echo newuser upas +$user
                if(! ~ $fsother ''){
                        echo cfs other
                        echo create /usr sys sys 775 d
                        echo create /usr/$user $user $user 775 d
                        echo create /usr/$user/tmp $user $user 750 d
-                       echo create /dist sys sys 775 d
                        echo cfs main
                }
-       } >>/srv/cwfs.cmd
-       sleep 5
+               echo noattach
+               sleep 2
+       } >>/srv/$service.cmd
 
        log Mounting $fstype file server for $fs
-       if(! logprog mount -c /srv/cwfs /n/newfs){
-               mountfs=ready
-               export mountfs
-               exit
-       }
+       while(! logprog mount -c /srv/$service /n/newfs)
+               sleep 2
        if(! ~ $fsother ''){
                log Mounting $fstype file server for $fsother
-               if(logprog mount -c /srv/cwfs /n/other other)
-                       bind -qc /n/other/dist /n/newfs/dist
+               logprog mount -c /srv/$service /n/other other
        }
 
 case checkready checkdone
        if(! ~ $fstype '' && ~ $#fs 1 && test -f $fs){
-               if(test -f /srv/cwfs && test -d /n/newfs/dist){
+               if(test -f /srv/$service && test -d /n/newfs/dist){
                        mountfs=done
                        export mountfs
                        exit