termrc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/rc
  2. if(~ $#debug 1 && ~ $debug yes)
  3. flag x +
  4. if not
  5. debug=0
  6. if(~ $debug yes) echo env...
  7. sysname=gnot
  8. font=/lib/font/bit/lucidasans/typelatin1.7.font
  9. for (i in '#P' '#f' '#m' '#t' '#v') {
  10. if(~ $debug yes) echo bind $i
  11. bind -a $i /dev >/dev/null >[2=1]
  12. }
  13. if(~ $debug yes) echo binddev done
  14. for(disk in /dev/sd??) {
  15. if(test -f $disk/data && test -f $disk/ctl){
  16. disk/fdisk -p $disk/data >$disk/ctl >[2]/dev/null
  17. # if(~ $#nosddma 0)
  18. # echo dma on >$disk/ctl
  19. # if(~ $#nosdrwm 0)
  20. # echo rwm on >$disk/ctl
  21. }
  22. }
  23. for (i in /sys/log/*) {
  24. if(~ $debug yes) echo bind $i
  25. bind /dev/null $i
  26. }
  27. if(~ $debug yes) echo bindlog done
  28. bind -a '#l' /net >/dev/null >[2=1]
  29. dossrv
  30. boota:
  31. boota: # again, just in case a timeout made the earlier one fail
  32. cp /n/a:/plan9.ini /tmp/plan9.orig
  33. if(! ~ $cdboot yes){
  34. pci >/n/a:/pci.txt >[2]/dev/null
  35. cp /dev/kmesg /n/a:/boot.txt >[2]/dev/null
  36. }
  37. # restore a partial install
  38. if(test -f /n/a:/9inst.cnf)
  39. cp /n/a:/9inst.cnf /tmp/vars
  40. # make vgadb easier to edit
  41. if(test -f /n/a:/vgadb)
  42. cp /n/a:/vgadb /lib/vgadb
  43. aux/vmware
  44. # configure loopback device without touching /net/ndb
  45. {
  46. echo bind loopback /dev/null
  47. echo add 127.0.0.1 255.255.255.0
  48. } >/net/ipifc/clone
  49. if(~ $#dmamode 0)
  50. dmamode=ask
  51. if(~ $dmamode ask){
  52. echo -n 'use DMA for ide drives[yes]: '
  53. dmamode=`{read}
  54. if(~ $#dmamode 0)
  55. dmamode=yes
  56. }
  57. if(~ $dmamode yes)
  58. for(i in /dev/sd*/ctl)
  59. if(test -f $i)
  60. {echo dma on; echo rwm on >[2]/dev/null} >$i
  61. if(~ $installmode ask){
  62. echo -n 'install mode is (text, graphics)[graphics]: '
  63. installmode=`{read}
  64. if(~ $#installmode 0)
  65. installmode=graphics
  66. }
  67. if(~ $installmode text){
  68. mouseport=()
  69. vgasize=()
  70. monitor=()
  71. }
  72. if not
  73. installmode=graphics
  74. if(~ $mouseport ask){
  75. echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
  76. mouseport=`{read}
  77. if(~ $#mouseport 0)
  78. mouseport=ps2
  79. }
  80. if(~ $vgasize ask){
  81. echo -n 'vgasize [640x480x8]: '
  82. vgasize=`{read}
  83. if(~ $#vgasize 0)
  84. vgasize=640x480x8
  85. }
  86. if(~ $monitor ask){
  87. echo -n 'monitor is [xga]: '
  88. monitor=`{read}
  89. if(~ $#monitor 0)
  90. monitor=xga
  91. }
  92. if(~ $#mouseport 1) {
  93. aux/mouse $mouseport
  94. if(~ $#vgasize 1 && ! ~ $vgasize '') {
  95. vgasize=`{echo $vgasize}
  96. if(! ~ $cdboot yes)
  97. aux/vga -vip $vgasize >/n/a:/vgainfo.txt
  98. sleep 2 # wait for floppy to finish
  99. aux/vga -l $vgasize
  100. if(! ~ $#novgaaccel 0)
  101. echo -n 'hwaccel off' >'#v/vgactl' >[2]/dev/null
  102. if(! ~ $#novgablank 0)
  103. echo -n 'hwblank off' >'#v/vgactl' >[2]/dev/null
  104. }
  105. }