diff --git a/rc/bin/termrc b/rc/bin/termrc index 07de69b99..063a9bc1b 100755 --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -9,6 +9,30 @@ mntgen -s slashn && chmod 666 /srv/slashn for(i in f t m v L P u U '$' Σ κ) /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 diskparts @@ -27,8 +51,8 @@ if(test -e /rc/bin/termrc.local) if(! test -e /srv/cs && ! test -e /net/cs) ndb/cs -f $NDBFILE sysname=`{cat /dev/sysname} -if (~ $#sysname 0 || ~ $sysname '') { - sysname = gnot # default +if(~ $#sysname 0 || ~ $sysname ''){ + sysname=gnot # default echo -n $sysname >/dev/sysname } @@ -59,7 +83,7 @@ if(! ~ $terminal *vx32*){ # add the loop-back medium 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 if(! ~ `{cat /dev/user} none) @@ -67,40 +91,26 @@ if(! ~ $terminal *vx32*){ aux/vmware } -# query user if terminal isn't adequately configured yet -if(~ $mouseport ask){ - echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: ' - mouseport=`{read} - if(~ $#mouseport 0) - mouseport=ps2 -} -if(~ $vgasize ask){ - 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} +ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16 +if(! ~ $"vgasize '' text none){ + ask monitor ' is (vesa, xga, lcd, ...)' vesa + if(! ~ $"monitor ''){ + if(test -f /dev/mousectl) + ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2 + if not + mouseport=none @{ rfork n if(~ $monitor vesa) 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) aux/apm -dontkill '^(ipconfig|factotum|mntgen|fossil|cs|dns|listen|reboot)$' +dontkill '^(ipconfig|factotum|mntgen|fossil|kfs|cwfs|cs|dns|listen|reboot)$'