2 # this file is run if service=terminal
3 TIMESYNCARGS=(-rLa1000000)
5 # bind all likely devices
6 for(i in S f k t m i v L P u U A '$' Σ κ)
7 bind -a '#'^$i /dev >/dev/null >[2=1]
10 mount -qb /srv/cons /dev
12 # mount points (if not done by bootrc already)
14 mntgen -s slashn /n && chmod 666 /srv/slashn
15 mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
16 mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
18 # move factotum from /mnt to /mnt/factotum
19 mount /srv/factotum /mnt/temp
20 unmount /srv/factotum /mnt
21 bind /mnt/temp/factotum /mnt/factotum
27 # set up any partitions
30 # start up local swapping
31 disk=`{ls /dev/sd*/swap >[2]/dev/null}
33 swap $disk(1) >/dev/null >[2=1]
36 # we do this before we have a name. we may need to do network
37 # setup so that we can get a name.
38 if(test -e /rc/bin/termrc.local)
39 . /rc/bin/termrc.local
41 # cs sets sysname (termrc.local may already have started it so check)
42 if(! test -e /srv/cs && ! test -e /net/cs)
44 sysname=`{cat /dev/sysname}
45 if(~ $#sysname 0 || ~ $sysname ''){
46 sysname=cirno # default
47 echo -n $sysname >/dev/sysname
51 NPROC=`{wc -l </dev/sysstat}
53 # machine specific startup (e.g., for devices not probed)
54 if(test -e /cfg/$sysname/termrc)
55 . /cfg/$sysname/termrc
57 # automatic ip address setup
58 if(test -r /net/ipselftab){
59 if(! grep u /net/ipselftab | grep -sv 127.0.0.1){
60 ether=`{ndb/query sys $sysname ether}
62 # try /lib/ndb first, then do dhcp
63 ip/ipconfig -N >[2]/dev/null || ip/ipconfig -h $sysname
69 if(! test -e /net/dns)
72 if(! ~ $terminal *vx32*){
73 # start timesync if it isn't running and we weren't told not to
74 if(! ps|grep -s timesync)
75 if(! ~ $TIMESYNCARGS '')
76 aux/timesync $TIMESYNCARGS
79 # setup mouse and graphics
85 dontkill '^(ipconfig|factotum|mntgen|venti|hjfs|kfs|cfs|cwfs.*|9660srv|dossrv|paqfs|cs|dns|listen|reboot|usbd|kb|disk|ether|wpa)$'