1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
7 D.13. /etc/rc.d/init.d/console
9 <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
10 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
11 <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
12 "text/css" media="print" />
14 <body class="lfs" id="lfs-7.2">
15 <div class="navheader">
17 Linux From Scratch - Version 7.2
20 付録 D. ブートスクリプトと sysconfig スクリプト version-20120901
24 <a accesskey="p" href="apds12.html" title=
25 "/etc/rc.d/init.d/cleanfs">前のページ</a>
27 /etc/rc.d/init.d/cleanfs
31 <a accesskey="n" href="apds14.html" title=
32 "/etc/rc.d/init.d/localnet">次のページ</a>
34 /etc/rc.d/init.d/localnet
38 <a accesskey="u" href="scripts.html" title=
39 "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
42 <a accesskey="h" href="../index.html" title=
43 "Linux From Scratch - Version 7.2">ホーム</a>
47 <div class="wrap" lang="ja" xml:lang="ja">
49 <a id="console" name="console"></a>D.13. /etc/rc.d/init.d/console
53 ########################################################################
56 # Description : Sets keymap and screen font
58 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
59 # Alexander E. Patrakov
60 # DJ Lucas - dj@linuxfromscratch.org
61 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
65 ########################################################################
70 # Should-Start: $local_fs
75 # Short-Description: Sets up a localised console.
76 # Description: Sets up fonts and language settings for the user's
77 # local as defined by /etc/sysconfig/console.
78 # X-LFS-Provided-By: LFS
81 . /lib/lsb/init-functions
83 # Native English speakers probably don't have /etc/sysconfig/console at all
84 [ -r /etc/sysconfig/console ] && . /etc/sysconfig/console
88 [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
95 # See if we need to do anything
96 if [ -z "${KEYMAP}" ] && [ -z "${KEYMAP_CORRECTIONS}" ] &&
97 [ -z "${FONT}" ] && [ -z "${LEGACY_CHARSET}" ] &&
98 ! is_true "${UNICODE}"; then
102 # There should be no bogus failures below this line!
103 log_info_msg "Setting up Linux console..."
105 # Figure out if a framebuffer console is used
106 [ -d /sys/class/graphics/fb0 ] && use_fb=1 || use_fb=0
108 # Figure out the command to set the console into the
110 is_true "${UNICODE}" &&
111 MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" ||
112 MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a"
114 # On framebuffer consoles, font has to be set for each vt in
115 # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
117 ! is_true "${use_fb}" || [ -z "${FONT}" ] ||
118 MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}"
120 # Apply that command to all consoles mentioned in
121 # /etc/inittab. Important: in the UTF-8 mode this should
122 # happen before setfont, otherwise a kernel bug will
123 # show up and the unicode map of the font will not be
126 for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
127 grep -o '\btty[[:digit:]]*\b'`
129 openvt -f -w -c ${TTY#tty} -- \
130 /bin/sh -c "${MODE_COMMAND}" || failed=1
133 # Set the font (if not already set above) and the keymap
134 [ "${use_fb}" == "1" ] || [ -z "${FONT}" ] || setfont $FONT || failed=1
136 [ -z "${KEYMAP}" ] ||
137 loadkeys ${KEYMAP} >/dev/null 2>&1 ||
140 [ -z "${KEYMAP_CORRECTIONS}" ] ||
141 loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 ||
144 # Convert the keymap from $LEGACY_CHARSET to UTF-8
145 [ -z "$LEGACY_CHARSET" ] ||
146 dumpkeys -c "$LEGACY_CHARSET" | loadkeys -u >/dev/null 2>&1 ||
149 # If any of the commands above failed, the trap at the
150 # top would set $failed to 1
158 echo "Usage: ${0} {start}"
166 <div class="navfooter">
169 <a accesskey="p" href="apds12.html" title=
170 "/etc/rc.d/init.d/cleanfs">前のページ</a>
172 /etc/rc.d/init.d/cleanfs
176 <a accesskey="n" href="apds14.html" title=
177 "/etc/rc.d/init.d/localnet">次のページ</a>
179 /etc/rc.d/init.d/localnet
183 <a accesskey="u" href="scripts.html" title=
184 "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
187 <a accesskey="h" href="../index.html" title=
188 "Linux From Scratch - Version 7.2">ホーム</a>