Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / pcvt / Misc / Etc / rc.local
1 #---------------------------------------------------------------------------
2 #
3 #       sample rc.local
4 #       ---------------
5 #
6 #       last edit-date: [Sun Feb 19 19:20:42 1995]
7 #
8 #---------------------------------------------------------------------------
9 #
10 #       NOTE: 
11 #       assumptions:    - 8 screens configured
12 #                       - /dev/ttyv0 ... /dev/ttyv7 exist
13 #
14 #---------------------------------------------------------------------------
15
16 # start xdm on screen 8
17 #xdm_start=YES
18 xdm_start=NO
19
20 # setup german keyboard layout
21 #set_keybd=YES
22 set_keybd=NO
23
24 # setup keyboard delay & rate
25 set_keydr=YES
26 # very fast settings
27 set_keydr_rate=0
28 set_keydr_delay=0
29 #set_keydr=NO
30
31 # constuct a new /etc/motd file
32 construct_motd=NO
33 #construct_motd=YES
34
35 # setup cursor start and end scanline
36 set_cursor=YES
37 #set_cursor=NO
38 # block cursor
39 set_cur_start=0
40 set_cur_end=15
41
42 #-----------------------------------------------------
43 # construct /etc/motd file
44 #-----------------------------------------------------
45
46 if [ X${construct_motd} = X"YES" ]
47 then
48         if [ -f /netbsd ]
49         then
50                 if [ ! -f /etc/motd ]; then
51                         install -c -o root -g wheel -m 664 /dev/null /etc/motd
52                 fi
53                 T=/tmp/_motd
54                 rm -f $T
55                 sysctl -n kern.version | sed 1q > $T
56                 echo "" >> $T
57                 sed '1,/^$/d' < /etc/motd >> $T
58                 cmp -s $T /etc/motd || cp $T /etc/motd
59                 rm -f $T
60                 echo 'runtime link editor directory cache'
61                 ldconfig
62         else
63                 T=/tmp/_motd
64                 rm -f $T
65                 uname -a > $T
66                 echo "" >> $T
67                 sed '1,/^$/d' < /etc/motd >> $T
68                 cp $T /etc/motd
69                 chmod 644 /etc/motd
70                 rm -f $T
71
72         fi
73 fi
74
75 #-----------------------------------------------------
76 # local daemons
77 #-----------------------------------------------------
78
79 echo -n 'starting local daemons:'
80
81 # Kerberos runs ONLY on the Kerberos server machine
82 if [ X${kerberos_server} = X"YES" ]; then
83         echo -n ' kerberos';    kerberos >> /var/log/kerberos.log &
84 fi
85
86 echo '.'
87
88 #-----------------------------------------------------
89 # check for correct driver and driver version matching
90 #-----------------------------------------------------
91
92 if [ -x /usr/sbin/ispcvt ]
93 then
94   if /usr/sbin/ispcvt
95   then
96
97 #--------------------------------------------------
98 # loading fonts into vga
99 #--------------------------------------------------
100     echo 'console driver type: pcvt'
101     if [ -x /usr/sbin/loadfont -a -x /usr/sbin/scon ]
102     then
103       adaptor=`/usr/sbin/scon -a`
104       if [ $adaptor = VGA ]
105       then
106         echo 'loading 25 lines base font into character set 0'
107         /usr/sbin/loadfont -c0 -f/usr/share/misc/pcvtfonts/vt220l.816
108         echo 'loading 25 lines extension font into character set 1'
109         /usr/sbin/loadfont -c1 -f/usr/share/misc/pcvtfonts/vt220h.816
110         echo 'loading 28 lines base font into character set 2'
111         /usr/sbin/loadfont -c2 -f/usr/share/misc/pcvtfonts/vt220l.814
112         echo 'loading 28 lines extension font into character set 3'
113         /usr/sbin/loadfont -c3 -f/usr/share/misc/pcvtfonts/vt220h.814
114         echo 'loading 40 lines base font into character set 4'
115         /usr/sbin/loadfont -c4 -f/usr/share/misc/pcvtfonts/vt220l.810
116         echo 'loading 40 lines extension font into character set 5'
117         /usr/sbin/loadfont -c5 -f/usr/share/misc/pcvtfonts/vt220h.810
118         echo 'loading 50 lines base font into character set 6'
119         /usr/sbin/loadfont -c6 -f/usr/share/misc/pcvtfonts/vt220l.808
120         echo 'loading 50 lines extension font into character set 7'
121         /usr/sbin/loadfont -c7 -f/usr/share/misc/pcvtfonts/vt220h.808
122       elif [ $adaptor = EGA ]
123       then
124         echo 'loading 25 lines base font into character set 0'
125         /usr/sbin/loadfont -c0 -f/usr/share/misc/pcvtfonts/vt220l.814
126         echo 'loading 25 lines extension font into character set 1'
127         /usr/sbin/loadfont -c1 -f/usr/share/misc/pcvtfonts/vt220h.814
128         echo 'loading 35 lines base font into character set 2'
129         /usr/sbin/loadfont -c2 -f/usr/share/misc/pcvtfonts/vt220l.810
130         echo 'loading 35 lines extension font into character set 3'
131         /usr/sbin/loadfont -c3 -f/usr/share/misc/pcvtfonts/vt220h.810
132
133 #        echo 'loading 43 lines base font into character set 2'
134 #        /usr/sbin/loadfont -c2 -f/usr/share/misc/pcvtfonts/vt220l.808
135 #        echo 'loading 43 lines extension font into character set 3'
136 #        /usr/sbin/loadfont -c3 -f/usr/share/misc/pcvtfonts/vt220h.808
137
138       fi
139     fi
140
141 #--------------------------------------------------
142 # setting screen sizes and emulation
143 #--------------------------------------------------
144     if [ -x /usr/sbin/scon ]
145     then
146       if [ $adaptor = VGA ]
147       then
148         size=-s28
149         echo 'switching to 28 lines and VT/HP-emulation'
150       elif [ $adaptor = EGA ]
151       then
152         size=-s25
153         echo 'switching to 25 lines and VT/HP-emulation'
154       else
155         size=
156         echo 'switching to VT/HP-emulation'
157       fi
158
159 # get monitor type (mono/color)
160
161       monitor=`/usr/sbin/scon -m`
162
163 # for all screens do
164
165       for device in /dev/ttyv*
166       do
167
168 # setup HP mode
169
170         /usr/sbin/scon -d$device $size -H
171
172 # setup cursor size
173
174         if [ X${set_cursor} = X"YES" -a -x /usr/sbin/cursor ]
175         then
176           /usr/sbin/cursor -d$device -s$set_cur_start -e$set_cur_end
177         fi
178
179 # if monochrome monitor, set color palette to use a higher intensity
180
181         if [ $monitor = MONO ]
182         then
183           if [ $adaptor = VGA ]
184           then
185             /usr/sbin/scon -d$device -p8,60,60,60
186           fi
187         fi
188       done
189
190 # switch to screen 0
191
192       /usr/sbin/scon -c0
193
194 # set screensaver timeout to one minute
195
196       /usr/sbin/scon -t360
197     fi
198
199 #------------------------------------------------------
200 # if desired, setup keyboard for german keyboard layout
201 #------------------------------------------------------
202
203     if [ X${set_keybd} = X"YES" -a -x /usr/sbin/kcon ]
204     then
205       echo 'switching to german keyboard layout'
206       /usr/sbin/kcon -m de
207     fi
208
209 #------------------------------------------------------
210 # if desired, setup rate and delay keyboard values
211 #------------------------------------------------------
212
213     if [ X${set_keydr} = X"YES" -a -x /usr/sbin/kcon ]
214     then
215       echo setting keyboard typematic rate = $set_keydr_rate and delay = $set_keydr_delay
216       /usr/sbin/kcon -r $set_keydr_rate -d $set_keydr_delay
217     fi
218
219 #--------------------------------------------------
220 # if desired, start xdm on screen 8
221 #--------------------------------------------------
222
223     if [ X${xdm_start} = X"YES" -a -x /usr/X386/bin/xdm ]
224     then
225       /usr/sbin/scon -c 7
226       /usr/X386/bin/xdm
227       sleep 5
228       /usr/sbin/scon -c 0
229     fi
230
231 #--------------------------------------------------
232 # cp /etc/ttys corresponding to console driver
233 #--------------------------------------------------
234
235     if [ -f /etc/ttys.pcvt ]
236     then
237       echo 'copying /etc/ttys.pcvt -> /etc/ttys'
238       cp /etc/ttys.pcvt /etc/ttys
239     fi
240
241   else
242     echo 'console driver type: not pcvt or pcvt utility/driver mismatch:'
243     echo '--------------------------------------------------------------'
244     /usr/sbin/ispcvt -v
245     echo '--------------------------------------------------------------'
246     if [ -f /etc/ttys.pccons ]
247     then
248       echo 'copying /etc/ttys.pccons -> /etc/ttys'
249       cp /etc/ttys.pccons /etc/ttys
250     fi
251   fi
252 else
253   echo 'console driver type: not pcvt'
254   if [ -f /etc/ttys.pccons ]
255   then
256     echo 'copying /etc/ttys.pccons -> /etc/ttys'
257     cp /etc/ttys.pccons /etc/ttys
258   fi
259 fi
260
261 echo
262
263 # EOF ----------------------------------------------------------------------
264