srvadmin-install-centOS4x.patch for OMSA 5.1

Richard Andrews randrews at pelmorex.com
Tue Jul 17 13:40:22 CDT 2007


--- srvadmin-install_org.sh	2007-07-17 13:48:21.000000000 -0400
+++ srvadmin-install.sh	2007-07-17 13:42:55.000000000 -0400
@@ -74,6 +74,7 @@
 GBL_OS_TYPE_RHEL4=3
 GBL_OS_TYPE_SLES9=4
 GBL_OS_TYPE_SLES10=5
+GBL_OS_TYPE_CENT4=6
 
 # controls install/upgrade of OpenIPMI driver
 INSTALL_OPENIPMI=1
@@ -500,6 +501,9 @@
                 elif [ "${GBL_OS_TYPE}" = "${GBL_OS_TYPE_RHEL4}" ]; then
                     # its rhel4, add it
                     TO_BE_INSTALLED_LIST="${TO_BE_INSTALLED_LIST} srvadmin-ipmi-*.rhel4*"
+		elif [ "${GBL_OS_TYPE}" = "${GBL_OS_TYPE_CENT4}" ]; then
+                    # its centos4, add it
+                    TO_BE_INSTALLED_LIST="${TO_BE_INSTALLED_LIST} srvadmin-ipmi-*.rhel4*"
                 elif [ "${GBL_OS_TYPE}" = "${GBL_OS_TYPE_SLES9}" ]; then
                     # its sles9, add it
                     TO_BE_INSTALLED_LIST="${TO_BE_INSTALLED_LIST} srvadmin-ipmi-*.sles9*"
@@ -1303,7 +1307,7 @@
                     REJECTED_PATHS="/proc /boot /sys /etc /dev /lost\+found"
                     found_err=0
                     for e in ${REJECTED_PATHS} ; do
-                      if echo "${reloc_path}" | egrep -q "(^${e}/)|(^${e}$)" ; then
+                      if echo "${reloc_path}" | egrep -q '(^${e}/)|(^${e}$)' ; then
                         echo "  Path name cannot exist under the directory ${e}."
                         found_err=1
                         break
@@ -1381,6 +1385,12 @@
                         echo "$A_PKG" | grep "rhel4" >/dev/null 2>&1
                         if [ $? == 0 ]; then
                             FINAL_IPMI_INSTALL_LIST="${FINAL_IPMI_INSTALL_LIST} ${A_PKG}"
+			fi
+                    elif [ "${GBL_OS_TYPE}" = "${GBL_OS_TYPE_CENT4}" ]; then
+                        # its rhel4, allow it
+                        echo "$A_PKG" | grep "rhel4" >/dev/null 2>&1
+                        if [ $? == 0 ]; then
+                            FINAL_IPMI_INSTALL_LIST="${FINAL_IPMI_INSTALL_LIST} ${A_PKG}"
                         fi
                     elif [ "${GBL_OS_TYPE}" = "${GBL_OS_TYPE_SLES9}" ]; then
                         # its sles9, allow it
@@ -2708,7 +2718,7 @@
                 REJECTED_PATHS="/proc /boot /sys /etc /dev /lost\+found"
 
                 for e in ${REJECTED_PATHS} ; do
-                      if echo "${RELPATH}" | egrep -q "(^${e}/)|(^${e}$)" ; then
+                      if echo "${RELPATH}" | egrep -q '(^${e}/)|(^${e}$)' ; then
                         echo "${RELPATH}  Path name cannot exist under the directory ${e}."
 
                         SetErrorAndInterrupt 12
@@ -2813,6 +2823,10 @@
         GBL_OS_TYPE=${GBL_OS_TYPE_RHEL4}
         GBL_OS_TYPE_STRING="RHEL4"
 
+    elif [ -f /etc/redhat-release ] && [ `grep -c "CentOS release 4" /etc/redhat-release` -gt 0 ]; then
+        GBL_OS_TYPE=${GBL_OS_TYPE_CENT4}
+        GBL_OS_TYPE_STRING="CENT4"
+
     # Else check if operating system is SLES.
     elif [ -f /etc/SuSE-release ]; then
         LOC_VERSION=`cat /etc/SuSE-release | grep "VERSION" | sed  -e 's#[^0-9]##g'`
@@ -2942,7 +2956,7 @@
       return 0
 
   # unable to find system ID
-  echo "  Unsupported system (sysid=${SYSID})"
+  echo '  Unsupported system (sysid=${SYSID}) '
   SetErrorAndInterrupt 1
 }
 
@@ -3077,14 +3091,14 @@
    exit $INSTALL_STATUS
 fi
 
-if [[ $UPGRADE_STATUS != 0 ]]; then
-   echo ""
-   echo " -   Upgrade of some of the packages have failed."
-   echo " -   Please refer to 'readme_ins.txt' file for more details."
-   echo ""
-   let UPGRADE_STATUS =$UPGRADE_STATUS+200
-   exit $UPGRADE_STATUS
-fi
+#if [[ $UPGRADE_STATUS != 0 ]]; then
+#   echo ""
+#   echo " -   Upgrade of some of the packages have failed."
+#   echo " -   Please refer to 'readme_ins.txt' file for more details."
+#   echo " "
+#   let UPGRADE_STATUS =$UPGRADE_STATUS+200
+#   exit $UPGRADE_STATUS
+#fi
 
 exit 0

Save the above to a file named "srvadmin-install-centOS4x.patch", copy it to a directory where you have a local copy of the original srvadmin-install.sh.  Run patch -p0 < srvadmin-install-centOS4x.patch.  Then run srvadmin-install.sh to install the RPMS.

Regards,

Richard Andrews
Systems Administrator - IT Operations
Pelmorex Media Inc.
(905)  829-1159 x1243
randrews at pelmorex.com



More information about the Linux-PowerEdge mailing list