/[vps]/baselayout-vserver/trunk/init.d/consolefont
Gentoo

Contents of /baselayout-vserver/trunk/init.d/consolefont

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Sat Sep 3 16:10:27 2005 UTC (8 years, 10 months ago) by hollow
File size: 1414 byte(s)
import initial baselayout sources (1.12.0_pre8)
1 #!/sbin/runscript
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 depend() {
6 need localmount
7 need keymaps # sets up terminal encoding scheme
8 after hotplug
9 }
10
11 start() {
12 if is_uml_sys ; then
13 ebegin "Setting user font"
14 eend 0
15 return 0
16 elif [[ -z ${CONSOLEFONT} ]] ; then
17 ebegin "Using the default console font"
18 eend 0
19 return 0
20 fi
21
22 local x=
23 local param=
24 local sf_param=
25 local retval=1
26
27 # Get additional parameters
28 if [[ -n ${CONSOLETRANSLATION} ]] ; then
29 param="-m ${CONSOLETRANSLATION}"
30 fi
31
32 # Set the console font
33 local errmsg=""
34 ebegin "Setting user font"
35 if [[ -x /bin/setfont ]] ; then
36 # We patched setfont to have --tty support ...
37 if [[ -n $(setfont --help 2>&1 | grep -e '--tty') || \
38 -n $(setfont --help 2>&1 | grep -e '-C') ]]
39 then
40 if [[ -n $(setfont --help 2>&1 | grep -e '--tty') ]] ; then
41 sf_param="--tty="
42 else
43 sf_param="-C "
44 fi
45 local ttydev=
46 [[ -d /dev/vc ]] \
47 && ttydev=/dev/vc/ \
48 || ttydev=/dev/tty
49
50 for x in $(seq 1 "${RC_TTY_NUMBER}") ; do
51 /bin/setfont ${CONSOLEFONT} ${param} \
52 ${sf_param}/${ttydev}${x} > /dev/null
53 retval=$?
54 done
55 else
56 /bin/setfont ${CONSOLEFONT} ${param} > /dev/null
57 retval=$?
58 fi
59 errmsg="Failed to set user font"
60 else
61 retval=1
62 errmsg="/bin/setfont not found"
63 fi
64 eend ${retval} "${errmsg}"
65 }
66
67
68 # vim:ts=4

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20