diff options
author | Tom Gundersen <teg@jklm.no> | 2012-04-30 13:12:47 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2012-04-30 13:12:47 +0200 |
commit | 222cefd41344f82a88dbf2b4a9480c966884d0e7 (patch) | |
tree | 10048ec213503369d27ec5cf40c2270a6319739e /rc.sysinit | |
parent | 956884005eb831f80853c1e6cfea5c2974a5be2b (diff) |
vconsole: configure the console as early as possible
This makes sure the correct keymap is set before asking users for input
and it avoids (to the extent possible) fonts getting garbled when the font
is set.
Fixes: FS#29646 and FS#25599
Reported-by: Mathieu Pasquet <mathieui@mathieui.net>
Reported-by: <marcin2006@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 74 |
1 files changed, 37 insertions, 37 deletions
@@ -36,6 +36,43 @@ run_hook sysinit_start # log all console messages bootlogd -p /run/bootlogd.pid +if [[ -s /etc/locale.conf ]]; then + parse_envfile /etc/locale.conf "LANG" + [[ $LANG ]] && LOCALE=$LANG +fi +if [[ ${LOCALE,,} =~ utf ]]; then + stat_busy "Setting Consoles to UTF-8 mode" + # UTF-8 consoles are default since 2.6.24 kernel + # this code is needed not only for older kernels, + # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. + for i in /dev/tty[0-9]*; do + kbd_mode -u < ${i} + printf "\e%%G" > ${i} + done + echo 1 >| /sys/module/vt/parameters/default_utf8 + stat_done +else + stat_busy "Setting Consoles to legacy mode" + # make non-UTF-8 consoles work on 2.6.24 and newer kernels + for i in /dev/tty[0-9]*; do + kbd_mode -a < ${i} + printf "\e%%@" > ${i} + done + echo 0 >| /sys/module/vt/parameters/default_utf8 + stat_done +fi + +if [[ -s /etc/vconsole.conf ]]; then + parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" + [[ $FONT ]] && CONSOLEFONT=$FONT + [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP +fi +[[ $KEYMAP ]] && + status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP + +# Set console font if required +set_consolefont + if [[ ! -a /usr/lib ]] ; then printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n" fi @@ -144,43 +181,6 @@ if [[ $HOSTNAME ]]; then echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail fi -if [[ -s /etc/locale.conf ]]; then - parse_envfile /etc/locale.conf "LANG" - [[ $LANG ]] && LOCALE=$LANG -fi -if [[ ${LOCALE,,} =~ utf ]]; then - stat_busy "Setting Consoles to UTF-8 mode" - # UTF-8 consoles are default since 2.6.24 kernel - # this code is needed not only for older kernels, - # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. - for i in /dev/tty[0-9]*; do - kbd_mode -u < ${i} - printf "\e%%G" > ${i} - done - echo 1 >| /sys/module/vt/parameters/default_utf8 - stat_done -else - stat_busy "Setting Consoles to legacy mode" - # make non-UTF-8 consoles work on 2.6.24 and newer kernels - for i in /dev/tty[0-9]*; do - kbd_mode -a < ${i} - printf "\e%%@" > ${i} - done - echo 0 >| /sys/module/vt/parameters/default_utf8 - stat_done -fi - -if [[ -s /etc/vconsole.conf ]]; then - parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" - [[ $FONT ]] && CONSOLEFONT=$FONT - [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP -fi -[[ $KEYMAP ]] && - status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP - -# Set console font if required -set_consolefont - stat_busy "Saving dmesg Log" if [[ -e /proc/sys/kernel/dmesg_restrict ]] && (( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then |