Go to menu

Updating the BIOS on HP laptops from Linux

2024-07-20

Having deleted the stock Windows install from my HP Envy x360 13-ay1222nc, I wanted to update its BIOS firmware without having to reinstall Windows. Thankfully, the days of creating DOS boot disks are mostly behind us and all reasonable firmware update processes involve copying some EFI flashing program and a firmware binary to the right place.

HP distributes its software as “SoftPaqs”, self-extracting archives. The one with my BIOS was named sp152697.exe and was readily extracted with 7z. Inside it was BIOSUpdate.exe, which 7z thankfully also knew how to deal with.

Inside the extracted .exe were some Windows-specific tools and drivers for flashing the BIOS and for preparing a recovery USB drive, and also the required files themselves: EFI binaries in CrisisFolder and DEVFW, and the BIOS firmware in 08929.fd.

Now I had to figure out where to place these files. Running HPFlashWinx64.exe in a Windows VM showed that it could create a recovery USB drive. That resulted in this folder structure on the drive:

USB drive (single FAT32 partition)
├── HP
│   ├── BIOS
│   │   ├── Current
│   │   │   ├── 08929.bin
│   │   │   └── 08929.sig
│   │   ├── New
│   │   └── Previous
│   ├── BIOSUpdate
│   │   ├── Contents of CrisisFolder
│   └── DEVFW
│       ├── Current
│       │   ├── PD_F8.07.12.F9.33.bin
│       │   ├── PD_F8.07.12.F9.33.sig
│       │   └── PD_F8.07.12.F9.33.s12
│       ├── New
│       ├── Previous
│       └── Contents of DEVFW
└── Hewlett-Packard
    └── Copy of HP

Copying files into folders is easy enough, but clearly the 08929.fd had been split into .bin, .sig and .s12 parts. I couldn’t find any dedicated utility for extracting the composite .fd file, and it didn’t look easy to reverse engineer.

I gave up and ran HPFlashWinx64.exe under Wine. The option of creating a recovery disk failed, but it thankfully also offers to just extract (“copy”) the files. I was now able to fully re-create the folder structure from Linux.

I didn’t end up running the BIOS update from an external USB device, instead I copied the HP directory to my ESP as \EFI\HP. I shut down my laptop and held down Windows+B. It turned on by itself and started the BIOS update process.

Note that there’s a popular Gist detailing how to do this, but for an older model. The comments may be helpful nonetheless.

HP offer some interesting tools for Linux that might allow flashing the BIOS directly, but also modifying/reading UEFI setting. They do this through a dodgy kernel driver that gives userspace direct access to some memory port, so I much prefer the UEFI method which runs the proprietary firmware updater in a simpler and known (to the authors) environment. It might still be of interest for changing UEFI settings, as an analogue to Windows tools.