summaryrefslogtreecommitdiffstats
path: root/install/keymap
diff options
context:
space:
mode:
Diffstat (limited to 'install/keymap')
-rw-r--r--install/keymap39
1 files changed, 16 insertions, 23 deletions
diff --git a/install/keymap b/install/keymap
index 4038c87..cdc4da0 100644
--- a/install/keymap
+++ b/install/keymap
@@ -1,31 +1,24 @@
-# vim: set ft=sh:
+#!/bin/bash
-build()
-{
- MODULES=""
- BINARIES=""
- FILES=""
- SCRIPT="keymap"
- eval "$(grep -e "^LOCALE=" -e "^KEYMAP=" /etc/rc.conf)"
- if [ -n "$KEYMAP" ]; then
- KEYMAP_FILE="$(mktemp ${TMPDIR}/keymap.XXXXXX)"
- UTF8_FILE="$(mktemp ${TMPDIR}/keymap.XXXXXX)"
- if [ -n "$(echo ${LOCALE} | grep -i utf)" ]; then
- echo "UTF8='yes'" > ${UTF8_FILE}
- /bin/loadkeys -q -u $KEYMAP -b > ${KEYMAP_FILE}
+build() {
+ SCRIPT=keymap
+
+ eval "$(grep -E "^(LOCALE|KEYMAP)=" /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
- echo "UTF8='no'" > ${UTF8_FILE}
- /bin/loadkeys -q $KEYMAP -b > ${KEYMAP_FILE}
+ printf '%s\n' "UTF8=no" > "$buildroot/keymap.utf8"
+ /bin/loadkeys -q $KEYMAP -b > "$buildroot/keymap.bin"
fi
- add_file ${KEYMAP_FILE} /keymap.bin
- add_file ${UTF8_FILE} /keymap.utf8
fi
}
-help ()
-{
-cat<<HELPEOF
- This hook loads keymap(s) specified in rc.conf
- during early userspace.
+help() {
+ cat<<HELPEOF
+This hook loads keymap(s) specified in rc.conf during early userspace.
HELPEOF
}
+
+# vim: set ft=sh ts=4 sw=4 et: