summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-07-13 02:53:42 +0200
committerDave Reisner <dreisner@archlinux.org>2011-09-27 12:18:00 +0200
commit1793ad71472d85912dd258cc6730e20a46dbbb17 (patch)
tree333cbbb5ce0a30318b2734e91d43b32ad7be77b6
parent7143433a883287b3dc74288e92100f78443f386f (diff)
downloadmkinitcpio-1793ad71472d85912dd258cc6730e20a46dbbb17.tar.gz
mkinitcpio-1793ad71472d85912dd258cc6730e20a46dbbb17.tar.xz
keymap: simplify unicode detection
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--hooks/keymap13
-rw-r--r--install/keymap8
2 files changed, 10 insertions, 11 deletions
diff --git a/hooks/keymap b/hooks/keymap
index 3593168..afdb628 100644
--- a/hooks/keymap
+++ b/hooks/keymap
@@ -3,14 +3,15 @@ run_hook ()
{
if [ -e /keymap.bin ]; then
msg -n ":: Loading keymap..."
- . /keymap.utf8
- if [ "${UTF8}" = "yes" ]; then
- kbd_mode -u -C /dev/console
- printf "\033%%G" >> /dev/console
+ if [ -f /keymap.utf8 ]; then
+ mode=-u
+ ctrl=G
else
- kbd_mode -a -C /dev/console
- printf "\033%%@" >> /dev/console
+ mode=-a
+ ctrl=@
fi
+ kbd_mode $mode -C /dev/console
+ printf "\033%%$ctrl" >> /dev/console
loadkmap < /keymap.bin
msg "done."
fi
diff --git a/install/keymap b/install/keymap
index 2cf4d15..2880f15 100644
--- a/install/keymap
+++ b/install/keymap
@@ -7,12 +7,10 @@ build() {
. "$BASEDIR/etc/rc.conf"
if [[ $KEYMAP ]]; then
if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
- printf '%s\n' "UTF8=yes" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q -u $KEYMAP -b > "$BUILDROOT/keymap.bin"
- else
- printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ touch "$BUILDROOT/keymap.utf8"
+ uc=-u
fi
+ /bin/loadkeys -q $uc $KEYMAP -b > "$BUILDROOT/keymap.bin"
fi
)