]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/console
2 ########################################################################
3 # Begin $rc_base/init.d/console
5 # Description : Sets keymap and screen font
7 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
8 # Alexander E. Patrakov
14 ########################################################################
18 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/main
/settings
)
20 if [ "$LANGUAGE" == "de" ]; then
22 KEYMAP_CORRECTIONS
="euro2"
23 LEGACY_CHARSET
="iso-8859-15"
24 #FONT="LatArCyrHeb-16 -m 8859-15"
25 FONT
="lat0-16 -m 8859-15"
29 KEYMAP_CORRECTIONS
="euro2"
36 [ "$1" = "1" ] ||
[ "$1" = "yes" ] ||
[ "$1" = "true" ]
44 boot_mesg
"Setting up Linux console..."
45 # There should be no bogus failures below this line!
47 # Figure out if a framebuffer console is used
48 [ -d /sys
/class
/graphics
/fb0
] && USE_FB
=1 || USE_FB
=0
50 # Figure out the command to set the console into the
52 is_true
"${UNICODE}" &&
53 MODE_COMMAND
="echo -en '\033%G' && kbd_mode -u" ||
54 MODE_COMMAND
="echo -en '\033%@\033(K' && kbd_mode -a"
56 # On framebuffer consoles, font has to be set for each vt in
57 # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
59 ! is_true
"${USE_FB}" ||
[ -z "${FONT}" ] ||
60 MODE_COMMAND
="${MODE_COMMAND} && setfont ${FONT}"
62 # Apply that command to all consoles mentioned in
63 # /etc/inittab. Important: in the UTF-8 mode this should
64 # happen before setfont, otherwise a kernel bug will
65 # show up and the unicode map of the font will not be
67 # FIXME: Fedora Core also initializes two spare consoles
70 for TTY
in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
71 grep -o '\btty[[:digit:]]*\b'`
73 openvt
-f -w -c ${TTY#tty} -- \
74 /bin
/sh
-c "${MODE_COMMAND}"
77 # Set the font (if not already set above) and the keymap
78 is_true
"${USE_FB}" ||
[ -z "${FONT}" ] || setfont
$FONT
79 [ -z "${KEYMAP}" ] || loadkeys
${KEYMAP} &>/dev
/null
80 [ -z "${KEYMAP_CORRECTIONS}" ] ||
81 loadkeys
${KEYMAP_CORRECTIONS} &>/dev
/null
83 # Linux kernel generates wrong bytes when composing
84 # in Unicode mode. That's why we disable dead keys in Unicode
85 # mode by default. If you need them, download and apply
86 # http://www.linuxfromscratch.org/~alexander/patches/linux-2.6.12.5-utf8_input-2.patch
87 # After patching, add "-m charset_of_your_keymap" to the FONT
88 # variable and set BROKEN_COMPOSE=false
89 # in /etc/sysconfig/console
91 [ -n "$BROKEN_COMPOSE" ] || BROKEN_COMPOSE
="$UNICODE"
92 ! is_true
"$BROKEN_COMPOSE" ||
93 echo "" | loadkeys
-c &>/dev
/null
95 # Convert the keymap from $LEGACY_CHARSET to UTF-8
96 [ -z "$LEGACY_CHARSET" ] ||
97 dumpkeys
-c "$LEGACY_CHARSET" | loadkeys
-u &>/dev
/null
99 # If any of the commands above failed, the trap at the
100 # top would set $failed to 1
105 echo $
"Usage:" "${0} {start}"
110 # End $rc_base/init.d/console