[openfabrics-ewg] Creating 91-srp.rules from openibd

Scott Weitzenkamp (sweitzen) sweitzen at cisco.com
Wed Sep 27 09:25:00 PDT 2006


Vlad,

Is it really a good idea to be creating /etc config files from openibd?
Also, it looks like you are appending to the file again each time SRP is
started.

+                        ib_srp)
+                                # Create 91-srp.rules file
+                                mkdir -p /etc/udev/rules.d
+                                cat >> /etc/udev/rules.d/91-srp.rules
<< EOF
+ACTION=="add", KERNEL=="sd*[!0-9]", RUN+="/sbin/multipath %M:%m"
+EOF

Scott Weitzenkamp
SQA and Release Manager
Server Virtualization Business Unit
Cisco Systems
 

> -----Original Message-----
> From: openib-commits-bounces at openib.org 
> [mailto:openib-commits-bounces at openib.org] On Behalf Of 
> vlad at openib.org
> Sent: Wednesday, September 27, 2006 8:13 AM
> To: openib-commits at openib.org
> Subject: [openib-commits] r9643 - gen2/trunk/ofed/openib/scripts
> 
> Author: vlad
> Date: 2006-09-27 08:12:43 -0700 (Wed, 27 Sep 2006)
> New Revision: 9643
> 
> Modified:
>    gen2/trunk/ofed/openib/scripts/openibd
> Log:
> Added /etc/udev/rules.d/91-srp.rules for SRP HA.
> 
> 
> 
> Modified: gen2/trunk/ofed/openib/scripts/openibd
> ===================================================================
> --- gen2/trunk/ofed/openib/scripts/openibd	2006-09-27 
> 13:08:20 UTC (rev 9642)
> +++ gen2/trunk/ofed/openib/scripts/openibd	2006-09-27 
> 15:12:43 UTC (rev 9643)
> @@ -70,25 +70,25 @@
>      exit 0
>  fi
>  
> -#	# Check that HCA driver was installed for current kernel
> -#	INFO=/etc/infiniband/info
> -#	if [ -x ${INFO} ]; then
> -#		info_kversion=$(${INFO} | grep -w Kernel | cut 
> -d '=' -f 2)
> -#	        if [ "X$(uname -r)" != "X${info_kversion}" ]; then
> -#	                # OpenIB stack was installed for 
> different from current kernel
> -#			echo
> -#	                echo "ERROR: The OpenIB stack was 
> installed for kernel ${info_kversion}, while current kernel 
> is $(uname -r)."
> -#			echo
> -#	                exit 1
> -#	        fi
> -#	fi
> +#       # Check that HCA driver was installed for current kernel
> +#       INFO=/etc/infiniband/info
> +#       if [ -x ${INFO} ]; then
> +#               info_kversion=$(${INFO} | grep -w Kernel | 
> cut -d '=' -f 2)
> +#               if [ "X$(uname -r)" != "X${info_kversion}" ]; then
> +#                       # OpenIB stack was installed for 
> different from current kernel
> +#                       echo
> +#                       echo "ERROR: The OpenIB stack was 
> installed for kernel ${info_kversion}, while current kernel 
> is $(uname -r)."
> +#                       echo
> +#                       exit 1
> +#               fi
> +#       fi
>  
>  if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then 
>      if [ -n "$INIT_VERSION" ] ; then
>          # MODE=onboot
> -	    if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" 
> ${CONFIG} > /dev/null ; then
> -		    exit 0
> -	    fi
> +            if LANG=C egrep -L 
> "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${CONFIG} > /dev/null ; then
> +                    exit 0
> +            fi
>      fi
>  fi
>  
> @@ -420,12 +420,12 @@
>              echo "# Set FIX_AMD_8131_ERR58=YES to apply 
> AMD-8131 Errata #58 workaround" >> $CONFIG
>              echo "FIX_AMD_8131_ERR58=\"YES\"" >> $CONFIG
>          fi
> -	
> -	# Set default value for FIX_AMD_8131_ERR58
> -	if [ -z "$FIX_AMD_8131_ERR58" ]; then
> -		FIX_AMD_8131_ERR58="YES"
> -	fi
>          
> +        # Set default value for FIX_AMD_8131_ERR58
> +        if [ -z "$FIX_AMD_8131_ERR58" ]; then
> +                FIX_AMD_8131_ERR58="YES"
> +        fi
> +        
>          CURVAL=`/sbin/setpci -d 1022:1100 69`
>  
>          for val in $CURVAL
> @@ -468,7 +468,7 @@
>  if test -x /sbin/lspci && test -x /sbin/setpci; then
>       if ( /sbin/lspci -nd 1022:1100 2> /dev/null | grep 
> "1100" > /dev/null ) &&
>          ( /sbin/lspci -nd 1022:7450 2> /dev/null | grep 
> "7450" > /dev/null ) &&
> -	( /sbin/lspci -nd 15b3:5a46 2> /dev/null | grep "5a46" 
> > /dev/null ); then
> +        ( /sbin/lspci -nd 15b3:5a46 2> /dev/null | grep 
> "5a46" > /dev/null ); then
>  
>          if ! ( grep FIX_AMD_8131_ERR56 $CONFIG > /dev/null ); then
>              echo >> $CONFIG
> @@ -481,60 +481,60 @@
>                  FIX_AMD_8131_ERR56="YES"
>          fi
>  
> -	bus=""
> +        bus=""
>  
> -	# Look for devices AMD-8131
> -	for amd_dev in `/sbin/setpci -v -f -d 1022:7450 19 | 
> cut -d':' -f1,2`
> -	do
> +        # Look for devices AMD-8131
> +        for amd_dev in `/sbin/setpci -v -f -d 1022:7450 19 | 
> cut -d':' -f1,2`
> +        do
>  
> -		bus=`/sbin/setpci -s $amd_dev 19`
> -		rev=`/sbin/setpci -s $amd_dev 8`
> +                bus=`/sbin/setpci -s $amd_dev 19`
> +                rev=`/sbin/setpci -s $amd_dev 8`
>  
>  
> -		# Look for Tavor attach to secondary bus of this devices
> -		for device in `/sbin/setpci -f -s $bus: -d 15b3:5a46 19`
> -		do
> -			if [ $rev -lt 13 ]; then
> -				if [ "$FIX_AMD_8131_ERR56" == 
> "YES" ]; then			
> -					/sbin/setpci -d 15b3:5a44 72=14
> -					if [ $? -eq 0 ]; then
> -		                        	# echo 
> "AMD-8131 Errata #56 workaround applied"
> -			                        break
> -			                else
> -                        			echo "Failed to 
> apply AMD-8131 Errata #56 workaround"
> -			                fi
> -                		else
> -		                	echo
> -			                echo "Invalid 
> configuration found for PCI-X chipset AMD-8131 (Errata #56)"
> -                    			echo "For more details 
> see IBG2 Distribution Release Notes (IBG2_Release_Notes.pdf 
> under docs directory)"
> -                    			echo
> +                # Look for Tavor attach to secondary bus of 
> this devices
> +                for device in `/sbin/setpci -f -s $bus: -d 
> 15b3:5a46 19`
> +                do
> +                        if [ $rev -lt 13 ]; then
> +                                if [ "$FIX_AMD_8131_ERR56" 
> == "YES" ]; then                     
> +                                        /sbin/setpci -d 
> 15b3:5a44 72=14
> +                                        if [ $? -eq 0 ]; then
> +                                                # echo 
> "AMD-8131 Errata #56 workaround applied"
> +                                                break
> +                                        else
> +                                                echo "Failed 
> to apply AMD-8131 Errata #56 workaround"
> +                                        fi
> +                                else
> +                                        echo
> +                                        echo "Invalid 
> configuration found for PCI-X chipset AMD-8131 (Errata #56)"
> +                                        echo "For more 
> details see IBG2 Distribution Release Notes 
> (IBG2_Release_Notes.pdf under docs directory)"
> +                                        echo
>  
> -		                    	if [ "$RUNMODE" == 
> "manual" ]; then
> -			                       	read -p "Do you 
> wish to continue anyway? [y/N]:"
> -                			        if [[ "$REPLY" 
> != "y" && "$REPLY" != "yes" ]]; then
> -		        	                    exit 1
> -			                        fi
> -		                        	break
> -		               	    	else
> -		        	                exit 1
> -		                    	fi
> -				fi
> +                                        if [ "$RUNMODE" == 
> "manual" ]; then
> +                                                read -p "Do 
> you wish to continue anyway? [y/N]:"
> +                                                if [[ 
> "$REPLY" != "y" && "$REPLY" != "yes" ]]; then
> +                                                    exit 1
> +                                                fi
> +                                                break
> +                                        else
> +                                                exit 1
> +                                        fi
> +                                fi
>  
> -			else
> -				continue
> -			fi
> +                        else
> +                                continue
> +                        fi
>  
> -			# If more than one device is on the bus 
> the issue a
> -			# warning
> -			num=`/sbin/setpci -f -s $bus: 0 | wc -l 
> |  sed 's/\ *//g'`
> +                        # If more than one device is on the 
> bus the issue a
> +                        # warning
> +                        num=`/sbin/setpci -f -s $bus: 0 | wc 
> -l |  sed 's/\ *//g'`
>  
> -			if [ $num -gt 1 ]; then
> -				echo "Warning: your current 
> PCI-X configuration might be incorrect."
> -				echo "see AMD-8131 Errata 56 
> for more details."
> -			fi
> +                        if [ $num -gt 1 ]; then
> +                                echo "Warning: your current 
> PCI-X configuration might be incorrect."
> +                                echo "see AMD-8131 Errata 56 
> for more details."
> +                        fi
>  
> -		done
> -	done
> +                done
> +        done
>  
>       fi
>  fi
> @@ -546,11 +546,11 @@
>     
>      # Stop Gen1 modules if they are UP after uninstall
>      if is_module ib_tavor; then
> -	echo
> -	echo "Found Infiniband Gen1 modules."
> -	echo "Trying to unload them first..."
> -	echo
> -	stop_gen1
> +        echo
> +        echo "Found Infiniband Gen1 modules."
> +        echo "Trying to unload them first..."
> +        echo
> +        stop_gen1
>      fi
>      
>      errata_58
> @@ -558,13 +558,13 @@
>      # Load Mellanox HCA driver
>  
>      if [ "X${MTHCA_LOAD}" == "Xyes" ]; then
> -    	/sbin/modprobe ib_mthca > /dev/null 2>&1
> -    	RC=$[ $RC + $? ]
> +        /sbin/modprobe ib_mthca > /dev/null 2>&1
> +        RC=$[ $RC + $? ]
>      fi
>  
>      if [ "X${IPATH_LOAD}" == "Xyes" ]; then
> -    	/sbin/modprobe ib_ipath > /dev/null 2>&1
> -    	RC=$[ $RC + $? ]
> +        /sbin/modprobe ib_ipath > /dev/null 2>&1
> +        RC=$[ $RC + $? ]
>      fi
>  
>      # Add node description to sysfs
> @@ -573,9 +573,9 @@
>          declare -i hca_id=1
>          for hca in ${IBSYSDIR}/*
>          do
> -	    if [ -e ${hca}/node_desc ]; then
> -            	echo -n "$(hostname -s) HCA-${hca_id}" >> 
> ${hca}/node_desc
> -	    fi
> +            if [ -e ${hca}/node_desc ]; then
> +                echo -n "$(hostname -s) HCA-${hca_id}" >> 
> ${hca}/node_desc
> +            fi
>              let hca_id++
>          done
>      fi
> @@ -586,8 +586,8 @@
>      RC=$[ $RC + $? ]
>      
>      if [ $IPOIB -eq 1 ]; then
> -	/sbin/modprobe ib_ipoib > /dev/null 2>&1
> -	RC=$[ $RC + $? ]
> +        /sbin/modprobe ib_ipoib > /dev/null 2>&1
> +        RC=$[ $RC + $? ]
>      fi
>  
>      if [ $RC -eq 0 ]; then
> @@ -604,84 +604,84 @@
>          echo Setting up InfiniBand network interfaces:
>          for i in $interfaces
>          do
> -      	    	if [[ ! -e ${WD}/ifcfg-${i} && ! -e 
> ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> -			echo "No configuration found for ${i}"	
> -                	continue
> -            	fi
> +                if [[ ! -e ${WD}/ifcfg-${i} && ! -e 
> ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> +                        echo "No configuration found for ${i}"  
> +                        continue
> +                fi
>  
> -		REMOVE_NETWORK_CONF=0
> -		if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> -	    		ln -snf ${WD}/ifcfg-${i} 
> ${NETWORK_CONF_DIR}/ifcfg-${i}
> -			REMOVE_NETWORK_CONF=1
> -		fi
> -	
> -	        if [ "$RUNMODE" != "manual" ]; then
> -	            case $DISTRIB in
> -	                RedHat|Rocks)
> -	                    if LANG=C egrep -L 
> "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > 
> /dev/null ; then
> -	                        continue
> -	                    fi
> -	                ;;    
> -	                SuSE)
> -	                    if ! LANG=C egrep -L 
> "^STARTMODE=['\"]?onboot['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i 
> > /dev/null ; then
> -	                        continue
> -	                    fi
> -	                ;;
> -	                *)
> -	                    if LANG=C egrep -L 
> "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > 
> /dev/null ; then
> -	                        continue
> -	                    fi
> -	                ;;    
> -	            esac    
> -	        fi
> -	
> -	    #        echo $"Bringing up interface $i:"
> -	
> -	    	case $DISTRIB in
> -	    		RedHat|Rocks)
> -	    		    if [ $IS_FEDORA -eq 0 ]; then	
> -	            		    /sbin/ifup ${i}
> -	    		    else
> -	    			    . ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                REMOVE_NETWORK_CONF=0
> +                if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> +                        ln -snf ${WD}/ifcfg-${i} 
> ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                        REMOVE_NETWORK_CONF=1
> +                fi
> +        
> +                if [ "$RUNMODE" != "manual" ]; then
> +                    case $DISTRIB in
> +                        RedHat|Rocks)
> +                            if LANG=C egrep -L 
> "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > 
> /dev/null ; then
> +                                continue
> +                            fi
> +                        ;;    
> +                        SuSE)
> +                            if ! LANG=C egrep -L 
> "^STARTMODE=['\"]?onboot['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i 
> > /dev/null ; then
> +                                continue
> +                            fi
> +                        ;;
> +                        *)
> +                            if LANG=C egrep -L 
> "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > 
> /dev/null ; then
> +                                continue
> +                            fi
> +                        ;;    
> +                    esac    
> +                fi
> +        
> +            #        echo $"Bringing up interface $i:"
> +        
> +                case $DISTRIB in
> +                        RedHat|Rocks)
> +                            if [ $IS_FEDORA -eq 0 ]; then       
> +                                    /sbin/ifup ${i}
> +                            else
> +                                    . ${NETWORK_CONF_DIR}/ifcfg-${i}
>                          if [ ! -z ${IPADDR} ] && [ ! -z 
> ${NETMASK} ] && [ ! -z ${BROADCAST} ]; then
>                              /sbin/ifconfig ${i} ${IPADDR} 
> netmask ${NETMASK} broadcast ${BROADCAST} > /dev/null 2>&1
>                          else
> -	            		    /sbin/ifup ${i}
> +                                    /sbin/ifup ${i}
>                          fi
> -	    		    fi
> -	    		;;
> -	    		SuSE)
> -	                    if [ "$KPREFIX" == "26" ]; then
> -	                    	ifconfig ${i} up > /dev/null 2>&1
> -	                    fi    
> -			            # Workaround for ifup 
> issue: two devices with the same IP address
> -	    		        . ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                            fi
> +                        ;;
> +                        SuSE)
> +                            if [ "$KPREFIX" == "26" ]; then
> +                                ifconfig ${i} up > /dev/null 2>&1
> +                            fi    
> +                                    # Workaround for ifup 
> issue: two devices with the same IP address
> +                                . ${NETWORK_CONF_DIR}/ifcfg-${i}
>                          if [ ! -z ${IPADDR} ] && [ ! -z 
> ${NETMASK} ] && [ ! -z ${BROADCAST} ]; then
>                              /sbin/ifconfig ${i} ${IPADDR} 
> netmask ${NETMASK} broadcast ${BROADCAST} > /dev/null 2>&1
>                          else
> -	            		    /sbin/ifup ${i}
> +                                    /sbin/ifup ${i}
>                          fi
> -	             	    # /sbin/ifup ${i} > /dev/null 2>&1
> -	    		;;
> -	    		*)
> -	            	    /sbin/ifup ${i}
> -	    		;;
> -	    	esac 
> -	        RC=$?
> -	
> +                            # /sbin/ifup ${i} > /dev/null 2>&1
> +                        ;;
> +                        *)
> +                            /sbin/ifup ${i}
> +                        ;;
> +                esac 
> +                RC=$?
> +        
>              unset IPADDR NETMASK BROADCAST
>  
> -		if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> -	            rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> -		fi
> +                if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> +                    rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                fi
>              
> -            	if [ $RC -eq 0 ]; then 
> -                	echo_success $"Bringing up interface $i:"
> -            	else
> -                	echo_failure $"Bringing up interface $i:"
> -                	# get_debug_info
> -                	# exit 1
> -            	fi
> +                if [ $RC -eq 0 ]; then 
> +                        echo_success $"Bringing up interface $i:"
> +                else
> +                        echo_failure $"Bringing up interface $i:"
> +                        # get_debug_info
> +                        # exit 1
> +                fi
>          done    
>          echo_done "Setting up service network   .   .   ."
>          
> @@ -702,26 +702,31 @@
>      if [ "$POST_LOAD_MODULES" != "" ]; then
>          for mod in  $POST_LOAD_MODULES
>          do
> -	   	case $mod in
> -			ib_iser)
> -				# Voltaire requirement
> -            		/sbin/modprobe --force-modversion $mod 
> > /dev/null 2>&1
> -			;;
> -            ib_srp)
> -            		/sbin/modprobe $mod > /dev/null 2>&1
> -                    if [ "X${SRPHA_ENABLE}" == "Xyes" ]; then
> -                        /sbin/modprobe dm_multipath > /dev/null 2>&1
> -                        srp_daemon.sh &
> -                        srp_daemon_pid=$!
> -                        echo ${srp_daemon_pid} > 
> ${srp_daemon_pidfile}
> -                    fi
> -            ;;
> -			*)
> -            		/sbin/modprobe $mod > /dev/null 2>&1
> -			;;
> -		esac
> -            	RC=$?
> -            	[ $RC -ne 0 ] && echo_failure "Failed to load $mod"
> +                case $mod in
> +                        ib_iser)
> +                                # Voltaire requirement
> +                                /sbin/modprobe 
> --force-modversion $mod > /dev/null 2>&1
> +                        ;;
> +                        ib_srp)
> +                                # Create 91-srp.rules file
> +                                mkdir -p /etc/udev/rules.d
> +                                cat >> 
> /etc/udev/rules.d/91-srp.rules << EOF
> +ACTION=="add", KERNEL=="sd*[!0-9]", RUN+="/sbin/multipath %M:%m"
> +EOF
> +                                /sbin/modprobe $mod > /dev/null 2>&1
> +                                if [ "X${SRPHA_ENABLE}" == 
> "Xyes" ]; then
> +                                    /sbin/modprobe 
> dm_multipath > /dev/null 2>&1
> +                                    srp_daemon.sh &
> +                                    srp_daemon_pid=$!
> +                                    echo ${srp_daemon_pid} > 
> ${srp_daemon_pidfile}
> +                                fi
> +                        ;;
> +                        *)
> +                                /sbin/modprobe $mod > /dev/null 2>&1
> +                        ;;
> +                esac
> +                RC=$?
> +                [ $RC -ne 0 ] && echo_failure "Failed to load $mod"
>          done    
>      fi
>      
> @@ -762,20 +767,20 @@
>  
>  unload()
>  {
> -	# Unload module $1
> -	if is_module $mod; then
> -            	/sbin/modprobe -r $mod > /dev/null 2>&1
> -            	if [ $? -ne 0 ]; then
> -			# Try rmmod if modprobe failed: case 
> that previous installation included more IB modules.
> -			/sbin/rmmod $mod > /dev/null 2>&1
> -                    	if [ $? -ne 0 ]; then
> -                    	    echo_failure $"Failed to unload $mod"
> -    			    get_debug_info
> -			    [ ! -z $2 ] && echo $2
> -                    	    exit 1
> -                    	fi    
> -		fi
> -	fi
> +        # Unload module $1
> +        if is_module $mod; then
> +                /sbin/modprobe -r $mod > /dev/null 2>&1
> +                if [ $? -ne 0 ]; then
> +                        # Try rmmod if modprobe failed: case 
> that previous installation included more IB modules.
> +                        /sbin/rmmod $mod > /dev/null 2>&1
> +                        if [ $? -ne 0 ]; then
> +                            echo_failure $"Failed to unload $mod"
> +                            get_debug_info
> +                            [ ! -z $2 ] && echo $2
> +                            exit 1
> +                        fi    
> +                fi
> +        fi
>  
>  }
>  
> @@ -784,29 +789,29 @@
>      if is_module ib_ipoib; then
>          # Unload IPoIB interfaces
>          get_interfaces
> -       	for i in $interfaces
> -           	do
> -        			if [[ ! -e ${WD}/ifcfg-${i} && 
> ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> -    			# echo "No configuration found for ${i}"	
> -    			continue
> -         		fi
> +        for i in $interfaces
> +                do
> +                                if [[ ! -e ${WD}/ifcfg-${i} 
> && ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> +                        # echo "No configuration found for 
> ${i}"        
> +                        continue
> +                        fi
>      
> -    		REMOVE_NETWORK_CONF=0
> -    		if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> -    				ln -snf ${WD}/ifcfg-${i} 
> ${NETWORK_CONF_DIR}/ifcfg-${i}
> -    			REMOVE_NETWORK_CONF=1
> -    		fi
> +                REMOVE_NETWORK_CONF=0
> +                if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> +                                ln -snf ${WD}/ifcfg-${i} 
> ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                        REMOVE_NETWORK_CONF=1
> +                fi
>      
> -            		ifdown ${i} > /dev/null 2>&1
> -    		RC=$(($RC+$?))
> -    		[ $RC -eq 0 ] && echo_success $"Shutting down 
> interface $i: " || echo_failure $"Shutting down interface $i: "
> -    		if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> -    			rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> -    		fi
> -       	done
> +                        ifdown ${i} > /dev/null 2>&1
> +                RC=$(($RC+$?))
> +                [ $RC -eq 0 ] && echo_success $"Shutting 
> down interface $i: " || echo_failure $"Shutting down interface $i: "
> +                if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> +                        rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                fi
> +        done
>      
> -       	[ $RC -ne 0 ] && echo "Please reboot the host." 
> &&  exit 1
> -       	sleep 2
> +        [ $RC -ne 0 ] && echo "Please reboot the host." &&  exit 1
> +        sleep 2
>      fi
>  
>  
> @@ -828,7 +833,7 @@
>          
>          for app in $apps
>          do
> -    	if ( ps -ef | grep $app | grep -v grep > /dev/null 2>&1 ); then
> +        if ( ps -ef | grep $app | grep -v grep > /dev/null 
> 2>&1 ); then
>                  echo
>                  echo "Please stop $app and all applications 
> running over InfiniBand"
>                  echo "Then run \"$0 $ACTION\""
> @@ -837,22 +842,22 @@
>              fi
>          done
>  
> -	# Stop Gen1 modules if they are UP after uninstall
> +        # Stop Gen1 modules if they are UP after uninstall
>          if is_module ib_tavor; then
> -		    stop_gen1
> - 	        if [ $RESTART -eq 0 ]; then
> -			exit 0
> -		else
> -			return 0
> -		fi
> +                    stop_gen1
> +                if [ $RESTART -eq 0 ]; then
> +                        exit 0
> +                else
> +                        return 0
> +                fi
>         fi
>      
>          if ! is_module ib_core; then
>              if [ $RESTART -eq 0 ]; then
> -            	echo
> -            	echo_failure $"HCA driver is not loaded or 
> loaded with errors"
> -            	echo
> -            	exit 1
> +                echo
> +                echo_failure $"HCA driver is not loaded or 
> loaded with errors"
> +                echo
> +                exit 1
>              else
>                      return 0
>              fi                        
> @@ -905,52 +910,54 @@
>              done
>          fi
>  
> +        /bin/rm -f /etc/udev/rules.d/91-srp.rules > /dev/null 2>&1
> +
>          # Unload ULPs modules
>  
>          if [ "$PRE_UNLOAD_MODULES" != "" ]; then
>                  for mod in  $PRE_UNLOAD_MODULES
>                  do
> -			        unload $mod
> +                        unload $mod
>                  done
>          fi
>  
>          # Unload IPoIB interfaces
> -    if is_module ib_ipoib; then
> -        get_interfaces
> -        for i in $interfaces
> -        do
> -      	    if [[ ! -e ${WD}/ifcfg-${i} && ! -e 
> ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> -		# echo "No configuration found for ${i}"	
> -                continue
> -            fi
> -	    REMOVE_NETWORK_CONF=0
> -	    if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> -	    	ln -snf ${WD}/ifcfg-${i} ${NETWORK_CONF_DIR}/ifcfg-${i}
> -		REMOVE_NETWORK_CONF=1
> -	    fi
> -            ifdown ${i} > /dev/null 2>&1
> -            RC=$(($RC+$?))
> -            [ $RC -eq 0 ] && echo_success $"Shutting down 
> interface $i: " || echo_failure $"Shutting down interface $i: "
> -	    if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> -	    	rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> -	    fi
> -        done    
> -    
> -        [ $RC -ne 0 ] && get_debug_info && exit 1
> -	sleep 2
> -    fi
> +        if is_module ib_ipoib; then
> +            get_interfaces
> +            for i in $interfaces
> +            do
> +                if [[ ! -e ${WD}/ifcfg-${i} && ! -e 
> ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
> +                    # echo "No configuration found for ${i}"        
> +                    continue
> +                fi
> +                REMOVE_NETWORK_CONF=0
> +                if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
> +                    ln -snf ${WD}/ifcfg-${i} 
> ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                    REMOVE_NETWORK_CONF=1
> +                fi
> +                ifdown ${i} > /dev/null 2>&1
> +                RC=$(($RC+$?))
> +                [ $RC -eq 0 ] && echo_success $"Shutting 
> down interface $i: " || echo_failure $"Shutting down interface $i: "
> +                if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
> +                    rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
> +                fi
> +            done    
>          
> +            [ $RC -ne 0 ] && get_debug_info && exit 1
> +            sleep 2
> +        fi
> +        
>          # Unload OpenIB modules
>          
>          if [ "$POST_UNLOAD_MODULES" != "" ]; then
>                  for mod in  $POST_UNLOAD_MODULES
>                  do
> -			unload $mod
> +                        unload $mod
>                  done
> -       fi
> +        fi
>  
> -       	echo_success $"Unloading HCA driver: "
> -	sleep 1
> +        echo_success $"Unloading HCA driver: "
> +        sleep 1
>      return $RC    
>  }
>  
> @@ -991,11 +998,11 @@
>      
>      for mod in  $STATUS_MODULES
>      do
> -    	if is_module $mod; then
> -    		[ $cnt -eq 0 ] && echo "The following OFED 
> modules are loaded:" && echo
> -    		let cnt++
> -    		echo "	$mod"
> -    	fi
> +        if is_module $mod; then
> +                [ $cnt -eq 0 ] && echo "The following OFED 
> modules are loaded:" && echo
> +                let cnt++
> +                echo "  $mod"
> +        fi
>      done
>       
>      echo
> @@ -1023,26 +1030,26 @@
>  trap 'trap_handler' 2 9 15
>  
>  case $ACTION in
> -	start)
> +        start)
>                  start
> -		;;
> -	stop)
> -		stop    
> -		;;
> -	restart)
> +                ;;
> +        stop)
> +                stop    
> +                ;;
> +        restart)
>                  RESTART=1
> -		stop
> +                stop
>                  start
> -		;;
> -	status)
> -		status
> -		;;
> -	*)
> -		echo 
> -		echo "Usage: `basename $0` {start|stop|restart|status}"
> -		echo
> -		exit 1
> -		;;
> +                ;;
> +        status)
> +                status
> +                ;;
> +        *)
> +                echo 
> +                echo "Usage: `basename $0` 
> {start|stop|restart|status}"
> +                echo
> +                exit 1
> +                ;;
>  esac
>  
>  RC=$?
> 
> _______________________________________________
> openib-commits mailing list
> openib-commits at openib.org
> http://openib.org/mailman/listinfo/openib-commits
> 




More information about the ewg mailing list