summaryrefslogtreecommitdiffstats
path: root/install/keymap
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-21 14:17:59 +0100
committerDave Reisner <dreisner@archlinux.org>2012-03-24 20:43:12 +0100
commit757ae1fb693ccc556e4d8af1b858d476e53dede8 (patch)
tree00b7c768589524d0288b48ae83b986d942d2750a /install/keymap
parentf97d0cc8b46709cc94154eb36bdd784a879e63b4 (diff)
downloadmkinitcpio-757ae1fb693ccc556e4d8af1b858d476e53dede8.tar.gz
mkinitcpio-757ae1fb693ccc556e4d8af1b858d476e53dede8.tar.xz
natively support locale.conf and vconsole.conf
This is implemented for the keymap and consolefont hooks. It's done in such a way that vconsole.conf and locale.conf will override and supplement rc.conf. Implements FS#29022. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'install/keymap')
-rw-r--r--install/keymap19
1 files changed, 16 insertions, 3 deletions
diff --git a/install/keymap b/install/keymap
index 51bb1a2..fe5e459 100644
--- a/install/keymap
+++ b/install/keymap
@@ -4,13 +4,25 @@ build() {
# subshell to avoid namespace pollution
(
- . "$BASEDIR/etc/rc.conf"
+ l=$LANG
+ unset LANG
+
+ for cfg in etc/{rc,vconsole,locale}.conf; do
+ [[ -s $BASEDIR/$cfg ]] && . "$BASEDIR/$cfg"
+ done
+
+ [[ $LANG ]] && LOCALE=$LANG
+ LANG=$l
+
if [[ $KEYMAP ]]; then
- if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
+ if [[ $LOCALE = *[Uu][Tt][Ff]?(-)8 ]]; then
touch "$BUILDROOT/keymap.utf8"
uc=-u
fi
loadkeys -q $uc $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ else
+ warning "keymap: hook specified, but no KEYMAP found in configuration"
+ return 1
fi
)
@@ -19,7 +31,8 @@ build() {
help() {
cat <<HELPEOF
-This hook loads keymap(s) specified in rc.conf during early userspace.
+This hook loads keymap(s) specified in vconsole.conf or rc.conf during early
+userspace.
HELPEOF
}