#!/bin/bash build() { add_checked_modules -f 'dm-' 'drivers/md/*' # check if a custom mdadm.conf exists if grep -qw ^ARRAY '/etc/mdadm.conf'; then echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays." add_file "/etc/mdadm.conf" fi map add_udev_rule \ '63-md-raid-arrays.rules' \ '64-md-raid-assembly.rules' # For external metadata arrays (e.g. IMSM) add_binary mdmon if declare -F add_systemd_unit &>/dev/null; then add_systemd_unit 'mdmon@.service' # support activation of degraded arrays add_systemd_unit 'mdadm-last-resort@.service' add_systemd_unit 'mdadm-last-resort@.timer' fi } help() { cat <