~pixelherodev/ANTS

ref: 2983aef452f386128e953ac136c44bbc138e4f18 ANTS/rc/bin/termrc -rwxr-xr-x 2.4 KiB
2983aef4Noam Preil installer: ANTS changes. DEPENDS ON tools.tgz 1 year, 2 months ago
                                                                                
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
90
91
92
93
94
95
96
97
98
99
100
#!/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 u v t m i f S P L A '$')
	bind -a '#'^$i /dev >/dev/null >[2=1]
rm -f /env/i

mount -qb /srv/cons /dev

# 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}

# move factotum from /mnt to /mnt/factotum
mount /srv/factotum /mnt/temp
unmount /srv/factotum /mnt
bind /mnt/temp/factotum /mnt/factotum
unmount /mnt/temp

# usb listener
nusbrc

# 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 sets sysname (termrc.local may already have started it so check)
if(! test -e /srv/cs && ! test -e /net/cs)
	ndb/cs
sysname=`{cat /dev/sysname}
if(~ $#sysname 0 || ~ $sysname ''){
	sysname=cirno			# default
	echo -n $sysname >/dev/sysname
}

# 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 -f /env/disk

# machine specific startup (e.g., for devices not probed)
if(test -e /cfg/$sysname/termrc)
	. /cfg/$sysname/termrc

# automatic ip address setup
if(test -r /net/ipselftab){
	if(! grep u /net/ipselftab | grep -sv '^(127.0.0.1|::1)'){
		addrs=`{ndb/query -a sys $sysname ether}
		if(! ~ $#addrs 0){
			for(ether in /net/ether*){
				addr=`{cat $ether/addr >[2]/dev/null}
				switch($addr){
				case $addrs
					# try /lib/ndb first, then do dhcp/slaac
					ip/ipconfig -6 ether $ether
					ip/ipconfig -N ether $ether >[2]/dev/null || @{
						test -e /env/nora6 || ip/ipconfig ether $ether ra6 recvra 1 &
						ip/ipconfig -h $sysname ether $ether &
						wait
					}
				}
			}
		}
		rm -f /env/ether /env/addrs /env/addr
	}
}

if(! test -e /net/dns)
	ndb/dns -r

if(! ~ $terminal *vx32*){
	# start timesync if it isn't running and we weren't told not to
	if(! ps|grep -s timesync)
		if(! ~ $TIMESYNCARGS '')
			aux/timesync $TIMESYNCARGS
}

# setup mouse and graphics
screenrc

if(test -f /dev/apm)
	aux/apm

dontkill '^(ipconfig|factotum|mntgen|venti|hjfs|fossil|cfs|cwfs.*|9660srv|dossrv|paqfs|cs|dns|listen|reboot|usbd|kb|disk|ether|wpa)$'

home=/usr/$user
cd
. ./lib/profile