2011-04-16 20:42:16 +00:00
|
|
|
#!/bin/rc
|
|
|
|
|
|
|
|
cddevs=()
|
|
|
|
|
|
|
|
# fill cddevs with cd or dvd devices
|
|
|
|
fn findcds{
|
|
|
|
for(dev in /dev/sd*){
|
|
|
|
x=`{sed '/([Cc][Dd]|[Dd][Vv][Dd])/!d' $dev/ctl >[2]/dev/null}
|
|
|
|
if(! ~ $#x 0)
|
|
|
|
cddevs=($cddevs $dev)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn configlocal{
|
|
|
|
disk=`{echo $methodarg | sed 's,(.*)!.*,\1,g'}
|
|
|
|
fstype=`{echo $disk | sed 's,.*/(.*)$,\1,g'}
|
|
|
|
disk=`{echo $disk | sed 's,(.*)/.*$,\1,'}
|
|
|
|
|
|
|
|
if(~ $pcload 1){
|
|
|
|
kern=`{echo $methodarg | sed 's,.*!(.*)$,\1,g'}
|
|
|
|
|
|
|
|
# for now we only allow kernels in the same dev/part of $methodargs
|
|
|
|
if(~ $#kern 0 || ! ~ $#bootfile 0)
|
|
|
|
kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
|
|
|
|
}
|
|
|
|
|
|
|
|
bind -a '#c' /dev >/dev/null >[2=1]
|
|
|
|
bind '#p' /proc >[2=1] >/dev/null >[2=1]
|
|
|
|
bind -a '#S' /dev >/dev/null >[2=1]
|
|
|
|
bind -a '#f' /dev >/dev/null >[2=1]
|
|
|
|
bind -a '#k' /dev >/dev/null >[2=1]
|
|
|
|
bind -a '#æ' /dev >/dev/null >[2=1]
|
|
|
|
|
|
|
|
diskparts
|
|
|
|
findcds
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connectlocal{
|
2011-04-18 05:58:04 +00:00
|
|
|
rm -f /srv/boot
|
2011-04-16 20:42:16 +00:00
|
|
|
switch($fstype){
|
|
|
|
case fs
|
|
|
|
connectlocalkfs
|
2011-04-18 05:58:04 +00:00
|
|
|
case fscache fsworm
|
|
|
|
must cwfs64x -n boot -f $disk^/$fstype
|
2011-04-16 20:42:16 +00:00
|
|
|
case data
|
|
|
|
# test for cd/dvd
|
|
|
|
x=`{sed '/([Cc][Dd]|[Dd][Vv][Dd])/!d' $disk^/ctl}
|
|
|
|
if(! ~ $#x 0)
|
|
|
|
must 9660srv -f $disk^/$fstype boot >/dev/null >[2=1]
|
|
|
|
case *
|
|
|
|
fatal unknown partition $fstype
|
|
|
|
}
|
|
|
|
}
|