Creating a bootable USB for HP SPP ISO images

The steps below were tested to work on Devuan 1.0 and were used to update an HP ProLiant DL380e Gen8.

Based on the blogpost Eren Türkay - Creating Bootable USB For HP Blades (Service Pack).

Tools needed:

Change /dev/sdd in the below example commands to the device name of the USB device.

Quick check: insert the USB device, execute the 'dmesg' command, and check the last lines for the /dev/sdX name (where X is the letter of the device.

Get the HP SPP ISO from the hpe.com website. Tested with SPP 2017.04.0 (871795_001_spp-2017.04.0-SPP2017040.2017_0420.14.iso)

As ms-sys does not seem to be available in Devuan 1.0 packages we need to get and compile the program.
Get ms-sys-2.5.3.tar.gz from the ms-sys website.

Extract:

tar xzvf ms-sys-2.5.3.tar.gz

Compile:

cd ms-sys-2.5.3
make

The ms-sys executable can now be found in the ./bin/ directory.
You can install it with 'make install' but I did not and used it from the compile directory instead.

# zero-out mbr
ms-sys -z /dev/sdx

# create msdos label
parted -s /dev/sdx mklabel msdos

# write syslinux MBR provided by ms-sys 
ms-sys -s /dev/sdx

Start fdisk on the USB drive:

fdisk /dev/sdd

Enter the following commands in fdisk (partial instruction):

  1. n one primary partition, using all space
  2. t and set it to type 'c' (w95 fat)
  3. a to set it bootable
  4. w to write changes

Format the partition as FAT32 (-F 32) and volume name USB (-n USB):

/sbin/mkfs.vfat -F 32 -n USB /dev/sdd1

Install syslinux on the USB drive:

/usr/bin/syslinux -i /dev/sdd1

Create the directory iso and usb under /mnt/ to mount the ISO and the USB drive:

mkdir /mnt/iso
mkdir /mnt/usb

Mount the iso and the USB drive.

mount 871795_001_spp-2017.04.0-SPP2017040.2017_0420.14.iso /mnt/iso
mount /dev/sdd1 /mnt/usb

Copy the files to the USB drive:

# Set source and destination variables.
export HP_SOURCE="/mnt/iso"
export HP_USB_DISK="/mnt/usb"

# Copy all the files from the ISO to the USB drive.
rsync -rltDuvh --progress $HP_SOURCE/ $HP_USB_DISK/

# Copy files required for booting from the /system/ directory on the ISO to the base of the USB drive.
cp -rf $HP_SOURCE/system/initrd.img $HP_USB_DISK
cp -rf $HP_SOURCE/system/vmlinuz $HP_USB_DISK
cp -rf $HP_SOURCE/system/*.c32 $HP_USB_DISK
cp -rf $HP_SOURCE/system/*.jpg $HP_USB_DISK
cp -rf $HP_SOURCE/system/blacklist $HP_USB_DISK
cp -rf $HP_SOURCE/system/sample.msg $HP_USB_DISK
cp -rf $HP_SOURCE/usb/syslinux.cfg $HP_USB_DISK

# HP's vesamenu file gives error. Copy vesamenu from system.
cp -f /usr/lib/syslinux/modules/bios/vesamenu.c32 $HP_USB_DISK

# Syslinux 6.03 needs extra files in addition to it's vesamenu.c32
cp -f /usr/lib/syslinux/modules/bios/libcom32.c32 $HP_USB_DISK/
cp -f /usr/lib/syslinux/modules/bios/libutil.c32 $HP_USB_DISK/

# Sync the changes to disk.
sync

Unmount the ISO and the USB drive:

umount /mnt/iso
umount /mnt/usb

Now the USB drive should be bootable and ready to use for firmware upgrades.