Skip to content

Instantly share code, notes, and snippets.

@eNV25
Last active April 28, 2024 20:55
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save eNV25/c8001491dc0440656ff7b0ae18993ba1 to your computer and use it in GitHub Desktop.
Save eNV25/c8001491dc0440656ff7b0ae18993ba1 to your computer and use it in GitHub Desktop.
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

Install HP-specific files

We can obtain the HP-specific files using HP's HP PC Hardware Diagnostics 4-IN-1 USB KEY installer. This installer contains the needed files. We can simply extract this installer and copy the needed files to the ESP

HP's installer only runs on Windows, but it is possible to extract it by running the self-extracting executable on Wine. You cannot simply extract the executable using 7-zip because the executable needs to do some file generation.

Download the executable. You can get the URL to the latest executable from HP's website.

$ wget https://ftp.hp.com/pub/softpaq/sp112501-113000/sp112853.exe

Run the executable using wine. This will extract its contents to ./sp112853.

$ wine sp112853.exe /s /e /f sp112853

Copy the HP-specific files to the the ESP.

# cp -r sp142721/field/{Hewlett-Packard,HP} /efi/EFI/

According to HP, this works for most hardware. For some cases you may need additional files. I have tired this with an HP Pavilion 13-an0008ne Laptop only, which required no additional steps.

Install BIOS update

You'll need to find you updated BIOS image. You can find one by going to HP's Software and Drivers page, and input your serial number. Make sure you select Windows as your Operating System, otherwise it may not show the updates.

These drivers often also come in Windows executables, you should run them in wine. The executable will first fail to install automatically. Then it will display different options on how to procede. Select the Copy option and select a directory where the BIOS image and the key file should be copied to.

$ wget https://ftp.hp.com/pub/softpaq/sp112501-113000/sp112516.exe
$ wine sp112516.exe /s /f sp112516           # extract and execute

Complete BIOS update using HP Hardware Diagnostics

There should be a .bin and an .s12 file. Copy these files to the ESP to the directory /efi/EFI/Hewlett-Packard/BIOS/New and /efi/EFI/HP/BIOS/New. Here I am using 084C5 as an example.

# mkdir /efi/EFI/Hewlett-Packard/BIOS/New
# cp sp112516/084C5{.bin,.s12} /efi/EFI/Hewlett-Packard/BIOS/New
# mkdir /efi/EFI/HP/BIOS/New
# cp sp112516/084C5{.bin,.s12} /efi/EFI/HP/BIOS/New

At this point you should have the needed HP-specific files and the BIOS update installed in the ESP. Now, you can actually complete the update.

Boot into firmware settings and press F2 to enter HP Hardware Diagnostics. You should be presented a menu and there should a menu entry named BIOS Management. Navigate to BIOS Management > Update BIOS. Your BIOS should start updating.

If you have enabled Secure Boot with custom keys, you will first need to sign the HP-specific .efi files.

Complete BIOS update using Win+B key combination

Sometimes the previous method does not work, and the BIOS Management option does not show up. You can alternatively copy the .bin and .s12 file to /efi/EFI/Hewlett-Packard/BIOS/Current or /efi/EFI/HP/BIOS/Current, and press Win-B while the PC is booting up. This key combination should cause a BIOS firmware recovery using the files you copied.

Also note that updating will re-enable Secure Boot if had it disabled. If so, you might want to disable it again. Your custom Secure Boot keys will be preserved.

@DJCrashdummy
Copy link

@eNV25 it seems, i found an alternative to the Win+B way:
i also had the issue of BIOS Management not showing up... but instead of rebooting and fiddling around with the files again, i knew it must be bootable. so i pressed F9 while booting to get to the boot priority menu. beside some entries to choose, at the bottom the line Boot From EFI File can be selected.
i looked a little bit around at HP resp. Hewlett-Packard and its subfolders and thanks to its meaningful names it was clear to use HpBiosUpdate.efi (attention: for nearly every *.efi file there is also a *32.efi file, which is - i'm pretty sure - only for 32bit-systems) and also fortunately this file was only present in one of the two folders.
so i chose Hewlett-Packard/BIOSUpdate/HpBiosUpdate.efi and instantly the BIOS update started... it took some time and even after the "initial flash" with a somewhat "nicer GUI" it rebooted and continued with a more "bare mettle TUI" (white text on black background) the flashing & verifying for at least further 6 or more parts.
after that it rebooted again and asked if i want to enable the TPM (to use Windows 11), but Secure Boot was deactivated and stayed so.
interestingly after the update i checked again and only one *.bin file with its corresponding *.sig file was gone resp. moved to the Current folder, but just in the HP/BIOS/ folder. in the Hewlett-Packard/BIOS/New folder still all 4 *.bin files with its *.sig files remained there.

i have no idea, if this is a proper way to do it, or if i just was lucky to get somewhere and not destroying this notebook.
maybe someone with a deeper knowledge regarding this process can confirm this method or advise against it.
beside that, it is still mysterious to me, why there are 2 folders HP and Hewlett-Packard which content is quite similar but not completely identical and the payload has to be copied to both of them. -> i would also appreciate some insight into that topic!

@eNV25
Copy link
Author

eNV25 commented Jan 31, 2024

@DJCrashdummy that's pretty cool. I had no idea.

I'm not updating this page because I haven't tried it yet.

@jsoques
Copy link

jsoques commented Feb 8, 2024

Why go through all this hassle when you can update the HP Bios through the bios settings itself? Am I missing something? I just updated the bios of my HP Elitedesk 705 G4 mini pc. The only requirement is that it be connected to the internet with the Ethernet cable.

@berarma
Copy link

berarma commented Feb 8, 2024

Why go through all this hassle when you can update the HP Bios through the bios settings itself? Am I missing something? I just updated the bios of my HP Elitedesk 705 G4 mini pc. The only requirement is that it be connected to the internet with the Ethernet cable.

I don't think this is possible with every model.

@jsoques
Copy link

jsoques commented Feb 9, 2024

Why go through all this hassle when you can update the HP Bios through the bios settings itself? Am I missing something? I just updated the bios of my HP Elitedesk 705 G4 mini pc. The only requirement is that it be connected to the internet with the Ethernet cable.

I don't think this is possible with every model.

Oh ok!

@dmitrmax
Copy link

dmitrmax commented Feb 9, 2024

Why go through all this hassle when you can update the HP Bios through the bios settings itself? Am I missing something? I just updated the bios of my HP Elitedesk 705 G4 mini pc. The only requirement is that it be connected to the internet with the Ethernet cable.

Because HP made a fetish out of it on the low end laptops by not including appropriate bios setting into the bios firmware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment