#!/bin/bash
dracut_install dmraid partx kpartx 

inst  dmeventd

if ldd $(which dmraid) | grep -q lib64; then
    LIBDIR="/lib64"
else
    LIBDIR="/lib"
fi

for i in $(ls /{usr,}/$LIBDIR/libdmraid-events*.so 2>/dev/null); do
    dracut_install $i
done


inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 

inst "$moddir/dmraid.sh" /sbin/dmraid_scan

if [ ! -x /lib/udev/vol_id ]; then
    inst_rules 64-md-raid.rules
fi

inst_rules "$moddir/61-dmraid-imsm.rules"
inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup
inst_hook pre-trigger 30 "$moddir/parse-dm.sh"

