set better defaults in termrc, set dmamode, allow breaking to rc with !rc

This commit is contained in:
cinap_lenrek 2011-04-14 15:41:59 +00:00
parent bbcfae7fc5
commit 833a3b7d56

View file

@ -9,6 +9,30 @@ mntgen -s slashn && chmod 666 /srv/slashn
for(i in f t m v L P u U '$' Σ κ) for(i in f t m v L P u U '$' Σ κ)
/bin/bind -a '#'^$i /dev >/dev/null >[2=1] /bin/bind -a '#'^$i /dev >/dev/null >[2=1]
fn ask {
if(~ $"$1 ask){
echo -n $1
echo -n $2
echo -n ' ['
echo -n $3
echo -n '] '
$1=`{read}
if(~ $"$1 '!rc'){
rc -i
$1=ask
}
if(~ $#$1 0)
$1=$3
ask $*
}
}
ask dmamode ' is (on, off)' on
if(~ $"dmamode on off){
for(c in `{ls /dev/sd*/ctl >[2]/dev/null})
echo dma $dmamode >$c
}
# set up any partitions # set up any partitions
diskparts diskparts
@ -27,8 +51,8 @@ if(test -e /rc/bin/termrc.local)
if(! test -e /srv/cs && ! test -e /net/cs) if(! test -e /srv/cs && ! test -e /net/cs)
ndb/cs -f $NDBFILE ndb/cs -f $NDBFILE
sysname=`{cat /dev/sysname} sysname=`{cat /dev/sysname}
if (~ $#sysname 0 || ~ $sysname '') { if(~ $#sysname 0 || ~ $sysname ''){
sysname = gnot # default sysname=gnot # default
echo -n $sysname >/dev/sysname echo -n $sysname >/dev/sysname
} }
@ -59,7 +83,7 @@ if(! ~ $terminal *vx32*){
# add the loop-back medium # add the loop-back medium
if(! grep -s 127.0.0.1 /net/ipselftab) if(! grep -s 127.0.0.1 /net/ipselftab)
ip/ipconfig loopback /dev/null 127.1 ip/ipconfig loopback /dev/null 127.1 >/dev/null >[2=1]
# set things up for vmware # set things up for vmware
if(! ~ `{cat /dev/user} none) if(! ~ `{cat /dev/user} none)
@ -67,40 +91,26 @@ if(! ~ $terminal *vx32*){
aux/vmware aux/vmware
} }
# query user if terminal isn't adequately configured yet ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16
if(~ $mouseport ask){ if(! ~ $"vgasize '' text none){
echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: ' ask monitor ' is (vesa, xga, lcd, ...)' vesa
mouseport=`{read} if(! ~ $"monitor ''){
if(~ $#mouseport 0) if(test -f /dev/mousectl)
mouseport=ps2 ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2
} if not
if(~ $vgasize ask){ mouseport=none
echo -n 'vgasize [640x480x8]: '
vgasize=`{read}
if(~ $#vgasize 0)
vgasize=640x480x8
}
if(~ $monitor ask){
echo -n 'monitor is [xga]: '
monitor=`{read}
if(~ $#monitor 0)
monitor=xga
}
if(test -f /dev/mousectl){
switch($mouseport){
case ps2 ps2intellimouse 0 1 2
aux/mouse $mouseport
# parse vgasize into fields
vgasize=`{echo $vgasize}
@{ @{
rfork n rfork n
if(~ $monitor vesa) if(~ $monitor vesa)
aux/realemu aux/realemu
if(! ~ $"monitor '') aux/vga -l $vgasize
aux/vga -l $vgasize }
switch($mouseport){
case ps2 ps2intellimouse 0 1 2
aux/mouse $mouseport
if(~ $accupoint 1)
pipefile -dr /bin/aux/accupoint /dev/mouse
} }
if(~ $accupoint 1)
pipefile -dr /bin/aux/accupoint /dev/mouse
} }
} }
@ -108,4 +118,4 @@ usbstart
if (test -f /dev/apm) if (test -f /dev/apm)
aux/apm aux/apm
dontkill '^(ipconfig|factotum|mntgen|fossil|cs|dns|listen|reboot)$' dontkill '^(ipconfig|factotum|mntgen|fossil|kfs|cwfs|cs|dns|listen|reboot)$'