/[baselayout]/trunk/init.d/consolefont
Gentoo

Contents of /trunk/init.d/consolefont

Parent Directory Parent Directory | Revision Log Revision Log


Revision 484 - (show annotations) (download)
Wed Apr 21 17:09:18 2004 UTC (15 years, 2 months ago) by vapier
File size: 1823 byte(s)
update copyright years

1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Technologies, Inc.
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 depend() {
7 need localmount
8 after hotplug
9 }
10
11 start() {
12 local x=
13 local param=
14 local sf_param=
15 local retval=1
16
17 if [ -n "${CONSOLEFONT}" ]
18 then
19 # Getting additional parameters, ie consoletranslation
20 if [ -n "${CONSOLETRANSLATION}" ]
21 then
22 param="-m ${CONSOLETRANSLATION}"
23 fi
24
25 # Actually setting font
26 if [ -x /bin/setfont ]
27 then
28 ebegin "Setting user font"
29
30 # We patched setfont to have --tty support ...
31 if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" -o \
32 -n "`setfont --help 2>&1 | grep -e '-C'`" ]
33 then
34 if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" ]
35 then
36 sf_param="--tty="
37 else
38 sf_param="-C "
39 fi
40
41 for x in $(seq 1 "${RC_TTY_NUMBER}")
42 do
43 # Using DEVFS ?
44 if [ -e /dev/.devfsd ] || \
45 [ -e /dev/.udev -a -d /dev/vc ]
46 then
47 /bin/setfont ${CONSOLEFONT} ${param} \
48 ${sf_param}/dev/vc/${x} >/dev/null
49 retval=$?
50 else
51 /bin/setfont ${CONSOLEFONT} ${param} \
52 ${sf_param}/dev/tty${x} >/dev/null
53 retval=$?
54 fi
55 done
56 else
57 /bin/setfont ${CONSOLEFONT} ${param} >/dev/null
58 retval=$?
59 fi
60 else
61 # No console program installed!
62 eend 1 "The setfont executable was not found"
63 return 1
64 fi
65
66 if [ "${retval}" -eq 0 ]
67 then
68 for x in $(seq 1 "${RC_TTY_NUMBER}")
69 do
70 # Using DEVFS ?
71 if [ -e /dev/.devfsd ] || \
72 [ -e /dev/.udev -a -d /dev/vc ]
73 then
74 echo -ne "\033(K" >/dev/vc/${x}
75 else
76 echo -ne "\033(K" >/dev/tty${x}
77 fi
78 done
79 fi
80
81 eend ${retval} "Failed to set user font"
82 else
83 ebegin "Using the default console font"
84 eend 0
85 fi
86
87 return ${retval}
88 }
89
90
91 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20