summaryrefslogtreecommitdiffstats
path: root/install/keymap
blob: 34b744afd6e6db2ed91e5ec10b6dec328f95b100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

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
            printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
            /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
        fi
    fi
}

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: