summaryrefslogtreecommitdiffstats
path: root/install/block
blob: 11c466578a8ad1578b1bd6008d06f32d733252cb (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() {
    local filter

    map add_module sd_mod? sr_mod? usb_storage? mmc_block? firewire-sbp2? virtio_blk?

    # pata, sata, scsi, nvme
    for filter in 'scsi/.*ata' '/(block|scsi|fusion|nvme)/' 'ata/[ps]ata_' \
            'ata/(ahci|pdc_adma|ata_piix|ata_generic)'; do
        add_checked_modules "$filter"
    done

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

    # firewire
    add_checked_modules '/drivers/firewire/'

    # mmc
    add_checked_modules '/(mmc|tifm_)'

    # virtio
    add_checked_modules 'virtio'
}

help() {
    cat <<HELPEOF
This hook loads the necessary modules for most block devices using pata, sata,
scsi, firewire, usb, or mmc. Detection will take place at runtime. To minimize
the modules in the image, add the autodetect hook too.
HELPEOF
}

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