2011-03-30 14:14:36 +00:00
|
|
|
#!/bin/rc
|
2011-05-09 23:07:41 +00:00
|
|
|
# the pccpuf kernel runs this file
|
|
|
|
|
2011-03-30 14:14:36 +00:00
|
|
|
date > /env/boottime
|
|
|
|
|
2011-06-06 01:31:58 +00:00
|
|
|
for(i in m i P S t u '$')
|
|
|
|
bind -a '#'^$i /dev >/dev/null >[2=1]
|
|
|
|
|
|
|
|
mount -qb /srv/cons /dev
|
|
|
|
mount -qa /srv/usb /dev
|
|
|
|
|
2011-03-30 14:14:36 +00:00
|
|
|
# mount points
|
|
|
|
mntgen -s slashn && chmod 666 /srv/slashn
|
|
|
|
|
|
|
|
# name translation, cs sets /dev/sysname
|
|
|
|
ndb/cs
|
|
|
|
sysname=`{cat /dev/sysname}
|
|
|
|
|
|
|
|
# parallelism for mk
|
|
|
|
NPROC = `{wc -l </dev/sysstat}
|
|
|
|
|
|
|
|
if (~ $#sysname 0 || ~ $sysname '') {
|
2011-05-04 23:07:07 +00:00
|
|
|
sysname = cirno # default
|
2011-03-30 14:14:36 +00:00
|
|
|
echo -n $sysname >/dev/sysname
|
|
|
|
}
|
|
|
|
prompt=($sysname^'# ' ' ')
|
|
|
|
|
|
|
|
# cpu-specific startup
|
|
|
|
if(test -e /cfg/$sysname/cpurc)
|
|
|
|
. /cfg/$sysname/cpurc
|
|
|
|
|
|
|
|
# start up internet if we don't already have an address
|
|
|
|
if(! grep u /net/ipselftab | grep -sv 127.0.0.1)
|
|
|
|
ip/ipconfig
|
|
|
|
|
|
|
|
# if we're not a server, start a dns resolver
|
|
|
|
if(! test -e /srv/dns)
|
|
|
|
ndb/dns -r
|
|
|
|
|
|
|
|
# If you are on an auth server, start these before listening:
|
|
|
|
#
|
2011-05-04 18:55:08 +00:00
|
|
|
auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
|
|
|
|
auth/cron >>/sys/log/cron >[2=1] &
|
2011-03-30 14:14:36 +00:00
|
|
|
#
|
|
|
|
# also rename some files:
|
|
|
|
#
|
|
|
|
# if(! test -e /rc/bin/service.auth/tcp567){
|
|
|
|
# mv /rc/bin/service.auth/authsrv.il566 /rc/bin/service.auth/il566
|
|
|
|
# mv /rc/bin/service.auth/authsrv.tcp567 /rc/bin/service.auth/tcp567
|
|
|
|
# mv /rc/bin/service/il566 /rc/bin/service/_il566
|
|
|
|
# mv /rc/bin/service/tcp567 /rc/bin/service/_tcp567
|
|
|
|
# }
|
|
|
|
|
2011-06-06 01:31:58 +00:00
|
|
|
# start listeners
|
|
|
|
aux/listen -q -t /rc/bin/service.auth -d /rc/bin/service tcp
|
2011-03-30 14:14:36 +00:00
|
|
|
|
|
|
|
if(! ps|grep -s timesync) {
|
|
|
|
aux/timesync -n pool.ntp.org
|
|
|
|
if (test -e '#r/rtc') @ {
|
|
|
|
sleep 10 # let timesync correct the time
|
|
|
|
awk '{print $1}' /dev/time >'#r/rtc' # fix hw clock
|
|
|
|
} &
|
|
|
|
}
|
|
|
|
|
|
|
|
# cpu-specific late startup
|
|
|
|
if(test -e /cfg/$sysname/cpustart)
|
|
|
|
. /cfg/$sysname/cpustart
|
|
|
|
|
|
|
|
# mode of /proc/*/ctl is inherited across rfork, and sets modes on
|
|
|
|
# other /proc files, such as note, so let listen be killed.
|
2011-05-10 09:14:30 +00:00
|
|
|
dontkill '^(ipconfig|factotum|mntgen|venti|kfs|cwfs.*|cs|dns|reboot)$'
|
2011-03-30 14:14:36 +00:00
|
|
|
|
|
|
|
# echo `{date} $sysname >>/sys/log/boot
|
|
|
|
exit ''
|