summaryrefslogtreecommitdiff
path: root/libre-testing/mdadm/mdadm_udev_install
blob: c01cbaf2499e72d12c41fa389f2d9d4cfa35a59a (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
#!/bin/bash

build() {
    add_checked_modules -f 'dm-' 'drivers/md/*'

    # check if a custom mdadm.conf exists
    if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then
        echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
        add_file "/etc/mdadm.conf"
    fi

    add_binary "/usr/bin/mdadm"
    add_file "/usr/lib/udev/rules.d/63-md-raid-arrays.rules"
    add_file "/usr/lib/udev/rules.d/64-md-raid-assembly.rules"
}

help() {
  cat <<HELPEOF
This hook loads the necessary modules for a RAID array and uses incremental
assembly via udev at runtime to create the devices. This hook will NOT work
without the udev hook included on the image.
HELPEOF
}

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