Last active
August 29, 2015 14:09
-
-
Save warped-rudi/2c4f5ca69b3aeb0f97dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/packages/system/busybox/profile.d/keymap.sh b/packages/system/busybox/profile.d/keymap.sh | |
index f1e2bd6..c32ee55 100755 | |
--- a/packages/system/busybox/profile.d/keymap.sh | |
+++ b/packages/system/busybox/profile.d/keymap.sh | |
@@ -1,6 +1,18 @@ | |
#!/bin/sh | |
-# load keymap given on kernel cmdline | |
-keymap=$(sed -n "s/.*keymap=\([^ ]*\).*/\1/p" /proc/cmdline) | |
-[ "x$keymap" != "x" ] && [ -r /etc/keymaps/${keymap}.kmap ] && cat /etc/keymaps/${keymap}.kmap | /sbin/loadkmap | |
+loaded="no" | |
+ | |
+try_keymap() { | |
+ if [ -n "$1" ] && [ -r /etc/keymaps/$1.kmap ]; then | |
+ cat /etc/keymaps/$1.kmap | /sbin/loadkmap | |
+ loaded="yes" | |
+ fi | |
+} | |
+# load keymap given in /etc/locale.conf | |
+[ -r /etc/locale.conf ] && \ | |
+ try_keymap $(sed -n "s/.*LANG=\([^_]*\).*/\1/p" /etc/locale.conf) | |
+ | |
+# load keymap given on kernel cmdline | |
+[ $loaded = "no" ] && \ | |
+ try_keymap $(sed -n "s/.*keymap=\([^ ]*\).*/\1/p" /proc/cmdline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment