#!/bin/sh

#
# PowerPath modules are loaded into initramfs only on the 
# following conditions:
# 1. PowerPath is installed and started
# 2. root device is managed by PowerPath
#

# if PowerPath modules are not loaded, stop here.
[ `/sbin/lsmod | grep emcp | wc -l` -gt 0 ] || exit 1

# We only dependent on SCSI and will be loaded by default.
[[ $1 = -d ]] && exit 0

. $dracutfunctions
[[ $debug ]] && set -x

is_pp() {
    [[ `echo $1 | awk -F":" {'print $1'}` -eq 120 ]] && return 0
    return 1
}

# Use PowerPath if we appear to be using it for root devices
rootdev=$(find_root_block_device)
if [[ $rootdev ]]; then
    check_block_and_slaves is_pp "$rootdev" && exit 0
fi

exit 1
