boot(8): kfs support
This commit is contained in:
parent
e1f905846a
commit
a455c61024
2 changed files with 20 additions and 30 deletions
|
@ -31,6 +31,13 @@ fn must {
|
||||||
$* || fatal $"*^': '^$status
|
$* || fatal $"*^': '^$status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn devinit{
|
||||||
|
bind -qa '#c' /dev
|
||||||
|
bind -qa '#S' /dev
|
||||||
|
bind -qa '#f' /dev
|
||||||
|
bind -qa '#k' /dev
|
||||||
|
bind -qa '#æ' /dev
|
||||||
|
}
|
||||||
|
|
||||||
fn usbinit{
|
fn usbinit{
|
||||||
if(test -e '#u'){
|
if(test -e '#u'){
|
||||||
|
@ -134,9 +141,11 @@ fn main{
|
||||||
# connect to the root file system
|
# connect to the root file system
|
||||||
$mp($connect)
|
$mp($connect)
|
||||||
|
|
||||||
mount -c /srv/boot /root
|
must mount -c /srv/boot /root
|
||||||
if(~ $pcload 1)
|
if(~ $pcload 1){
|
||||||
echo reboot /root/$kern >/dev/reboot
|
echo reboot /root/$kern >/dev/reboot
|
||||||
|
fatal kernel load failed: $kern
|
||||||
|
}
|
||||||
|
|
||||||
swapproc
|
swapproc
|
||||||
|
|
||||||
|
@ -166,10 +175,14 @@ fn main{
|
||||||
exec $init
|
exec $init
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bind -q '#p' /proc
|
||||||
|
|
||||||
|
devinit
|
||||||
usbinit # set up usb keyboard, mouse, and disk, if any
|
usbinit # set up usb keyboard, mouse, and disk, if any
|
||||||
configlocal # add partitions and binds
|
|
||||||
kbmap
|
kbmap
|
||||||
|
|
||||||
|
configlocal # add partitions and binds
|
||||||
|
|
||||||
while(){
|
while(){
|
||||||
@{rfork n; main}
|
@{rfork n; main}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,5 @@
|
||||||
#!/bin/rc
|
#!/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{
|
fn configlocal{
|
||||||
disk=`{echo $methodarg | sed 's,(.*)!.*,\1,g'}
|
disk=`{echo $methodarg | sed 's,(.*)!.*,\1,g'}
|
||||||
fstype=`{echo $disk | sed 's,.*/(.*)$,\1,g'}
|
fstype=`{echo $disk | sed 's,.*/(.*)$,\1,g'}
|
||||||
|
@ -23,30 +12,18 @@ fn configlocal{
|
||||||
if(~ $#kern 0 || ! ~ $#bootfile 0)
|
if(~ $#kern 0 || ! ~ $#bootfile 0)
|
||||||
kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
|
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
|
diskparts
|
||||||
findcds
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn connectlocal{
|
fn connectlocal{
|
||||||
rm -f /srv/boot
|
rm -f /srv/boot
|
||||||
switch($fstype){
|
switch($fstype){
|
||||||
case fs
|
case kfs fs
|
||||||
connectlocalkfs
|
must disk/kfs -n boot -f $disk^/$fstype
|
||||||
case fscache fsworm
|
case cwfs fscache fsworm w0 w1 w2 w3
|
||||||
must cwfs64x -n boot -f $disk^/$fstype
|
must cwfs64x -n boot -f $disk^/$fstype
|
||||||
case data
|
case data
|
||||||
# test for cd/dvd
|
must 9660srv -f $disk^/$fstype boot
|
||||||
x=`{sed '/([Cc][Dd]|[Dd][Vv][Dd])/!d' $disk^/ctl}
|
|
||||||
if(! ~ $#x 0)
|
|
||||||
must 9660srv -f $disk^/$fstype boot >/dev/null >[2=1]
|
|
||||||
case *
|
case *
|
||||||
fatal unknown partition $fstype
|
fatal unknown partition $fstype
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue