summaryrefslogtreecommitdiff
path: root/sys/src/9/bitsy/paqfiles/cpurc
blob: fcc6da2d9ac6e08a4e8486b8f69e0f3d807a318e (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/rc

debug=0

#set service to terminal (necessary for factotum, handy for everything else)
service=terminal 

echo -n terminal > /env/service
echo -n plan9 > /env/site
echo -n astro > /env/facedom
echo -n emelie > /env/fs

bind -a '#y' /dev
bind -a '#F' /dev
bind -a '#I' /net
bind -a '#D' /net

# parallelism for mk
NPROC=1

sysname=`{cat /dev/sysname}
if (~ $sysname ''){
	sysname=bitsy
	echo $sysname>/dev/sysname
}
prompt=($sysname^'# ' '	')

# flavor
fileserver=emelie
cpu=olive

# user defined flash partitions
echo -n add fs		0x0800000 0x1000000 > /dev/flash/flashctl

# so we can see things
light 0

# set variables
if(~ $debug 1) echo ramfs
ramfs
if(~ $debug 1) echo pencal
params -f
if(! grep -s '^calibrate=' /tmp/tmpparams)
	pencal >>/tmp/tmpparams
if not {
	eval `{grep '^calibrate=' /tmp/tmpparams}
	echo calibrate $calibrate > '#m/mousectl'
}
prompter /tmp/tmpparams
params
if(~ $debug 1) {
	echo tmpparams:
	cat /tmp/tmpparams
}
. /tmp/tmpparams

if(~ $debug 1) echo set user
# set userid
if(test -e /env/user){
	echo -n $user > /dev/hostowner
}

if(~ $debug 1) echo start flashfs
# bind in read/write file system
if (aux/flashfs) {
	if (~ $debug 1) echo flashfs started
	mount /srv/brzr /n/tmp
	bind -a /n /n/tmp/n
	bind -a /sys/lib /n/tmp/sys/lib
	bind -a /sys /n/tmp/sys
	bind -a /arm/bin/auth /n/tmp/arm/bin/auth
	bind -a /arm/bin/ndb /n/tmp/arm/bin/ndb
	bind -a /arm/bin/ip /n/tmp/arm/bin/ip
	bind -a /arm/bin/aux /n/tmp/arm/bin/aux
	bind -a /arm/bin /n/tmp/arm/bin
	bind -a /arm /n/tmp/arm
	bind -a /lib/ndb /n/tmp/lib/ndb
	bind -a /lib/font /n/tmp/lib/font
	bind -a /lib /n/tmp/lib
	bind -a / /n/tmp
	bind /n/tmp /
	unmount /n/tmp
} >[2] /dev/null

# start network
if(grep -s WaveLAN/IEEE /dev/pcm0ctl){
	if (~ $debug 1) echo 'configure #l0 wavelan'
	echo -n 'configure #l0 wavelan'>/dev/pcm0ctl
	bind -a '#l0' /net
	switch($wvkey1){
	case ''
		;
	case *
		echo -n 'key1 '^$wvkey1 >/net/ether0/clone
	}
	switch($wvkey2){
	case ''
		;
	case *
		echo -n 'key2 '^$wvkey2 >/net/ether0/clone
	}
	switch($wvkey3){
	case ''
		;
	case *
		echo -n 'key3 '^$wvkey3 >/net/ether0/clone
	}
	switch($wvtxkey){
	case ''
		;
	case *
		echo -n 'txkey '^$wvtxkey >/net/ether0/clone
	}
	switch($wvmode){
	case ''
		;
	case *
		echo -n 'mode '^$wvmode >/net/ether0/clone
	}
	switch($wvibss){
	case ''
		;
	case *
		echo -n 'ibss '^$wvibss >/net/ether0/clone
	}
	switch($wvessid){
	case ''
		;
	case *
		echo -n 'essid '^$wvessid >/net/ether0/clone
	}
	switch($wvcrypt){
	case ''
		;
	case *
		echo -n 'crypt '^$wvcrypt >/net/ether0/clone
	}
	if (~ $debug 1) echo ip/ipconfig ether /net/ether0 $ipaddr $ipmask
	ip/ipconfig ether /net/ether0 $ipaddr $ipmask
	if(test -e /env/auth)
		echo '	auth='^$auth >>/net/ndb
	if(test -e /env/dns)
		echo '	dns='^$dns >>/net/ndb
	if(test -e /env/dnsdomain)
		echo '	dnsdomain='^$dnsdomain >>/net/ndb
	if(test -e /env/authdom)
		echo '	authdom='^$authdom >>/net/ndb

	if (~ $debug 1) echo ndb/cs
	ndb/cs
	ndb/dns -r
}

auth/factotum -n -s factotum -a $auth

if(! test -e /env/font)
	font=/lib/font/bit/lucidasans/unicode.6.font
if(! test -e /env/tabstop)
	tabstop=2

if (test -d /usr/$user) {
	home=/usr/$user
	cd $home
	if (test -r lib/profile) {
		. lib/profile
		exec /bin/rc
	}
	if (test -r lib/windows) {
		if (~ $debug 1) echo 'exec rio -sk ''/bin/keyboard -l'' -i '$home'/lib/windows'
		exec rio -sk '/bin/keyboard -l -w' -i $home/lib/windows
	}
}
# bind in read/write file system
if (~ $debug 1) echo 'exec rio -sk ''/bin/keyboard -l'''
exec rio -sk '/bin/keyboard -l -w'