Revert "cfg/startup: start as terminal"

This reverts commit 0117b7d6b2.
This commit is contained in:
Giacomo Tesio 2016-11-29 23:13:24 +01:00
parent 0117b7d6b2
commit bb58ca33aa
1 changed files with 64 additions and 93 deletions

View File

@ -1,116 +1,87 @@
#!/cmd/rc #!/cmd/rc
# terminal startup # cpu server start up
TIMESYNCARGS=(-rLa1000000) date > /env/boottime
NDBFILE=/cfg/ndb/local
# mount points
mntgen -s slashn && chmod 666 /srv/slashn mntgen -s slashn && chmod 666 /srv/slashn
# bind all likely devices (#S was bound in boot) # name translation, cs sets /dev/sysname
for(i in f t m v L P u U '$' Σ κ) ndb/cs
/cmd/bind -a '#'^$i /dev >/dev/null >[2=1]
rm -f /env/i
# set up any partitions
diskparts
# start up local swapping
disk=`{ls /dev/sd*/swap >[2]/dev/null}
if (! ~ $#disk 0)
swap $disk(1) >/dev/null >[2=1]
rm /env/disk
# we do this before we have a name. we may need to do network
# setup so that we can get a name.
if(test -e /arch/rc/cmd/termrc.local)
. /arch/rc/cmd/termrc.local
# cs sets sysname (termrc.local may already have started it so check)
if(! test -e /srv/cs && ! test -e /net/cs)
ndb/cs -f $NDBFILE
sysname=`{cat /dev/sysname} sysname=`{cat /dev/sysname}
# parallelism for mk
NPROC = `{wc -l </dev/sysstat}
# site-specific startup
if(test -e /arch/rc/cmd/cpurc.local)
. /arch/rc/cmd/cpurc.local
if (~ $#sysname 0 || ~ $sysname '') { if (~ $#sysname 0 || ~ $sysname '') {
sysname = jehanne # default sysname = jehanne # default
echo -n $sysname >/dev/sysname echo -n $sysname >/dev/sysname
} }
prompt=($sysname^'# ' ' ')
# machine specific startup (e.g., for devices not probed) # cpu-specific startup
if(test -e /cfg/$sysname/termrc) if(test -e /cfg/$sysname/cpurc)
. /cfg/$sysname/termrc . /cfg/$sysname/cpurc
# start IP on the LAN, if not already configured. diskless terminals # start up internet if we don't already have an address
# are already configured by now. It's commented out to avoid a long timeout if(! grep u /net/ipselftab | grep -sv 127.0.0.1)
# on startup waiting for DHCP. ip/ipconfig
# if(! grep -s 127.0.0.1 /net/ipselftab)
# If your site provides DHCP service, ip/ipconfig loopback /dev/null 127.1
#
#if(! test -e /net/ipifc/0/ctl)
# ip/ipconfig
#
# Otherwise, see /cfg/$sysname/termrc (/cfg/example/termrc is an example).
# start dns if we have an internet # if we're not a server, start a dns resolver
if(test -e /net/ipifc/0/ctl && ! test -e /srv/dns) if(! test -e /srv/dns)
ndb/dns -r ndb/dns -r
if(! ~ $terminal *vx32*){ # If you are on an auth server, start these before listening:
# start timesync if it isn't running and we weren't told not to #
if(! ps|grep -s timesync) # auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
if(! ~ $TIMESYNCARGS '') # auth/cron >>/sys/log/cron >[2=1] &
ip/timesync $TIMESYNCARGS
# add the loop-back medium # keep other bootes processes from creating capabilities
if(! grep -s 127.0.0.1 /net/ipselftab) rm -f '#¤/caphash'
ip/ipconfig loopback /dev/null 127.1
# set things up for vmware # also rename some files on an auth server:
if(! ~ `{cat /dev/user} none) #
if(test -e /cmd/aux/vmware) # if(! test -e /arch/rc/cmd/service.auth/tcp567){
aux/vmware # mv /arch/rc/cmd/service.auth/authsrv.il566 /arch/rc/cmd/service.auth/il566
} # mv /arch/rc/cmd/service.auth/authsrv.tcp567 /arch/rc/cmd/service.auth/tcp567
# mv /arch/rc/cmd/service/il566 /arch/rc/cmd/service/_il566
# mv /arch/rc/cmd/service/tcp567 /arch/rc/cmd/service/_tcp567
# }
# query user if terminal isn't adequately configured yet # netssh
if(~ $mouseport ask){
echo -n 'mouseport is (ps2, ps2intellimouse, 0, 1, 2)[ps2]: '
mouseport=`{read}
}
if(~ $#mouseport 0)
mouseport=ps2
if(~ $vgasize ask){ # start listeners if it hasn't already been done (dicey check)
echo -n 'vgasize [1024x768x8]: ' if(! netstat -n | grep -s 'tcp.*Listen.* (7|9|21|22|23|25|110|113|565|993|17007|17009|17010) .*')
vgasize=`{read} ip/listen -q tcp
}
if(~ $#vgasize 0)
vgasize=1024x768x8
if(~ $monitor ask){ # TODO: Removed until awk works
echo -n 'monitor is [vesa]: ' #if(! ps|grep -s timesync) {
monitor=`{read} # aux/timesync -n pool.ntp.org
} # if (test -e '#r/rtc') @ {
if(~ $#monitor 0) # sleep 10 # let timesync correct the time
monitor=vesa # awk '{print $1}' /dev/time >'#r/rtc' # fix hw clock
# } &
#}
if(test -f /dev/mousectl){ # cpu-specific late startup
switch($mouseport){ if(test -e /cfg/$sysname/cpustart)
case ps2 ps2intellimouse 0 1 2 . /cfg/$sysname/cpustart
hmi/mouse $mouseport
ms &
# parse vgasize into fields
vgasize=`{echo $vgasize}
if(! ~ $"monitor '' && ! ~ `{cat /dev/user} none) {
hmi/realemu
hmi/vga -m $monitor -l $vgasize
}
if(~ $accupoint 1)
pipefile -dr /cmd/aux/accupoint /dev/mouse
rio -i /lib/riostart
}
}
# usb listener # mode of /proc/*/ctl is inherited across rfork, and sets modes on
/arch/rc/aux/usb/usbrc # other /proc files, such as note, so let listen be killed.
#dontkill '^(ipconfig|factotum|mntgen|venti|fossil|cs|dns|reboot)$'
if (test -f /dev/apm) ip/listen1 -t -v tcp!*!1522 /cmd/hmi/pipeconsole /cmd/rc -m /arch/rc/lib/rcmain -i &
aux/apm if(test ! -e '#s/comconsole')
hmi/comconsole '#t/eia0' /cmd/rc -m/arch/rc/lib/rcmain -i &
dontkill '^(ipconfig|factotum|mntgen|fossil|cs|dns|listen|reboot)$' echo 'key proto=p9sk1 dom=jehanne user=glenda !password=demodemo' >/mnt/factotum/ctl
ip/listen1 -t tcp!*!17010 /cmd/cpu -R &
# echo `{date} $sysname >>/sys/log/boot
exit ''