#!/bin/rc
echo -n cpu > /env/service
date > /env/boottime

# replace FILESERVER with the name of your file server
# here we start with kfs, your local disk file system
fileserver=vampira
# replace FACEDOM with the local domain to be used in the faces database
facedom=FACEDOM

for(i in v f t m i L S)
	/bin/bind -a '#'^$i /dev >/dev/null >[2=1]
for(disk in /dev/sd??) {
	disk/fdisk -p $disk/data >$disk/ctl >[2]/dev/null
	for(part in $disk/plan9*)
		if(test -f $part)
			disk/prep -p $part >$disk/ctl >[2]/dev/null
}
if(test -f /dev/mousectl){
	switch($mouseport){
	case ps2 ps2intellimouse 0 1 2
		aux/mouse $mouseport

		# parse vgasize into fields
		vgasize=`{echo $vgasize}

		if(! ~ $monitor '' && ! ~ `{cat /dev/user} none){
			aux/vga -l $vgasize
			# turn off hardware acceleration until you know it's ok.
# echo -n 'hwaccel off' >'#v/vgactl' >[2]/dev/null
		}
	}
}
if(test -f /dev/sd*/swap){
	x=(`{echo /dev/sd*/swap})
	swap $x(1) >/dev/null >[2=1]
}
if(test -f /dev/sd*/dos*){
	dossrv
	c:
}




# mount mail uncached
mount -c /srv/boot /n/termrc.tmp
bind -c /n/termrc.tmp/mail /mail
unmount /n/termrc.tmp

sysname=bela
ip/ipconfig -g 128.165.147.254 ether /net/ether0 128.165.147.110 255.255.255.0
# name translation, cs sets /dev/sysname
ndb/cs
#sysname=`{cat /dev/sysname}
#ip/ipconfig > /dev/null >[2=1]
ndb/dns -r
aux/timesync -rL

# parallelism for mk
NPROC=`{wc -l /dev/sysstat}
NPROC=`{echo $NPROC|sed 's/ .*//'}

prompt=($sysname^'# ' ' ')

#aux/timesync -nl -d /sys/log/timesync.d

# uncomment the following for booting other systems
ip/dhcpd
ip/tftpd

# services available to networks
#aux/listen -q -d /rc/bin/service il
#aux/listen -q -d /rc/bin/service tcp

# run these instead of the above two if you are an auth server
# also be sure to remove /rc/bin/service/il566 and tcp567
#
auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
aux/listen -q -d /rc/bin/service -t /rc/bin/service.auth il
aux/listen -q -d /rc/bin/service -t /rc/bin/service.auth tcp
auth/cron >>/sys/log/cron >[2=1] &

rio
#