Mikko Kortelainen

Upgrading HP Proliant iLO2 Firmware with Ubuntu Server

I downloaded the firmware from HP site. It was named CP019022.scexe. I tried uploading it in the iLO2 web interface, but it was rejected. Next, I copied it to the server, gave it execute permissions and ran it:

root@host:~# ./CP019022.scexe
./CP019022.scexe: 153: ./CP019022.scexe: pushd: not found
./CP019022.scexe: 158: ./CP019022.scexe: popd: not found
./CP019022.scexe: 96: ./CP019022.scexe: ./flash_ilo2: not found

Not working. This is a fresh installation of Ubuntu Server 12.04.2 LTS x86_64. So I had to start looking closer. The file is a bash script but the hashbang is #!/bin/sh, which puts bash into old Bourne shell mode. No pushd/popd there.Second try with bash proper:

root@host:~# bash CP019022.scexe
CP019022.scexe: line 96: ./flash_ilo2: No such file or directory

Still not working. Looking at the code, after the script comes a gzipped binary blob, which seems to be a tar archive. This is unpacked by the script before the blob. The lines to discard before binary starts are in this variable:

_SKIP=347

Let's decompress it:

root@host:~# tail -n +347 CP019022.scexe | gunzip > cp019022.tar

Then take a look at the contents:

root@host:~# tar tvf cp019022.tar
-rw-rw-rw- root/root    322387 2013-01-18 16:36 CP019022.xml
-rwxr-xr-x root/root     76812 2009-09-01 18:46 flash_ilo2
-rw-r-xr-x root/root   3145728 2013-01-17 23:03 ilo2_215.bin
-rw-r-xr-x root/root      5565 2013-01-18 16:20 README.TXT

There's the "flash_ilo2" tool and the "ilo2_215.bin" file which seems to be the actual firmware. Unpack archive:

root@host:~# mkdir cp019022
root@host:~# tar xvf cp019022.tar -C cp019022
CP019022.xml
flash_ilo2
ilo2_215.bin
README.TXT

The readme file says you could actually take the .bin file and use the web interface to upgrade using that. So that's one possibility.

Trying the flash_ilo2 command:

root@host:~/cp019022# ./flash_ilo2
./flash_ilo2: No such file or directory

Doesn't seem to run. Examine the file a bit further:

root@host:~/cp019022# file flash_ilo2
flash_ilo2: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped

So it is a 32-bit executable. Ubuntu server has no 32-bit ELF loader installed by default. That can be fixed with:

root@host:~/cp019022# sudo apt-get install libc6-i386

And:

root@host:~/cp019022# ./flash_ilo2

FLASH_iLO2 v1.12 for Linux (Aug 31 2009)
Copyright 2009 Hewlett-Packard Development Company, L.P.
Firmware image: ilo2_215.bin
Current iLO 2 firmware version  2.05; Serial number ILOCZC7402XR0

Component XML file: CP019022.xml
CP019022.xml reports firmware version 2.15
This operation will update the firmware on the
iLO 2 in this server with version 2.15.
Continue (y/N)?

It works! So seems like the easy fix is installing 32-bit libc. The original .scexe seems to work as well, although there are a couple of error messages.