case "${1:?}" in
btrfs)
- modprobe -nv btrfs && command -v mkfs.btrfs && command -v btrfs || return $?
+ host_has_btrfs
;;
iscsi)
# Client/initiator (Open-iSCSI)
command -v lvm || return $?
;;
mdadm)
- command -v mdadm || return $?
+ host_has_mdadm
;;
multipath)
command -v multipath && command -v multipathd || return $?
mkdir -p "${initdir:?}/etc/lvm"
}
+host_has_btrfs() (
+ set -e
+ modprobe -nv btrfs && command -v mkfs.btrfs && command -v btrfs || return $?
+)
+
install_btrfs() {
instmods btrfs
# Not all utilities provided by btrfs-progs are listed here; extend the list
fi
}
+host_has_mdadm() (
+ set -e
+ command -v mdadm || return $?
+)
+
install_mdadm() {
local unit
local mdadm_units=(