Andrew Robert Nicols wrote, On 11/17/2009 01:53 AM:
> On Mon, Nov 16, 2009 at 11:17:02AM -0700, Stephen Dowdy wrote:
>> I am working from *experience* that i have had to create my own
>> deployment scripts using the payloads from the DUP kits to get a
>> reliable and workable firmware update mechanism on Debian Lenny.
>> (i have one for PERC4/5/6 and one for BIOS updates)
> 
> Hi Stephen,
> 
> Would you be able/willing to share these scripts?
> 
> I'm aware of a reasonable way in which to upgrade Dell BIOSes (libsmbios),
> but a decent way to upgrade PERC firmware has still been eluding me under
> Debian.
...
> Thank you in advance,
> 
> Andrew Nicols


Andrew, (and list),

(i'm gonna be terse and rambling here, and don't really have time to
expand on anything here, but hopefully it's of value to you)

I'm not real proud of these scripts, but i don't have time to pretty
them up or fix their deficiencies at this point.  Realize these are
just glue around 'libsmbios' and megarc/megacc/linttylog/linflash,
which are bits you will have to retrieve from linux.dell.com and
lsi.com yourself. (linflash and megarc/megacc (basically the same
program), can be pulled out of the DUP kits from support.dell.com
for the PERC4 as well).

You also have to retrieve/extract the .ROM images from the DUP
payloads from support.dell.com via something like:

   sh ./RAID_XXXXXX.BIN --extract RAIDFW
   cp RAIDFW/payload/* /path/to/Directory_containing_Flash_PERCs/

(e.g. HERE's what my /usr/local/PERC4_Updater dir looks like:
I've renamed some of the .ROM files to help identify them better)

pick:BIOS# ls /usr/local/PERC4_Updater/
518_PERC4DC+SC_v352D.rom*  KB_PERC4eDi_v5A2D.rom*  megacc*                   
perc4e-FWKB5A2D-A18.txt*
520_PERC4eDC_v5A2D.rom*    linflash*               megacc.bin*               
perc4-FWP4352D-A22.txt*
BB_PERC4eSi_v5A2D.rom*     linflash.bin*           megarc.log                
tty.log
EV_PERC4Di_v422D.rom*      linttylog*              perc4e-FWBB5A2D-A18.txt*
Flash_PERCs*               linttylog.bin*          perc4e-FWDC5A2D_A17.txt*



for the PERC5/PERC6, as i mentioned in a previous message, it's simply:

./MegaCli -AdpFwFlash -f ROMIMAGE.rom -aALL

(where you get megacli from lsi.com for any SAS 8xxx series controller)

AFAICT, the LSI flashing facility is smart enough to NOT overwrite
firwmare on the card with something bad/wrong, but if your board
stops working, it's not my fault!  Note that the PERC4 updater
has some functions from a Dell DUP kit to disable background
initialization functions, and re-enable after flashing.


for the BIOS_Updater, i plan on changing the way i name the .HDR
payloads but currently i rename like:

PWS370-BIOSA08.HDR
PE1950-020403C.HDR
PER710-010206.HDR
PWST3500-BIOSA03.HDR

Please note that for the PWS series, you get BIOS update .BIN files.
You can obtain the .HDR image from these to use with the "BIOS_Updater"
script via (for example, for the PWS T3500 - my desktop system)

./T3500A03.BIN -writehdrfile
cp flash.hdr 
/path/to/Directory_containing_BIOS_Updater/BIOS/PWST3500-BIOSA03.HDR

This works with the Windows-Only systems' {BIOS-DUPKIT}.EXE
packages, too.  I just did this with my Latitude E4300 that runs
Debian Lenny by downloading the DUP .EXE from support.dell.com,
running:

    $ wine E4300A12.EXE -writehdrfile

This presents a GUI dialog saying something like:

     HDR File E43000A12.hdr written

Hurrah! (it's left in the current directory and is a Dell RBU
(Remote BIOS Update) hdr file)

$ file *.hdr
E4300A12.hdr: Dell system BIOS version A12

(as root)
# /usr/local/DellUpdates/dellBiosUpdateS -f E4300A12.hdr -u
(the way i gen a system tag doesn't handle "latitude series"
in BIOS_Updater yet, -- left as exercise for the reader)

(to DELL:  *PLEASE* DO NOT REMOVE THIS UNDOCUMENTED "-writehdrfile"
FEATURE, if you're only going to provide us with Windows executables
for updating our BIOS's.)

e.g.:

zia:tmp# /usr/local/DellUpdates/BIOS_Updater
WARNING: BIOS HDR file BIOS version appears to be less than or equal to current 
BIOS version.
         This may result in bad things happening!
         Exiting...
I don't think it would be wise to attempt an automatic BIOS update at this point
If \*YOU\* do, you can type:
  dellBiosUpdateS -f 
/var/autofs/mnt/linux-amd64/common/local/DellUpdates/BIOS/PWST3500-BIOSA03.HDR 
-u
yourself, but do not blame me!


NOTE: i don't have a good way of updating BMCs as the BMC updater ONCE
worked by itself on Debian, but i've seen it changed to a giant HAPI
fuzzball that fails to run on Debian anymore. (haven't tried it lately).
There MAY be cases where updating the BIOS on a system and NOT the BMC,
may be bad for your health.

Good luck!
--stephen

-- 
Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL
303.497.2869   -  [email protected]        -  http://www.ral.ucar.edu/~sdowdy/
#!/bin/bash

is_debug() { [ -n "${DEBUG}" ] ;}

debug() { is_debug && echo "DEBUG: " "$@" 1>&2 ;}

this_prog=$(readlink -f $0)
this_dir=$(dirname ${this_prog})
bios_dir=${this_dir}/BIOS

debug "prog=${this_prog}, dir=${this_dir}"

PATH=${this_dir}:${PATH}

pe_model="$(
    getSystemIdS | \
    sed -n -e 's/Product Name: PowerEdge /PE/p' \
        -e 's/Product Name: Precision WorkStation /PWS/p' \
        | tr -d ' '
    )"

pe_bios_ver="$(getSystemIdS | sed -n -e 's/^BIOS Version: //p')"

# Assume there's only one?
pe_bios_hdr="$(/bin/ls -1t ${bios_dir}/${pe_model}-*.HDR | head -1)"

debug "This System appears to be ${pe_model}"
debug "existing BIOS version=${pe_bios_ver}"
debug "best guess BIOS HDR image for this box = ${pe_bios_hdr}"

if [ ! -f ${pe_bios_hdr} ]; then
  echo "I can not seem to find a BIOS HDR file for this system"
  echo "exiting"
  exit 1
fi

modprobe dell_rbu
if lsmod | grep -q '^dell_rbu '; then
  :
else
  echo "Hmm, i do not seem to see the "dell_rbu" kernel module loaded"
  echo "exiting..."
  exit 1
fi

if dellBiosUpdateS -f ${pe_bios_hdr} -t; then
    echo "I will do :"
    echo "  dellBiosUpdateS -f ${pe_bios_hdr} -u"
    echo -n "Proceed? (y/n) :"
    read huh; 
    case "${huh}" in
        y*|Y*)  dellBiosUpdateS -f ${pe_bios_hdr} -u     ;;
        *)  echo "Whew, you avoided disaster!"  ; exit 0 ;;
    esac
else
   echo "I don't think it would be wise to attempt an automatic BIOS update at 
this point"
   echo "If \*YOU\* do, you can type:"
   echo "  dellBiosUpdateS -f ${pe_bios_hdr} -u"
   echo "yourself, but do not blame me!"
fi


exit 0

: <<END_NOTES

------------------------------------------------------------------------------
saw:DellUpdates# ./dellBiosUpdateS -f BIOS/PE1750-BIOSA12.HDR -t
BIOS file matches this system and is newer.
saw:DellUpdates# echo $?
0

saw:DellUpdates# ./dellBiosUpdateS -f BIOS/PE1850-BIOSA06.HDR -t
WARNING: BIOS HDR file does not contain support for this system.
         This may result in bad things happening!
         Exiting...
saw:DellUpdates# echo $?
1


saw:DellUpdates# modprobe dell_rbu
saw:DellUpdates# ./dellBiosUpdateS -f BIOS/PE1750-BIOSA12.HDR -u
Supported RBU type for this system: (MONOLITHIC)
Using RBU v2 driver. Initializing Driver. 
Setting RBU type in v2 driver to: MONOLITHIC
Prep driver for data load.
Writing RBU data (4096bytes/dot): 
.................................................................................................................................
Notify driver data is finished.
Activate CMOS bit to notify BIOS that update is ready on next boot.
Update staged sucessfully. BIOS update will occur on next reboot.

END_NOTES
#!/bin/sh
# PERC4 and PERC4e firmware updater kit
# Some of this code is from a Dell DUP kit
# script (disableCCBI/enableBI.

is_debug() { [ "$DEBUG" = 1 ] ;}
debug() { is_debug && echo "DEBUG: " "$@" 1>&2 ;}

megacc="./megacc.bin -nolog"

if is_debug; then
  errout="/dev/tty"
else
  errout="/dev/null"
fi

# Not used
retcode=1;

# PERC 3            "471.rom"   Ctrl_Type=FP3
# PERC 4/SC/DC      "518.rom"   Ctrl_Type=FP4
# PERC 4e/DC        "520.rom"   Ctrl_Type=FP4E
# PERC 4/Di PE2600  "Disc.rom"  Ctrl_Type=FD
# PERC 4/Di PE1750  "EV.rom"    Ctrl_Type=FE
# PERC 4e/Di PE2850 "KB.rom"    Ctrl_Type=FDRB
# PERC 4e/Di PE2800 "CV.rom"    Ctrl_Type=FDRB
# PERC 4e/Di PE6800 "EX.rom"    Ctrl_Type=FDRB
# PERC 4e/Di PE6850 "GU.rom"    Ctrl_Type=FDRB
# PERC 4e/Si PE1850 "BB.rom"    Ctrl_Type=FDRB
# Let's start a consistency Check on *ALL* controllers, all logvols
Ctrl_Type="alladp"

ctrl_cnt="`${megacc} -alladpinfo | grep -A10 'AdapterNo' | tail +2 | wc -l`"
debug "I found ${ctrl_cnt} PERC controllers (i think)"
is_debug && ${megacc} -alladpinfo | grep -A10 'AdapterNo' | tail +2

disableCCBI() {
    # Aborting CCBI
    # Disabling CCBI
    for adapter in $(seq 0 $(expr ${ctrl_cnt} - 1)); do
      debug "${megacc} -abortccbi -a${adapter}"
      ${megacc} -abortccbi -a${adapter} > ${errout} 2>&1
      debug "${megacc} -disablebi -a${adapter}"
      ${megacc} -disablebi -a${adapter} > ${errout} 2>&1
    done
}

enableBI() {
    # Starting and Stopping CC
    debug "${megacc} -startstopCC -$Ctrl_Type"
    ${megacc} -startstopCC -$Ctrl_Type > ${errout} 2>&1

    # Enabling BI 
    for adapter in $(seq 0 $(expr ${ctrl_cnt} - 1)); do
      debug "${megacc} -enablebi -a${adapter}"
      ${megacc} -enablebi -a${adapter} > ${errout} 2>&1
    done
}

is_debug && { ${megacc} -alladpinfo ; ${megacc} -ldinfo -a0 -Lall }

disableCCBI

./linflash -q | grep -A99 "Following Adapters found"

if false; then
# Flashing FW
if is_debug; then
  debug "./linflash -q"
  ./linflash -q
  ./linflash -r -v $@
else
  ./linflash -q
  ./linflash -r -v $@
fi
utility_retcode=$?

else    # false
  echo "Trying to Flash all ROM images in sequence.  An error message is"
  echo "not necessarily a failure.  Hopefully you will see at least one"
  echo "Firmware Flash Successful message indicating you need to reboot"
  echo "for the update to finalize"
  echo ""
  echo "-- PLEASE BE PATIENT - FLASH CAN TAKE SEVERAL MINUTES..."
  echo " ..."
  for romimg in *.rom; do
    echo "------"
    echo "Attempting to Flash ROM image : ${romimg} ..."
    ./linflash -s -f ${romimg}
    case $? in
       0) echo "Firmware Flash Successful; You should REBOOT soon to take 
effect"
          ;;
       1) echo "Check Consistency in progress. Flashing cannot proceed!"
          echo "This shouldn't have happened, as we issued an -abortccbi 
operation already!?"
          ;;
       4) echo "File(s) specified are not valid or not found."
          echo "This is usually due to attempting to flash an incompatible 
image and is harmless"
          ;;
       6) echo "Another instance is already running. Program terminated."
          ;;
       9) echo "Firmware flash failed on adapter 0"
          echo "This may be because this f/w image is in the same family, but 
not compatible,"
          echo "or it could be a bigger problem"
          ;;
       *) echo "An Unknown error status=$? occured"
          echo "ERROR: Ask SDowdy for assistance"
          ;;
    esac
  done
fi      # false

enableBI

# Run a Consistency Check on all Logical Drives
echo "-------------------------"
echo "To run consistency checks on Logical Drives (highly recommended),"
echo "  please type the following --  Note that you will need to <CTRL>-<C>"
echo "  shortly after starting, as this command goes into perpetual VIEW"
echo "  mode on the progress.  Aborting with <CTRL>-<C> won't abort the"
echo "  background Check Consistency run.  You can check later with"
echo "  ${megacc} -viewbiccprog -aADAPTER-NUMBER"
for adapter in $(seq 0 $(expr ${ctrl_cnt} - 1)); do
    debug "${megacc} -chkonLd -a${adapter}"
    echo ${megacc} -chkonLd -a${adapter} -Lall
done


exit ${utility_retcode}

: <<END_NOTES
----------------------------------------------------------------------
         cmd -StartStopCC -aX|-alladp|-FP3|-FP4|-FE|-FD|-FP4E|-FDRB
         : Starts and Stops CC on all optimal logical drives
           with RAID level 5/50 and number of stripes >=5
        **********************************************************************
         where :
           cmd : name of the utility
           -aX : adapter number X(max 12 adapters). X=0..11
          OR
          -alladp : operation will be performed on all adapters
          OR one of the following
           -FP3:  PERC3 Family
           -FP4:  PERC4 Family
           -FE:   Everglades
           -FD:   Discovery
           -FP4E: PERC4e/DC
           -FDRB: DobsonROMB Family
        **********************************************************************


usage : linflash [-r] [-p] [-s] [-q] [-v] [-i [file] [file] [...]] [-f [file] 
[file] [...]] [-xml]
  -r : Flash without asking for user input to flash adapter(s). 
  -p : Prompt user for filename. Flash without checking for signatures.
  -q : Query all adpaters and quit.
  -s : Silent flash. First matching image file will be taken for each adapter.
  -i : Ignore the following files. These files will not be considered for 
       flashing the matching controllers.
  -f : Force the following files to be flashed for the matching controller.
       In case more than one matching files are specified, the first one 
       will be taken.
  -v : Compare the firmware version before flashing.
-xml : Place output in XML format.


Return Codes:

0 - success
1 - Check Consistency in progress. Flashing cannot proceed!
4 - File(s) specified are not valid or not found.
9 - Firmware flash failed on adapter 0

If "Another Instance" message comes up, it's probably due to interrupting
a linflash in progress.  We need to remove the semaphore, using the
following process...

umds-in1:/opt/megarc/FLASH_KIT # ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x00471493 163840     root      0          1         

(verify by stracing.  not sure if semid will always be the above?)
grep sem /tmp/strace.out
3241  semget(4658323, 1, IPC_CREAT|0)   = 163840
3241  semctl(163840, 0, IPC_64|GETVAL, 0xbfffdd84) = 1
umds-in1:/opt/megarc/FLASH_KIT # ipcrm -s 163840
umds-in1:/opt/megarc/FLASH_KIT # ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     

(it's gone!)
END_NOTES
_______________________________________________
Linux-PowerEdge mailing list
[email protected]
https://lists.us.dell.com/mailman/listinfo/linux-poweredge
Please read the FAQ at http://lists.us.dell.com/faq

Reply via email to