summaryrefslogtreecommitdiffstats
path: root/install/consolefont
blob: 271fc2f24f6bc085fb2d28c14f9b48db8b6f56f6 (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
#!/bin/bash

build() {
    local file ext

    eval "$(grep -e "^CONSOLEFONT=" /etc/rc.conf)"
    if [[ -n "$CONSOLEFONT" ]]; then
        for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT".psf?(u)?(.gz); do
            if [[ -e $file ]]; then
                [[ $file =~ \.(psfu?)(\.gz)?$ ]] && ext=${BASH_REMATCH[1]}
                if [[ $file = *.gz ]]; then
                    gzip -cd "$file" > "$BUILDROOT/consolefont.$ext"
                else
                    add_file "${file#$BASEDIR}" "/consolefont.$ext"
                fi
                SCRIPT=consolefont
                return 0
            fi
        done
        error "consolefont: requested font not found: \`%s'" "$CONSOLEFONT"
        return 1
    else
        warning "consolefont: no font found in %s/etc/rc.conf" "${BASEDIR%/}"
        return 1
    fi
}

help() {
    cat <<HELPEOF
This hook loads consolefont specified in rc.conf during early userspace.
HELPEOF
}

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