1 | #!/bin/bash
|
---|
2 | ########################################################################
|
---|
3 | # Begin $rc_base/init.d/unicode
|
---|
4 | #
|
---|
5 | # Description : Setup for Unicode Console
|
---|
6 | #
|
---|
7 | # Authors : Jim Gifford
|
---|
8 | #
|
---|
9 | # Version : 00.00
|
---|
10 | #
|
---|
11 | # Notes : This Script Replaces console script
|
---|
12 | #
|
---|
13 | ########################################################################
|
---|
14 |
|
---|
15 | . /etc/sysconfig/rc
|
---|
16 | . ${rc_functions}
|
---|
17 |
|
---|
18 | if [ -f /etc/sysconfig/unicode ]; then
|
---|
19 | . /etc/sysconfig/unicode
|
---|
20 | fi
|
---|
21 |
|
---|
22 | case "${1}" in
|
---|
23 | start)
|
---|
24 | # Set the font
|
---|
25 | #
|
---|
26 | boot_mesg "Setting Font..."
|
---|
27 | if [ "${FONT_TRANSLATION}" ]; then
|
---|
28 | FONTTRANS="-m ${FONT_TRANSLATION}"
|
---|
29 | fi
|
---|
30 | for ttynum in $(seq 1 12) ; do
|
---|
31 | setfont ${FONT} ${FONTTRANS} -C /dev/tty${ttynum}
|
---|
32 | done
|
---|
33 | evaluate_retval
|
---|
34 |
|
---|
35 | # Load the keymap in UTF-8
|
---|
36 | #
|
---|
37 | boot_mesg "Setting keymap to UTF-8..."
|
---|
38 | if [ "${DUMPKEYS_CHARSET}" ]; then
|
---|
39 | DUMPKEYS_OPTS="-c ${DUMPKEYS_CHARSET}"
|
---|
40 | fi
|
---|
41 | evaluate_retval
|
---|
42 |
|
---|
43 | # Set terminal encoding to UTF-8
|
---|
44 | #
|
---|
45 | if [ "${UNICODE}" = "yes" ] ; then
|
---|
46 | dumpkeys ${DUMPKEYS_OPTS} | loadkeys --unicode
|
---|
47 | TTYENCODE=$'\033%G'
|
---|
48 | TTYMESSAGE=UTF-8
|
---|
49 | else
|
---|
50 | TTYENCODE=$'\033(K'
|
---|
51 | TTYMESSAGE=ASCII
|
---|
52 | fi
|
---|
53 |
|
---|
54 | # Enable multibyte input
|
---|
55 | #
|
---|
56 | boot_mesg "Enabling Multibyte input..."
|
---|
57 | kbd_mode -u
|
---|
58 | evaluate_retval
|
---|
59 |
|
---|
60 | # Setup Keymaps
|
---|
61 | #
|
---|
62 | if [ "${WINDOWS_KEYBOARD}" = "yes" ]; then
|
---|
63 | WINDOWS_KEYMAP=windowkeys
|
---|
64 | fi
|
---|
65 | loadkeys -q ${WINDOW_KEYMAP} ${KEYMAP} ${EXTENDED_KEYMAPS}
|
---|
66 |
|
---|
67 | # Setting up the Terminals
|
---|
68 | #
|
---|
69 | boot_mesg "Setting encoding to ${TTYMESSAGE}.."
|
---|
70 | for ttynum in $(seq 1 12) ; do
|
---|
71 | echo -ne ${TTYENCODE} > /dev/tty${ttynum}
|
---|
72 | done
|
---|
73 | evaluate_retval
|
---|
74 |
|
---|
75 | ;;
|
---|
76 |
|
---|
77 | *)
|
---|
78 | echo "Usage: ${0} {start}"
|
---|
79 | exit 1
|
---|
80 | ;;
|
---|
81 | esac
|
---|
82 |
|
---|
83 | # End $rc_base/init.d/unicode
|
---|