]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/inst/mounthjfs
added hjfs
[plan9front.git] / rc / bin / inst / mounthjfs
1 #!/bin/rc
2
3 # desc: choose and mount file system partition
4 # prereq: systype
5
6 service=hjfs
7
8 switch($1){
9 case go
10         echo
11         echo The please choose your $fstype partition
12         echo
13
14         files=(`{ls /dev/sd*/fs* >[2]/dev/null})
15         if(! ~ $#files 0)
16                 ls -l $files
17         echo
18         if(~ $#files 1)
19                 default=(-d $files)
20         if not
21                 default=()
22         prompt $default 'Hjfs partition' $files
23         fs=$rd
24         export fs
25
26         mem=`{awk ' $2 == "pagesize" { p = $1 } $2 == "user" { split($1, a, "/"); print int((a[2] * p / 4 + 1048575) / 1048576)  } ' '#c'/swap}
27         prompt -d $mem 'Size of RAM filesystem cache (MB)?'
28         fsflags=(-m $rd)
29         export fsflags
30
31         log Starting $fstype file server for $fs
32         unmount /n/newfs >[2]/dev/null
33         echo halt >>/srv/$service.cmd >[2]/dev/null
34         rm -f /srv/$service /srv/$service.cmd
35
36         hjfs -n $service $fsflags -Srf $fs
37
38         log Configuring $fstype file server for $fs
39         {
40                 echo echo on
41                 echo create /dist sys sys 775 d
42                 echo create /usr sys sys 775 d
43                 echo newuser $user
44                 echo newuser adm +$user
45                 echo newuser sys +$user
46                 echo newuser upas +$user
47                 echo echo off
48                 sleep 2
49         } >>/srv/$service.cmd
50
51         log Mounting $fstype file server for $fs
52         while(! logprog mount -c /srv/$service /n/newfs)
53                 sleep 2
54         if(! ~ $fsother ''){
55                 log Mounting $fstype file server for $fsother
56                 logprog mount -c /srv/$service /n/other other
57         }
58
59 case checkready checkdone
60         if(! ~ $fstype '' && ~ $#fs 1 && test -f $fs){
61                 if(test -f /srv/$service && test -d /n/newfs/dist){
62                         mountfs=done
63                         export mountfs
64                         exit
65                 }
66         }
67         mountfs=ready
68         export mountfs
69         exit
70 }