AW: updating iDrac under CentOS

Marciniszyn, Michael A michael.a.marciniszyn at lmco.com
Fri Mar 6 09:51:55 CST 2009


This issue was also affecting us, although we were using the Altiris Linux Pre OS to do the updates in an automated fashion.

We were able to produce a 1.20 .BIN that works (using RHEL4.5) with this procedure:

1. Cut/Paste the scripts from below (at snip).
2. Download PEM600_ESM_FRMW_LX_R186432.BIN (the 1.11 version) to the current directory.
3. Download PEM600_IDRAC_FRMW_LX_R197554.BIN (the 1.20 version) to the current directory.
4. Create iDDRAC-1.11 and iDRAC-1.20 in the current directory.  Use the -extract option on the both to iDRAC-1.11 and iDRAC-1.20 in the current directory:
  ./ PEM600_ESM_FRMW_LX_R186432.BIN -extract iDRAC-1.20
  ./ PEM600_IDRAC_FRMW_LX_R197554.BIN -extract iDRAC-1.11
4. Run the attached crackdup.sh on the 1.11 .BIN to produce sezgen.sh, package.xml, and archive.tar.gz in the current directory:
  sh ./crackdup.sh PEM600_ESM_FRMW_LX_R186432.BIN
5. Copy iDRAC-1.20/payload/firmimg.imc to iDRAC-1.11, overwriting the 1.11 firmware file.
6. Copy the iDRAC-1.20/package.xml to iDRAC-1.11.
7. Copy iDRAC-1.20/package.xml to overwrite package.xml in the current directory.
8. cd to iDRAC-1.11. and run the following command to update the tar archive:
   tar -zcvf ../archive.tar.gz
9. Run rebuilddup.sh:
   sh rebuilddup.sh PEM600_IDRAC_FRMW_LX_R197554-CUSTOM.BIN

This .BIN file is deployable from RHEL command line or from Altiris and the result is a 1.20 version.
---- snip crackdup.sh -------------------------------------------------------------------------------------
#!/bin/sh
typeset -r _PACKAGE_GENERATOR="sezgen.sh"
typeset -r _PACKAGE_NL="uni-eol.txt"
typeset -r _MANIFEST_XML="package.xml"
typeset -r _DUP_ARCHIVE="archive.tar.gz"
typeset _MANIFEST_XML_MARKER="#####Startofpackage#####"
typeset _DUP_ARCHIVE_MARKER="#####Startofarchive#####"

# Finds the line number of a marker in the Dup package file
_getMarkerLine() {
    grep -m1 -an "^$1" $_PACKAGENAME | cut -d ":" -f 1
}

# Extracts the Sez generator script, package.xml, or tar archive file from the Dup package file
_extract() {
    typeset -i iManifest=$(_getMarkerLine "$_MANIFEST_XML_MARKER")
    typeset -i iArchive=$(_getMarkerLine "$_DUP_ARCHIVE_MARKER")
    typeset -i iDupGen1=iManifest-2
    typeset -i iPackage0=iManifest+1
    typeset -i iPackage1=iArchive-2
    typeset -i iArchive0=iArchive+1
    case $1 in
    "$_PACKAGE_GENERATOR")
        #msgFmt "$1 offset to end: 0 to ${iDupGen1}" >&2
        head -n ${iDupGen1} $_PACKAGENAME
        ;;
    
    "$_MANIFEST_XML")
        #msgFmt "$1 offset to end: ${iPackage0} to ${iPackage1}" >&2
        head -n ${iPackage1} $_PACKAGENAME | tail -n +${iPackage0}
        ;;
    
    "$_DUP_ARCHIVE")
        #msgFmt "$1 offset: ${iArchive0}" >&2
        tail -n +${iArchive0} $_PACKAGENAME
        ;;

    *)
        echo "Tried to extract $1: can only extract package.xml or sampleexecution.bin"
        ;;
    esac
}


_PACKAGENAME=$1
_extract $_PACKAGE_GENERATOR > $_PACKAGE_GENERATOR
_extract $_MANIFEST_XML > $_MANIFEST_XML
_extract $_DUP_ARCHIVE > $_DUP_ARCHIVE
---- snip rebuilddup.sh ---------------------------------------------------------------------------
#!/bin/sh
# Embedded files and markers
typeset -r _PACKAGE_GENERATOR="sezgen.sh"
typeset -r _PACKAGE_NL="uni-eol.txt"
typeset -r _MANIFEST_XML="package.xml"
typeset -r _DUP_ARCHIVE="archive.tar.gz"
typeset _MANIFEST_XML_MARKER="#####Startofpackage#####"
typeset _DUP_ARCHIVE_MARKER="#####Startofarchive#####"

# Concatenates Sez generator script, package.xml, and tar archive files into Dup package
_buildPackage() {
    [ $# -eq 3 ] || echo "_buildPackage: requires 3 files"
    [ -f $1 ] || echo "_buildPackage: $1 is not a regular file"
    [ -f $2 ] || echo "_buildPackage: $2 is not a regular file"
    [ -f $3 ] || echo "_buildPackage: $3 is not a regular file"
    cat "$1" || return $?
    echo
    echo $_MANIFEST_XML_MARKER
    cat "$2" $_PACKAGE_NL || return $?
    echo
    echo $_DUP_ARCHIVE_MARKER
    cat "$3" || return $?
}

_buildPackage $_PACKAGE_GENERATOR $_MANIFEST_XML $_DUP_ARCHIVE > $1



More information about the Linux-PowerEdge mailing list