From 51c769f243e74f54daf4f1903aa46876f79829b6 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 24 Apr 2008 18:15:34 +0000 Subject: [PATCH] Updated the keymap-handling code so it will be installed and displayed without using --do-auto-keymap with a patch from Florian Schilhabel for bug #215822. Also, added a keymap= command line option to allow setting keymap from the bootloader, also from Florian. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@669 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- ChangeLog | 7 +++ gen_determineargs.sh | 4 +- gen_funcs.sh | 4 ++ generic/initrd.scripts | 97 ++++++++++++++++++++++-------------------- generic/linuxrc | 3 ++ 5 files changed, 66 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea94771..3fd00a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 24 Apr 2008; Chris Gianelloni 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 + 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 generic/initrd.scripts: Change from using a directory check to a file check. This should fix bug diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e34b741..f125f61 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -121,8 +121,8 @@ determine_real_args() { 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}"` diff --git a/gen_funcs.sh b/gen_funcs.sh index 3942740..30f4b81 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -486,11 +486,15 @@ set_config_with_override() { 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." diff --git a/generic/initrd.scripts b/generic/initrd.scripts index 0e92ea9..04d0234 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -521,52 +521,55 @@ setup_keymap() { 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" @@ -580,7 +583,7 @@ chooseKeymap() { 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" diff --git a/generic/linuxrc b/generic/linuxrc index 226f4c6..c53a89e 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -180,6 +180,9 @@ do real_rootflags\=*) REAL_ROOTFLAGS=`parse_opt "${x}"` ;; + keymap\=*) + keymap=`parse_opt "${x}"` + ;; esac done -- 2.26.2