summaryrefslogtreecommitdiff
path: root/rc/bin/inst/mounthjfs
diff options
context:
space:
mode:
authoraiju <aiju@phicode.de>2012-08-07 17:57:04 +0200
committeraiju <aiju@phicode.de>2012-08-07 17:57:04 +0200
commitb21b9ba89cf66a8fac6f94efb79cfb425a2c4df2 (patch)
tree42047f997cda3eddec9faeafeb74435cc72a4786 /rc/bin/inst/mounthjfs
parentef1c1863051d0530a31b291f4e334ee7601c318c (diff)
downloadplan9front-b21b9ba89cf66a8fac6f94efb79cfb425a2c4df2.tar.xz
added hjfs
Diffstat (limited to 'rc/bin/inst/mounthjfs')
-rwxr-xr-xrc/bin/inst/mounthjfs70
1 files changed, 70 insertions, 0 deletions
diff --git a/rc/bin/inst/mounthjfs b/rc/bin/inst/mounthjfs
new file mode 100755
index 000000000..6be5b4e6f
--- /dev/null
+++ b/rc/bin/inst/mounthjfs
@@ -0,0 +1,70 @@
+#!/bin/rc
+
+# desc: choose and mount file system partition
+# prereq: systype
+
+service=hjfs
+
+switch($1){
+case go
+ echo
+ echo The please choose your $fstype partition
+ echo
+
+ files=(`{ls /dev/sd*/fs* >[2]/dev/null})
+ if(! ~ $#files 0)
+ ls -l $files
+ echo
+ if(~ $#files 1)
+ default=(-d $files)
+ if not
+ default=()
+ prompt $default 'Hjfs partition' $files
+ fs=$rd
+ export fs
+
+ mem=`{awk ' $2 == "pagesize" { p = $1 } $2 == "user" { split($1, a, "/"); print int((a[2] * p / 4 + 1048575) / 1048576) } ' '#c'/swap}
+ prompt -d $mem 'Size of RAM filesystem cache (MB)?'
+ fsflags=(-m $rd)
+ export fsflags
+
+ log Starting $fstype file server for $fs
+ unmount /n/newfs >[2]/dev/null
+ echo halt >>/srv/$service.cmd >[2]/dev/null
+ rm -f /srv/$service /srv/$service.cmd
+
+ hjfs -n $service $fsflags -Srf $fs
+
+ log Configuring $fstype file server for $fs
+ {
+ echo echo on
+ echo create /dist sys sys 775 d
+ echo create /usr sys sys 775 d
+ echo newuser $user
+ echo newuser adm +$user
+ echo newuser sys +$user
+ echo newuser upas +$user
+ echo echo off
+ sleep 2
+ } >>/srv/$service.cmd
+
+ log Mounting $fstype file server for $fs
+ while(! logprog mount -c /srv/$service /n/newfs)
+ sleep 2
+ if(! ~ $fsother ''){
+ log Mounting $fstype file server for $fsother
+ logprog mount -c /srv/$service /n/other other
+ }
+
+case checkready checkdone
+ if(! ~ $fstype '' && ~ $#fs 1 && test -f $fs){
+ if(test -f /srv/$service && test -d /n/newfs/dist){
+ mountfs=done
+ export mountfs
+ exit
+ }
+ }
+ mountfs=ready
+ export mountfs
+ exit
+}