2 # the 9pcf kernel runs this file
4 TIMESYNCARGS=(-rLa1000000)
7 mntgen -s slashn && chmod 666 /srv/slashn
9 # bind all likely devices
10 for(i in S f k t m i v L P u U '$' Σ κ)
11 bind -a '#'^$i /dev >/dev/null >[2=1]
14 mount -qa /srv/usb /dev
16 # set up any partitions
19 # start up local swapping
20 disk=`{ls /dev/sd*/swap >[2]/dev/null}
22 swap $disk(1) >/dev/null >[2=1]
25 # we do this before we have a name. we may need to do network
26 # setup so that we can get a name.
27 if(test -e /rc/bin/termrc.local)
28 . /rc/bin/termrc.local
30 # cs sets sysname (termrc.local may already have started it so check)
31 if(! test -e /srv/cs && ! test -e /net/cs)
33 sysname=`{cat /dev/sysname}
34 if(~ $#sysname 0 || ~ $sysname ''){
35 sysname=cirno # default
36 echo -n $sysname >/dev/sysname
39 # machine specific startup (e.g., for devices not probed)
40 if(test -e /cfg/$sysname/termrc)
41 . /cfg/$sysname/termrc
43 # start IP on the LAN, if not already configured. diskless terminals
44 # are already configured by now. It's commented out to avoid a long timeout
45 # on startup waiting for DHCP.
47 # If your site provides DHCP service,
49 #if(! test -e /net/ipifc/0/ctl)
52 # Otherwise, see /cfg/$sysname/termrc (/cfg/example/termrc is an example).
54 # start dns if we have an internet
55 if(test -e /net/ipifc/0/ctl && ! test -e /srv/dns)
58 if(! ~ $terminal *vx32*){
59 # start timesync if it isn't running and we weren't told not to
60 if(! ps|grep -s timesync)
61 if(! ~ $TIMESYNCARGS '')
62 aux/timesync $TIMESYNCARGS
64 # add the loop-back medium
65 if(! grep -s 127.0.0.1 /net/ipselftab)
66 ip/ipconfig loopback /dev/null 127.1 >/dev/null >[2=1]
68 # set things up for vmware
69 if(! ~ `{cat /dev/user} none)
70 if(test -e /bin/aux/vmware)
92 ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16
93 if(! ~ $"vgasize '' text none){
94 ask monitor ' is (vesa, xga, lcd, ...)' vesa
96 if(test -f /dev/mousectl)
97 ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2
107 case ps2 ps2intellimouse 0 1 2
110 pipefile -dr /bin/aux/accupoint /dev/mouse
116 if (test -f /dev/apm)
119 dontkill '^(ipconfig|factotum|mntgen|fossil|kfs|cwfs.*|cs|dns|listen|reboot)$'