cpurc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/bin/rc
  2. debug=0
  3. #set service to terminal (necessary for factotum, handy for everything else)
  4. service=terminal
  5. echo -n terminal > /env/service
  6. echo -n plan9 > /env/site
  7. echo -n astro > /env/facedom
  8. echo -n emelie > /env/fs
  9. bind -a '#y' /dev
  10. bind -a '#F' /dev
  11. bind -a '#I' /net
  12. bind -a '#D' /net
  13. # parallelism for mk
  14. NPROC=1
  15. sysname=`{cat /dev/sysname}
  16. if (~ $sysname ''){
  17. sysname=bitsy
  18. echo $sysname>/dev/sysname
  19. }
  20. prompt=($sysname^'# ' ' ')
  21. # flavor
  22. fileserver=emelie
  23. cpu=olive
  24. # user defined flash partitions
  25. echo -n add fs 0x0800000 0x1000000 > /dev/flash/flashctl
  26. # so we can see things
  27. light 0
  28. # set variables
  29. if(~ $debug 1) echo ramfs
  30. ramfs
  31. if(~ $debug 1) echo pencal
  32. params -f
  33. if(! grep -s '^calibrate=' /tmp/tmpparams)
  34. pencal >>/tmp/tmpparams
  35. if not {
  36. eval `{grep '^calibrate=' /tmp/tmpparams}
  37. echo calibrate $calibrate > '#m/mousectl'
  38. }
  39. prompter /tmp/tmpparams
  40. params
  41. if(~ $debug 1) {
  42. echo tmpparams:
  43. cat /tmp/tmpparams
  44. }
  45. . /tmp/tmpparams
  46. if(~ $debug 1) echo set user
  47. # set userid
  48. if(test -e /env/user){
  49. echo -n $user > /dev/hostowner
  50. }
  51. if(~ $debug 1) echo start flashfs
  52. # bind in read/write file system
  53. if (aux/flashfs) {
  54. if (~ $debug 1) echo flashfs started
  55. mount /srv/brzr /n/tmp
  56. bind -a /n /n/tmp/n
  57. bind -a /sys/lib /n/tmp/sys/lib
  58. bind -a /sys /n/tmp/sys
  59. bind -a /arm/bin/auth /n/tmp/arm/bin/auth
  60. bind -a /arm/bin/ndb /n/tmp/arm/bin/ndb
  61. bind -a /arm/bin/ip /n/tmp/arm/bin/ip
  62. bind -a /arm/bin/aux /n/tmp/arm/bin/aux
  63. bind -a /arm/bin /n/tmp/arm/bin
  64. bind -a /arm /n/tmp/arm
  65. bind -a /lib/ndb /n/tmp/lib/ndb
  66. bind -a /lib/font /n/tmp/lib/font
  67. bind -a /lib /n/tmp/lib
  68. bind -a / /n/tmp
  69. bind /n/tmp /
  70. unmount /n/tmp
  71. } >[2] /dev/null
  72. # start network
  73. if(grep -s WaveLAN/IEEE /dev/pcm0ctl){
  74. if (~ $debug 1) echo 'configure #l0 wavelan'
  75. echo -n 'configure #l0 wavelan'>/dev/pcm0ctl
  76. bind -a '#l0' /net
  77. switch($wvkey1){
  78. case ''
  79. ;
  80. case *
  81. echo -n 'key1 '^$wvkey1 >/net/ether0/clone
  82. }
  83. switch($wvkey2){
  84. case ''
  85. ;
  86. case *
  87. echo -n 'key2 '^$wvkey2 >/net/ether0/clone
  88. }
  89. switch($wvkey3){
  90. case ''
  91. ;
  92. case *
  93. echo -n 'key3 '^$wvkey3 >/net/ether0/clone
  94. }
  95. switch($wvtxkey){
  96. case ''
  97. ;
  98. case *
  99. echo -n 'txkey '^$wvtxkey >/net/ether0/clone
  100. }
  101. switch($wvmode){
  102. case ''
  103. ;
  104. case *
  105. echo -n 'mode '^$wvmode >/net/ether0/clone
  106. }
  107. switch($wvibss){
  108. case ''
  109. ;
  110. case *
  111. echo -n 'ibss '^$wvibss >/net/ether0/clone
  112. }
  113. switch($wvessid){
  114. case ''
  115. ;
  116. case *
  117. echo -n 'essid '^$wvessid >/net/ether0/clone
  118. }
  119. switch($wvcrypt){
  120. case ''
  121. ;
  122. case *
  123. echo -n 'crypt '^$wvcrypt >/net/ether0/clone
  124. }
  125. if (~ $debug 1) echo ip/ipconfig ether /net/ether0 $ipaddr $ipmask
  126. ip/ipconfig ether /net/ether0 $ipaddr $ipmask
  127. if(test -e /env/auth)
  128. echo ' auth='^$auth >>/net/ndb
  129. if(test -e /env/dns)
  130. echo ' dns='^$dns >>/net/ndb
  131. if(test -e /env/dnsdomain)
  132. echo ' dnsdomain='^$dnsdomain >>/net/ndb
  133. if(test -e /env/authdom)
  134. echo ' authdom='^$authdom >>/net/ndb
  135. if (~ $debug 1) echo ndb/cs
  136. ndb/cs
  137. ndb/dns -r
  138. }
  139. auth/factotum -n -s factotum -a $auth
  140. if(! test -e /env/font)
  141. font=/lib/font/bit/lucidasans/unicode.6.font
  142. if(! test -e /env/tabstop)
  143. tabstop=2
  144. if (test -d /usr/$user) {
  145. home=/usr/$user
  146. cd $home
  147. if (test -r lib/profile) {
  148. . lib/profile
  149. exec /bin/rc
  150. }
  151. if (test -r lib/windows) {
  152. if (~ $debug 1) echo 'exec rio -sk ''/bin/keyboard -l'' -i '$home'/lib/windows'
  153. exec rio -sk '/bin/keyboard -l -w' -i $home/lib/windows
  154. }
  155. }
  156. # bind in read/write file system
  157. if (~ $debug 1) echo 'exec rio -sk ''/bin/keyboard -l'''
  158. exec rio -sk '/bin/keyboard -l -w'