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-6.8">
15 <div class="navheader">
17 Linux From Scratch - Version 6.8
20 付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
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-20100627">上に戻る</a>
42 <a accesskey="h" href="../index.html" title=
43 "Linux From Scratch - Version 6.8">ホーム</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 ########################################################################
54 # Begin $rc_base/init.d/console
56 # Description : Sets keymap and screen font
58 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
59 # Alexander E. Patrakov
65 ########################################################################
70 # Native English speakers probably don't have /etc/sysconfig/console at all
71 if [ -f /etc/sysconfig/console ]
73 . /etc/sysconfig/console
79 [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
86 boot_mesg "Setting up Linux console..."
87 # There should be no bogus failures below this line!
89 # Figure out if a framebuffer console is used
90 [ -d /sys/class/graphics/fb0 ] && USE_FB=1 || USE_FB=0
92 # Figure out the command to set the console into the
94 is_true "${UNICODE}" &&
95 MODE_COMMAND="${ECHO} -en '\033%G' && kbd_mode -u" ||
96 MODE_COMMAND="${ECHO} -en '\033%@\033(K' && kbd_mode -a"
98 # On framebuffer consoles, font has to be set for each vt in
99 # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
101 ! is_true "${USE_FB}" || [ -z "${FONT}" ] ||
102 MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}"
104 # Apply that command to all consoles mentioned in
105 # /etc/inittab. Important: in the UTF-8 mode this should
106 # happen before setfont, otherwise a kernel bug will
107 # show up and the unicode map of the font will not be
109 # FIXME: Fedora Core also initializes two spare consoles
112 for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
113 grep -o '\btty[[:digit:]]*\b'`
115 openvt -f -w -c ${TTY#tty} -- \
116 /bin/sh -c "${MODE_COMMAND}" || failed=1
119 # Set the font (if not already set above) and the keymap
120 is_true "${USE_FB}" || [ -z "${FONT}" ] ||
123 [ -z "${KEYMAP}" ] ||
124 loadkeys ${KEYMAP} >/dev/null 2>&1 ||
126 [ -z "${KEYMAP_CORRECTIONS}" ] ||
127 loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 ||
130 # Convert the keymap from $LEGACY_CHARSET to UTF-8
131 [ -z "$LEGACY_CHARSET" ] ||
132 dumpkeys -c "$LEGACY_CHARSET" |
133 loadkeys -u >/dev/null 2>&1 ||
136 # If any of the commands above failed, the trap at the
137 # top would set $failed to 1
142 echo $"Usage:" "${0} {start}"
147 # End $rc_base/init.d/console
150 <div class="navfooter">
153 <a accesskey="p" href="apds12.html" title=
154 "/etc/rc.d/init.d/cleanfs">前のページ</a>
156 /etc/rc.d/init.d/cleanfs
160 <a accesskey="n" href="apds14.html" title=
161 "/etc/rc.d/init.d/localnet">次のページ</a>
163 /etc/rc.d/init.d/localnet
167 <a accesskey="u" href="scripts.html" title=
168 "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
171 <a accesskey="h" href="../index.html" title=
172 "Linux From Scratch - Version 6.8">ホーム</a>