summaryrefslogtreecommitdiffstats
path: root/install/keyboard
blob: 9eb4bf1a4974f1363afe061255a33cceac98cbb1 (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
#!/bin/bash

build() {
    local major minor

    add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'

    # As of 3.5, modaliases seem to be exported for HID
    # devices, so we can leverage autodetection.
    IFS=.- read -r major minor _ <<<"$KERNELVERSION"
    if (( major > 3 || (major == 3 && minor >= 5) )); then
        add_checked_modules '/hid/hid'
    else
        add_all_modules '/hid/hid'
    fi

    add_module 'usbhid'

    add_checked_modules '/input/(serio|keyboard)'
}

help() {
    cat <<HELPEOF
This hook loads the necessary modules for keyboard devices. As a side-effect
modules for some non-keyboard input devices might also be added, but this should
not be relied on. Detection will take place at runtime. To minimize the modules
in the image, add the autodetect hook prior to this hook.
HELPEOF
}

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