blob: 9f9e0052986ac5a5c8a015890232c7b32ba8bb4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#!/bin/rc
# this file is run if service=terminal
TIMESYNCARGS=(-rLa1000000)
# parallelism for mk
NPROC=`{wc -l </dev/sysstat}
# bind all likely devices
for(i in P S f æ t L A J '$')
bind -qa '#'^$i /dev
rm -f /env/i
mount -qb /srv/cons /dev
# serial shell for host-side control
while(){ rc -i </dev/eia0 >/dev/eia0 >[2=1]; sleep 1 }&
# rescue shell on the second uart. eia0 cannot be interrupted: it is a plain
# uart, not the console, so DEL over it is only a byte and the kernel never
# turns it into a note. A command blocked on eia0 can therefore be killed
# only from an independent shell, which is this one.
#
# Both of these are deliberately NOT services. They are the channel you need
# when the supervisor is the thing that is broken, so they must not depend on
# it -- note they start here, above svcinit.
while(){ rc -i </dev/eia1 >/dev/eia1 >[2=1]; sleep 1 }&
# mount points (if not done by bootrc already)
>[2]/dev/null {
mntgen -s slashn /n && chmod 666 /srv/slashn
mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
# now that /mnt exists, mount factotum
mount /srv/factotum /mnt/factotum factotum
bind -q /mnt/factotum/factotum /mnt/factotum
# usb listener
nusbrc
# supervised services. cs, dns and timesync are defined in /lib/svc and
# are started from here on; if svcinit will not run the machine still boots,
# it just has none of them.
if(test -e /amd64/bin/svcinit && test -d /lib/svc)
svcinit -s svc -m /mnt/svcs >>/sys/log/svcinit >[2=1] &
# 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 /rc/bin/termrc.local)
. /rc/bin/termrc.local
# cs is a service; see /lib/svc/cs
sysname=`{cat /dev/sysname}
if(~ $#sysname 0 || ~ $sysname ''){
sysname=cirno # default
echo -n $sysname >/dev/sysname
}
# diskparts is a service; see /lib/svc/diskparts
# start up local swapping
disk=`{ls /dev/sd*/swap >[2]/dev/null}
if (! ~ $#disk 0)
swap $disk(1) >/dev/null >[2=1]
rm -f /env/disk
# machine specific startup (e.g., for devices not probed)
if(test -e /cfg/$sysname/termrc)
. /cfg/$sysname/termrc
# ip configuration is a service; see /lib/svc/ipconfig
# dns is a service; see /lib/svc/dns
# timesync is a service; see /lib/svc/timesync
# setup mouse and graphics
screenrc
if(test -f /dev/apm)
aux/apm
if(~ $terminal *reform*){
reform/pm
reform/audio
}
dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
|