./find_SAS
rcode=$?
if [ "$rcode" -eq "0" ]; then
	grep -q mptbase /etc/modules.conf
	rcode=$?
	if [ "$rcode" -gt "0" ]; then
		echo "alias scsi_hostadapterB mptbase" >>/etc/modules.conf
	fi
	grep -q mptscsih /etc/modules.conf
	rcode=$?
	if [ "$rcode" -gt "0" ]; then
		echo "alias scsi_hostadapterH mptscsih" >>/etc/modules.conf
	fi
fi
grep -q mpt /etc/modules.conf
rcode=$?
if [ "$rcode" -eq "0" ]; then
	echo -e "mpt driver will be loaded during boot. Updating initrd."
	if [ -d /boot/efi/efi/redhat ]; then
		bootpart=/boot/efi/efi/redhat	
		echo -e "If you added an errata kernel, please verify"
		echo -e "that the new kernel is in ${bootpart}/elilo.conf"
	elif [ -d /boot/efi ]; then
		bootpart=/boot/efi	
		echo -e "If LILO is your boot loader, please re-run /sbin/lilo."
	else 
		bootpart=/boot	
		echo -e "If LILO is your boot loader, please re-run /sbin/lilo."
	fi
	for j in /lib/modules/*; do 
		kernel=`basename ${j}`
		if [ -e ${bootpart}/initrd-${kernel}.img ]; then
			if [ -e ${bootpart}/initrd-${kernel}.orig.img ]; then
				echo ""
#				echo ${bootpart}/initrd-${kernel}.orig.img found
			else
				echo Saving initrd-${kernel}.img in initrd-${kernel}.orig.img
				cp ${bootpart}/initrd-${kernel}.img ${bootpart}/initrd-${kernel}.orig.img
			fi
			echo Saving initrd-${kernel}.img in initrd-${kernel}.previous.img
			mv ${bootpart}/initrd-${kernel}.img ${bootpart}/initrd-${kernel}.previous.img
		fi
		/sbin/mkinitrd -f ${bootpart}/initrd-${kernel}.img ${kernel} > /dev/null
		echo -e "\nINFO: ${bootpart}/initrd-${kernel}.img has been generated"
	done
fi
