2 ########################################################################
5 # Description : Sets keymap and screen font
7 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
8 # Alexander E. Patrakov
9 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
13 ########################################################################
20 # Should-Start: $local_fs
25 # Short-Description: Sets up a localised console.
26 # Description: Sets up fonts and language settings for the user's
27 # local as defined by /etc/sysconfig/console.
28 # X-LFS-Provided-By: LFS
31 # Native English speakers probably don't have /etc/sysconfig/console at all
32 if [ -r /etc
/sysconfig
/console
]; then
33 .
/etc
/sysconfig
/console
39 [ "$1" = "1" ] ||
[ "$1" = "yes" ] ||
[ "$1" = "true" ]
46 boot_mesg
"Setting up Linux console..."
47 # There should be no bogus failures below this line!
49 # Figure out if a framebuffer console is used
50 [ -d /sys
/class
/graphics
/fb0
] && USE_FB
=1 || USE_FB
=0
52 # Figure out the command to set the console into the
54 is_true
"${UNICODE}" &&
55 MODE_COMMAND
="${ECHO} -en '\033%G' && kbd_mode -u" ||
56 MODE_COMMAND
="${ECHO} -en '\033%@\033(K' && kbd_mode -a"
58 # On framebuffer consoles, font has to be set for each vt in
59 # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
61 ! is_true
"${USE_FB}" ||
[ -z "${FONT}" ] ||
62 MODE_COMMAND
="${MODE_COMMAND} && setfont ${FONT}"
64 # Apply that command to all consoles mentioned in
65 # /etc/inittab. Important: in the UTF-8 mode this should
66 # happen before setfont, otherwise a kernel bug will
67 # show up and the unicode map of the font will not be
69 # FIXME: Fedora Core also initializes two spare consoles
72 for TTY
in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
73 grep -o '\btty[[:digit:]]*\b'`
75 openvt
-f -w -c ${TTY#tty} -- \
76 /bin
/sh
-c "${MODE_COMMAND}" || failed
=1
79 # Set the font (if not already set above) and the keymap
80 is_true
"${USE_FB}" ||
[ -z "${FONT}" ] ||
84 loadkeys
${KEYMAP} >/dev
/null
2>&1 ||
86 [ -z "${KEYMAP_CORRECTIONS}" ] ||
87 loadkeys
${KEYMAP_CORRECTIONS} >/dev
/null
2>&1 ||
90 # Convert the keymap from $LEGACY_CHARSET to UTF-8
91 [ -z "$LEGACY_CHARSET" ] ||
92 dumpkeys
-c "$LEGACY_CHARSET" |
93 loadkeys
-u >/dev
/null
2>&1 ||
96 # If any of the commands above failed, the trap at the
97 # top would set $failed to 1
102 echo $
"Usage:" "${0} {start}"