From: Colin Guthrie Date: Wed, 30 Nov 2011 22:21:24 +0000 (+0000) Subject: Fix Unicode keytable. X-Git-Tag: 015~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95023eb325f899303deaaee7c53d83a41f942340;p=thirdparty%2Fdracut.git Fix Unicode keytable. This patch was originally from Mandriva: dracut-013-fix_unicode_keytable.patch --- diff --git a/modules.d/10i18n/README b/modules.d/10i18n/README index 0507a4793..89339aa32 100644 --- a/modules.d/10i18n/README +++ b/modules.d/10i18n/README @@ -47,6 +47,8 @@ The following variables are used by i18n install script and at initramfs runtime: KEYMAP - keyboard translation table loaded by loadkeys + KEYTABLE - base name for keyboard translation table; if UNICODE is + true, Unicode version will be loaded. Overrides KEYMAP. EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space) UNICODE - boolean, indicating UTF-8 mode FONT - console font diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh index 62486076b..8342fb437 100755 --- a/modules.d/10i18n/module-setup.sh +++ b/modules.d/10i18n/module-setup.sh @@ -110,8 +110,38 @@ install() { [ -f $I18N_CONF ] && . $I18N_CONF [ -f $VCONFIG_CONF ] && . $VCONFIG_CONF + shopt -q -s nocasematch + if [[ ${UNICODE} ]] + then + if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]] + then + UNICODE=1 + elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]] + then + UNICODE=0 + else + UNICODE='' + fi + fi + if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]] + then + UNICODE=1 + fi + shopt -q -u nocasematch + # Gentoo user may have KEYMAP set to something like "-u pl2", KEYMAP=${KEYMAP#-* } + + # KEYTABLE is a bit special - it defines base keymap name and UNICODE + # determines whether non-UNICODE or UNICODE version is used + + if [[ ${KEYTABLE} ]]; then + if [[ ${UNICODE} == 1 ]]; then + [[ ${KEYTABLE} =~ .*\.uni.* ]] || KEYTABLE=${KEYTABLE%.map*}.uni + fi + KEYMAP=${KEYTABLE} + fi + # I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in # original redhat-i18n module. Anyway it won't hurt. EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE} @@ -150,25 +180,6 @@ install() { inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni fi - shopt -q -s nocasematch - if [[ ${UNICODE} ]] - then - if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]] - then - UNICODE=1 - elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]] - then - UNICODE=0 - else - UNICODE='' - fi - fi - if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]] - then - UNICODE=1 - fi - shopt -q -u nocasematch - mksubdirs ${initdir}${I18N_CONF} mksubdirs ${initdir}${VCONFIG_CONF} print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}