# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 24 Apr 2008; Chris Gianelloni <wolf31o2@gentoo.org> gen_determineargs.sh,
+ gen_funcs.sh, generic/initrd.scripts, generic/linuxrc:
+ Updated the keymap-handling code so it will be installed and displayed
+ without using --do-auto-keymap with a patch from Florian Schilhabel
+ <fernsehleo@gmx.net> for bug #215822. Also, added a keymap= command line
+ option to allow setting keymap from the bootloader, also from Florian.
+
22 Apr 2008; Chris Gianelloni <wolf31o2@gentoo.org>
generic/initrd.scripts:
Change from using a directory check to a file check. This should fix bug
set_config_with_override 1 KEYMAP CMD_KEYMAP "yes"
set_config_with_override 1 DOKEYMAPAUTO CMD_DOKEYMAPAUTO
- BOOTDIR=`arch_replace "${BOOTDIR}"`
- BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
+ BOOTDIR=`arch_replace "${BOOTDIR}"`
+ BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
if [ -n "${!CfgVar}" ]
then
Result=${!CfgVar}
+ # we need to set the CMD_* according to configfile...
+ eval ${OverrideVar}=\"${Result}\"
print_info 5 " $CfgVar set in config file to \"${Result}\"."
else
if [ -n "$Default" ]
then
Result=${Default}
+ # set OverrideVar to Result, otherwise CMD_* may not be initialized...
+ eval ${OverrideVar}=\"${Result}\"
print_info 5 " $CfgVar defaulted to \"${Result}\"."
else
print_info 5 " $CfgVar not set."
chooseKeymap() {
good_msg "Loading keymaps"
- cat /lib/keymaps/keymapList
- read -t 10 -p '<< Load keymap (Enter for default): ' keymap
- case ${keymap} in
- 1|azerty) keymap=azerty ;;
- 2|be) keymap=be ;;
- 3|bg) keymap=bg ;;
- 4|br-a) keymap=br-a ;;
- 5|br-l) keymap=br-l ;;
- 6|by) keymap=by ;;
- 7|cf) keymap=cf ;;
- 8|croat) keymap=croat ;;
- 9|cz) keymap=cz ;;
- 10|de) keymap=de ;;
- 11|dk) keymap=dk ;;
- 12|dvorak) keymap=dvorak ;;
- 13|es) keymap=es ;;
- 14|et) keymap=et ;;
- 15|fi) keymap=fi ;;
- 16|fr) keymap=fr ;;
- 17|gr) keymap=gr ;;
- 18|hu) keymap=hu ;;
- 19|il) keymap=il ;;
- 20|is) keymap=is ;;
- 21|it) keymap=it ;;
- 22|jp) keymap=jp ;;
- 23|la) keymap=la ;;
- 24|lt) keymap=lt ;;
- 25|mk) keymap=mk ;;
- 26|nl) keymap=nl ;;
- 27|no) keymap=no ;;
- 28|pl) keymap=pl ;;
- 29|pt) keymap=pt ;;
- 30|ro) keymap=ro ;;
- 31|ru) keymap=ru ;;
- 32|se) keymap=se ;;
- 33|sg) keymap=sg ;;
- 34|sk-y) keymap=sk-y ;;
- 35|sk-z) keymap=sk-z ;;
- 36|slovene) keymap=slovene ;;
- 37|trf) keymap=trf ;;
- 38|trq) keymap=trq ;;
- 39|ua) keymap=ua ;;
- 40|uk) keymap=uk ;;
- 41|us) keymap=us ;;
- 42|wangbe) keymap=wangbe ;;
- esac
+ if [ -z "${keymap}" ]
+ then
+ cat /lib/keymaps/keymapList
+ read -t 10 -p '<< Load keymap (Enter for default): ' keymap
+ case ${keymap} in
+ 1|azerty) keymap=azerty ;;
+ 2|be) keymap=be ;;
+ 3|bg) keymap=bg ;;
+ 4|br-a) keymap=br-a ;;
+ 5|br-l) keymap=br-l ;;
+ 6|by) keymap=by ;;
+ 7|cf) keymap=cf ;;
+ 8|croat) keymap=croat ;;
+ 9|cz) keymap=cz ;;
+ 10|de) keymap=de ;;
+ 11|dk) keymap=dk ;;
+ 12|dvorak) keymap=dvorak ;;
+ 13|es) keymap=es ;;
+ 14|et) keymap=et ;;
+ 15|fi) keymap=fi ;;
+ 16|fr) keymap=fr ;;
+ 17|gr) keymap=gr ;;
+ 18|hu) keymap=hu ;;
+ 19|il) keymap=il ;;
+ 20|is) keymap=is ;;
+ 21|it) keymap=it ;;
+ 22|jp) keymap=jp ;;
+ 23|la) keymap=la ;;
+ 24|lt) keymap=lt ;;
+ 25|mk) keymap=mk ;;
+ 26|nl) keymap=nl ;;
+ 27|no) keymap=no ;;
+ 28|pl) keymap=pl ;;
+ 29|pt) keymap=pt ;;
+ 30|ro) keymap=ro ;;
+ 31|ru) keymap=ru ;;
+ 32|se) keymap=se ;;
+ 33|sg) keymap=sg ;;
+ 34|sk-y) keymap=sk-y ;;
+ 35|sk-z) keymap=sk-z ;;
+ 36|slovene) keymap=slovene ;;
+ 37|trf) keymap=trf ;;
+ 38|trq) keymap=trq ;;
+ 39|ua) keymap=ua ;;
+ 40|uk) keymap=uk ;;
+ 41|us) keymap=us ;;
+ 42|wangbe) keymap=wangbe ;;
+ esac
+ fi
if [ -e /lib/keymaps/${keymap}.map ]
then
good_msg "Loading the ''${keymap}'' keymap"
mkdir -p /etc/sysconfig
# echo "XKEYBOARD=${xkeymap}" > /etc/sysconfig/keyboard
echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
- elif [ "$keymap" = '' ]
+ elif [ -z "${keymap}" ]
then
echo
good_msg "Keeping default keymap"
real_rootflags\=*)
REAL_ROOTFLAGS=`parse_opt "${x}"`
;;
+ keymap\=*)
+ keymap=`parse_opt "${x}"`
+ ;;
esac
done