inst: add hidden 'gefs' file system type option

one day it will graduate to experimental
This commit is contained in:
Ori Bernstein 2024-05-18 16:35:09 +00:00
parent 9c5fc1ce37
commit 8be7f27b75
5 changed files with 95 additions and 3 deletions

View file

@ -16,7 +16,7 @@ case go
echo ' cwfs64x the cached-worm file server'
echo ' hjfs the new 9front file server (experimental!)'
echo
prompt -d cwfs64x 'File system' cwfs64x hjfs
prompt -d cwfs64x -h gefs 'File system' cwfs64x hjfs
fstype=$rd
export fstype
}

View file

@ -23,12 +23,18 @@ fn sigint {
fn prompt {
def=()
hide=()
what=()
if(~ $1 -d && ! ~ $#* 1){
def=$2
shift
shift
}
if(~ $1 -h && ! ~ $#* 1){
hide=$2
shift
shift
}
optstr=()
if(~ $1 -w && ! ~ $#* 1){
@ -93,7 +99,7 @@ fn prompt {
if(! ~ $rd '')
okay=yes
case *
if(~ $rd $opts)
if(~ $rd $opts $hide)
okay=yes
}
}

View file

@ -8,6 +8,8 @@ case cwfs cwfs64 cwfs64x
exec ./mountcwfs $*
case hjfs
exec ./mounthjfs $*
case gefs
exec ./mountgefs $*
case *
mountfs=notdone
export mountfs

84
rc/bin/inst/mountgefs Executable file
View file

@ -0,0 +1,84 @@
#!/bin/rc
# desc: choose and mount file system partition
sname=gefs.newfs
userfile='-1:adm:adm:'^$user^'
0:none::
1:tor:tor:
2:'^$user^':'^$user:^'
10000:sys::'^$user^'
10001:map:map:
10002:doc::
10003:upas:upas:'^$user^'
10004:font::
10005:bootes:bootes:'
switch($1){
case go
echo
echo 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 'Gefs partition' $files
fs=$rd
export fs
fsflags=(-A)
export fsflags
ream=no
if(! ~ $fstype `{fstype $fs})
ream=yes
prompt -d $ream 'Ream the filesystem?' yes no
ream=$rd
log Starting $fstype file server for $fs
unmount /n/newfs >[2]/dev/null
echo halt >>/srv/$sname.cmd >[2]/dev/null
rm -f /srv/$sname /srv/$sname.cmd
if(~ $ream yes){
echo gefs -n $sname -r $user $fsflags -SAf $fs
gefs -n $sname -r $user $fsflags -SAf $fs
}
gefs -n $sname $fsflags -SAf $fs
log Mounting $fstype file server for $fs
while(! logprog mount -c /srv/$sname /n/newfs %main)
sleep 2
while(! logprog mount -c /srv/$sname /n/newfs.adm %adm)
sleep 2
log Configuring $fstype file server for $fs
echo $"userfile > /n/newfs.adm/users
echo sync >>/srv/$sname.cmd
echo users >>/srv/$sname.cmd
sleep 1
for(dir in adm dist usr){
logprog mkdir /n/newfs/$dir
usrgrp = sys
if(~ $dir adm)
usrgrp = adm
logprog chgrp $usrgrp /n/newfs/$dir
logprog chgrp -u $usrgrp /n/newfs/$dir
}
case checkready checkdone
if(! ~ $fstype '' && ~ $#fs 1 && test -f $fs){
if(test -f /srv/$sname && test -d /n/newfs/dist){
mountfs=done
export mountfs
exit
}
}
mountfs=ready
export mountfs
exit
}

View file

@ -7,7 +7,7 @@ fn autotype {
switch($fstype){
case cwfs cwfs64 cwfs64x
echo -a 9fat -a nvram -a fscache -a fsworm -a other
case hjfs
case hjfs gefs
echo -a 9fat -a nvram -a fs
}
}