source: bootscripts/contrib/lsb-v3/init.d/console@ 701d318f

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 701d318f was 701d318f, checked in by DJ Lucas <dj@…>, 16 years ago

Removed BROKEN_COMPOSE from lsb-v3 console bootscript.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8696 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.7 KB
Line 
1#!/bin/sh
2# Begin $rc_base/init.d/console
3
4### BEGIN INIT INFO
5# Provides: console
6# Required-Start:
7# Should-Start: $local_fs
8# Required-Stop:
9# Should-Stop:
10# Default-Start: S
11# Default-Stop:
12# Short-Description: Sets up a localised console.
13# Description: Sets up fonts and language settings for the user's
14# local as defined by /etc/sysconfig/console.
15# X-LFS-Default-Start: S70
16# X-LFS-Default-Stop:
17# X-LFS-Provided-By: LFS
18### END INIT INFO
19
20. /lib/lsb/init-functions
21
22MESSAGE="Setting up Linux console..."
23
24# Native English speakers probably don't have /etc/sysconfig/console at all
25if [ -f /etc/sysconfig/console ]
26then
27 . /etc/sysconfig/console
28fi
29
30is_true() {
31 [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
32}
33
34failed=0
35
36case "${1}" in
37 start)
38 # There should be no bogus failures below this line!
39
40 # Figure out if a framebuffer console is used
41 [ -d /sys/class/graphics/fb0 ] && USE_FB=1 || USE_FB=0
42
43 # Figure out the command to set the console into the
44 # desired mode
45 is_true "${UNICODE}" &&
46 MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" ||
47 MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a"
48
49 # On framebuffer consoles, font has to be set for each vt in
50 # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
51
52 ! is_true "${USE_FB}" || [ -z "${FONT}" ] ||
53 MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}"
54
55 # Apply that command to all consoles mentioned in
56 # /etc/inittab. Important: in the UTF-8 mode this should
57 # happen before setfont, otherwise a kernel bug will
58 # show up and the unicode map of the font will not be
59 # used.
60 # FIXME: Fedora Core also initializes two spare consoles
61 # - do we want that?
62
63 for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
64 grep -o '\btty[[:digit:]]*\b'`
65 do
66 openvt -f -w -c ${TTY#tty} -- \
67 /bin/sh -c "${MODE_COMMAND}" || failed=1
68 done
69
70 # Set the font (if not already set above) and the keymap
71 is_true "${USE_FB}" || [ -z "${FONT}" ] ||
72 setfont $FONT ||
73 failed=1
74 [ -z "${KEYMAP}" ] ||
75 loadkeys ${KEYMAP} >/dev/null 2>&1 ||
76 failed=1
77 [ -z "${KEYMAP_CORRECTIONS}" ] ||
78 loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 ||
79 failed=1
80
81 # Convert the keymap from $LEGACY_CHARSET to UTF-8
82 [ -z "$LEGACY_CHARSET" ] ||
83 dumpkeys -c "$LEGACY_CHARSET" |
84 loadkeys -u >/dev/null 2>&1 ||
85 failed=1
86
87 # If any of the commands above failed, the trap at the
88 # top would set $failed to 1
89 ( exit $failed )
90 evaluate_retval standard
91 ;;
92 *)
93 echo $"Usage:" "${0} {start}"
94 exit 1
95 ;;
96esac
97
98# End $rc_base/init.d/console
Note: See TracBrowser for help on using the repository browser.