summaryrefslogtreecommitdiffstats
path: root/install/keymap
blob: c1948b1f263803c0e2fc4c5b6ec3d26ee44455db (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
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

build() {

    # subshell to avoid namespace pollution
    (
        l=$LANG
        unset LANG

        for cfg in /etc/{vconsole,locale}.conf; do
            [[ -s $cfg ]] && . "$cfg"
        done

        [[ $LANG ]] && LOCALE=$LANG
        LANG=$l

        if [[ $KEYMAP ]]; 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
    ) && add_runscript
}

help() {
    cat <<HELPEOF
This hook loads keymap(s) specified in vconsole.conf during early userspace.
HELPEOF
}

# vim: set ft=sh ts=4 sw=4 et: