terminal 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/cmd/rc
  2. # terminal startup
  3. TIMESYNCARGS=(-rLa1000000)
  4. NDBFILE=/cfg/ndb/local
  5. mntgen -s slashn && chmod 666 /srv/slashn
  6. # bind all likely devices (#S was bound in boot)
  7. for(i in f t m v L P u U '$' Σ κ)
  8. /cmd/bind -a '#'^$i /dev >/dev/null >[2=1]
  9. rm -f /env/i
  10. # set up any partitions
  11. diskparts
  12. # start up local swapping
  13. disk=`{ls /dev/sd*/swap >[2]/dev/null}
  14. if (! ~ $#disk 0)
  15. swap $disk(1) >/dev/null >[2=1]
  16. rm /env/disk
  17. # we do this before we have a name. we may need to do network
  18. # setup so that we can get a name.
  19. if(test -e /arch/rc/cmd/termrc.local)
  20. . /arch/rc/cmd/termrc.local
  21. # cs sets sysname (termrc.local may already have started it so check)
  22. if(! test -e /srv/cs && ! test -e /net/cs)
  23. ndb/cs -f $NDBFILE
  24. sysname=`{cat /dev/sysname}
  25. if (~ $#sysname 0 || ~ $sysname '') {
  26. sysname = jehanne # default
  27. echo -n $sysname >/dev/sysname
  28. }
  29. # machine specific startup (e.g., for devices not probed)
  30. if(test -e /cfg/$sysname/termrc)
  31. . /cfg/$sysname/termrc
  32. # start IP on the LAN, if not already configured. diskless terminals
  33. # are already configured by now. It's commented out to avoid a long timeout
  34. # on startup waiting for DHCP.
  35. #
  36. # If your site provides DHCP service,
  37. #
  38. #if(! test -e /net/ipifc/0/ctl)
  39. # ip/ipconfig
  40. #
  41. # Otherwise, see /cfg/$sysname/termrc (/cfg/example/termrc is an example).
  42. # start dns if we have an internet
  43. if(test -e /net/ipifc/0/ctl && ! test -e /srv/dns)
  44. ndb/dns -r
  45. if(! ~ $terminal *vx32*){
  46. # start timesync if it isn't running and we weren't told not to
  47. if(! ps|grep -s timesync)
  48. if(! ~ $TIMESYNCARGS '')
  49. ip/timesync $TIMESYNCARGS
  50. # add the loop-back medium
  51. if(! grep -s 127.0.0.1 /net/ipselftab)
  52. ip/ipconfig loopback /dev/null 127.1
  53. # set things up for vmware
  54. if(! ~ `{cat /dev/user} none)
  55. if(test -e /cmd/aux/vmware)
  56. aux/vmware
  57. }
  58. # query user if terminal isn't adequately configured yet
  59. if(~ $mouseport ask){
  60. echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
  61. mouseport=`{read}
  62. }
  63. if(~ $#mouseport 0)
  64. mouseport=ps2
  65. if(~ $vgasize ask){
  66. echo -n 'vgasize [1024x768x8]: '
  67. vgasize=`{read}
  68. }
  69. if(~ $#vgasize 0)
  70. vgasize=1024x768x8
  71. if(~ $monitor ask){
  72. echo -n 'monitor is [vesa]: '
  73. monitor=`{read}
  74. }
  75. if(~ $#monitor 0)
  76. monitor=vesa
  77. if(test -f /dev/mousectl){
  78. switch($mouseport){
  79. case ps2 ps2intellimouse 0 1 2
  80. hmi/mouse $mouseport
  81. ms &
  82. # parse vgasize into fields
  83. vgasize=`{echo $vgasize}
  84. if(! ~ $"monitor '' && ! ~ `{cat /dev/user} none) {
  85. hmi/realemu
  86. hmi/vga -m $monitor -l $vgasize
  87. }
  88. if(~ $accupoint 1)
  89. pipefile -dr /cmd/aux/accupoint /dev/mouse
  90. rio -i /lib/riostart
  91. }
  92. }
  93. # usb listener
  94. /arch/rc/aux/usb/usbrc
  95. if (test -f /dev/apm)
  96. aux/apm
  97. dontkill '^(ipconfig|factotum|mntgen|fossil|cs|dns|listen|reboot)$'