Skip to content

Instantly share code, notes, and snippets.

@eNV25
Last active April 14, 2024 15:31
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 3 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.

@mxkrsv
Copy link

mxkrsv commented Jan 16, 2022

Yo @eNV25, just tested on 2012-2013 laptop (hp envy 6-1153er) and it required no additional steps (everything just worked), so I guess that section with warning may be removed.

@eNV25
Copy link
Author

eNV25 commented Jan 19, 2022

The links don't work anymore. I will try to update. But the site still mentions something about "Additional Softpaqs for BIOS recovery support on 2020 (and previous) products".

@PeterM18
Copy link

Hi eNV25:

Thanks for posting what looks like the most plausible approach I've seen so far for updating an HP laptop with only linux (and I've spent days trying various approaches).

Unfortunately, I ran into a problem with your method. When I run the windows / wine command on the BIOS update, sp141894.exe, I don't get the two files your instructions indicate, but instead a new .exe file named 086AAF17.exe . 

So, I tried running the windows / wine command on 086AAF17.exe. It indicates it is extracting an archive. When it is done, I see no new file or folder. I've tried a kfind search from / for 086AAF17 (I named the folder 086AAF17 in the command) in case it created something elsewhere on my disk. This finds only the original 086AAF17.exe.

I've tried this in Wine. I also tried it on a Windows laptop--in case Wine is missing something important to creating the files. As with Wine, when I run 086AAF17.exe, it shows a progress bar indicating an archive extraction, but I see nothing on the disk after it is completed. On the Windows laptop (and perhaps the linux desktop I worked on), I'm concerned the operation might have stuck something in some hidden place on my disk that will flash my bios with an inappropriate bios image on reboot. That's less likely on Linux because I'd expect to see something under /boot, but do not. Not sure where to look in windows.

Anyway, I can extract 086AAF17.exe using 7z. But, I have read elsewhere that 7z is not appropriate because the .exe content needs to be processed. Maybe that's not the case here because the first .exe was processed and the second seems not to take any processing? On the other hand, I'd rather not brick my laptop.

Using 7z, I see a .bin file that looks the right size, but I also see multiple .s12 files--so am a bit unsure which to use. There is a readme, which indicates, e.g.:
HpDevFwUpdate.s12 -- (v1.0.3.0) The sign file of 64 bit version main executable file.
DevFwUpdate.s12 -- The sign file of 64 bit version main executable file.

I'm not sure what the difference is between the above two. There are also .s12's for 32 bit versions, but my computer is 64, so guess that I can ignore those.

Any suggestions would be much appreciated.

@PeterM18
Copy link

PeterM18 commented Dec 11, 2022

Umm, I just saw the following, which suggests that the difference between .s12 files is which version of the security key is used:

For the platform with 2013 secure key, system will launch HpDevFwUpdate.EFI.
For the platform with 2017 secure key, system will launch DevFwUpdate.EFI.

I don't know which version the .bin file or my computer expects (though I have secureboot off, if that helps). Also the laptop is quite recent, so would guess it expects a more recent secure key.

@eNV25
Copy link
Author

eNV25 commented Dec 12, 2022

Anyway, I can extract 086AAF17.exe using 7z. But, I have read elsewhere that 7z is not appropriate because the .exe content needs to be processed. Maybe that's not the case here because the first .exe was processed and the second seems not to take any processing? On the other hand, I'd rather not brick my laptop.

Both .bin and .s12 files are required with the same filename. .s12 should be generated when running the executable.

I tried downloading and extracting your executable and got the same result. No luck, sorry.

@eNV25
Copy link
Author

eNV25 commented Dec 12, 2022

Try asking HP Support about it.

@eNV25
Copy link
Author

eNV25 commented Dec 12, 2022

@PeterM18 Anyway, if you have access to a Windows computer, it is better to just do it the way you're supposed to. Just run the sp*.exe executable and follow the instructions.

@PeterM18
Copy link

PeterM18 commented Dec 12, 2022

Thanks again eNV25 for checking this out. Yes, 7z extracts files, but the .bin file is called 086AA.bin and there is no 086AA.s12, just .s12 files with names like DevFwUpdate.s12. That s12 is for 64-bit OS and with recent secure key, which seems to fit my situation. Would be better to ask HP Support--unfortunately, my warranty is expired and support help is now expensive compared to cost of the laptop.

I'm not sure I understand your last comment about just running the sp*.exe on a Windows computer. The Windows computer I have is an old organizational laptop, that most likely doesn't take the sp141894.exe BIOS update that is meant for my linux laptop. I'd think that straight out running that .exe on the Windows laptop would cause a BIOS update that would simply brick the laptop.

@eNV25
Copy link
Author

eNV25 commented Dec 12, 2022

@PeterM18

I'm not sure I understand your last comment about just running the sp*.exe on a Windows computer. The Windows computer I have is an old organizational laptop, that most likely doesn't take the sp141894.exe BIOS update that is meant for my linux laptop. I'd think that straight out running that .exe on the Windows laptop would cause a BIOS update that would simply brick the laptop.

The .exe if for Windows, not Linux. That's why we are running through Wine.

After thinking about it and trying again, I managed to get the .bin and .s12 files from your sp141894.exe.

Just run the executable without any command-line arguments.

$ wine sp141894.exe

It will try to access hardware, but it will fail since it is running through Wine.

Then it will open a window with a few options on how to continue.

You must select the option to copy files for later use.

Now the correct files will be saved in your selected location.

The problem in my previous attempt is that I did /s /e /f it needs /s /f.

@PeterM18
Copy link

eNV25: Thanks so much for going to the trouble of figuring out what to do with that BIOS update .exe!

Unfortunately, once I create the USB stick and boot from it, there is no BIOS Management option or similar. When I boot into F2, System Diagnostics, I see no options for booting from a USB stick or anything related to BIOS management. I have a less expensive laptop model, so perhaps a stripped down version of the BIOS software?

I do see messages in the above saying that my UEFI hardware diagnostics, which are v8.0.0.0 are out of date and directing me to an HP website. There, I find a file that has v8.8.0.0, but it is only 65MB, not the nearly 2GB file I used to create a bootable USB stick. So I guess there is no way to try that option.

One reason, besides the security update, that I wanted to update the firmware is that the laptop is exhibiting a couple odd and problematic quirks that might be fixed with a new BIOS. But I guess HP has made that impossible on my model without an installed copy of Windows.

Thank you again!

@eNV25
Copy link
Author

eNV25 commented Dec 14, 2022

Just try again. Maybe it will show after a few tries.

@eNV25
Copy link
Author

eNV25 commented Dec 14, 2022

Also, make sure you tried the correct HP PC Hardware Diagnostics 4-IN-1 USB KEY. This is the current one: https://ftp.hp.com/pub/softpaq/sp142501-143000/sp142721.exe

@Samweis2111
Copy link

Hello
and thanks for posting this - even though I am still stuck. ;-)

My Laptop is a HP 255 G8 notebook, Product No. 45R29ES#ABD, Board ID 8905, current BIOS is F.26.
I followed your instructions to the letter but in the end the key would not boot. I tried two different USB keys.
OK, so I chose "boot from EFI file" and tried every *.efi on the key.
The diagnostic tool starts alright but anything like BiosMgmt.efi, BiosUpdate.efi etc. fails.

I checked in BIOSCopy.csv whether my system is supported. It lists quite a few "HP 255 G8" with different Board IDs.
My board ID (8905) is listed, but the BIOS file I downloaded from HP is 087D1.bin (087D1 is also listed as Board ID of a 255 G8).
Weird. Did HP provide the wrong BIOS file? Does the update fail because the file does not have the Board-ID's name?
Can it be safely renamed?

I also noticed that log files were created after my failed upgrade attempts, with entries like this:
[L]> System ID: 8905
Failed Loading EFI_HP_BIOS_IMAGE_INTERFACE_PROTOCOL2_GUID(Not Found)
Failed Loading EFI_HP_BIOS_IMAGE_INTERFACE_PROTOCOL_GUID (Not Found)
Failed Loading HP BIOS Image Interface Protocol

Sounds like something else is missing, too?

@PeterM18
Copy link

Hi eNV25:

I tried sp142721.exe . Following your instructions carefully, I got a USB key that would not boot and did not show any BIOS management option in F2 System Diagnostics. Looking at the files on the USB key, they are quite different from those from the older .exe and do not seem to present files needed for booting (boot or efi folder, grub file). I figured I should try running sp142721.exe in wine without command line options. That didn't work well for me--I got a terminating error messages about the unavailability of the Wine Mono framework. I installed Mono, but I think it'd need a reboot to perhaps work, and I can't reboot at the moment.

So, finally, I ran sp142721.exe on the Windows laptop--to create the USB. Some headaches there (wouldn't run a key part of the setup without running as Administrator, but I had run as Administrator--had to go and run the batch file being executed at that point directly in PowerShell). Anyway, the USB stick seemed to get a proper setup, I copied over the BIOS files, and ran it on my laptop. Again, it won't boot. As Samweis2111 says, booting from any EFI file on the drive fails. However, when I press F2 to do system diagnostics, the USB drive kicks in rather than what's on my computer--so I'm seeing the latest version of the diagnostics (8.8 I believe). However, there is no BIOS management option. Again, I suspect that whatever is needed for a UEFI BIOS update may simply not be on my laptop. Have tried or ignored as too dangerous every solution here on the archlinux page devoted to BIOS updates in linux as well. Bottom line: this may not be possible. Still, thanks for all the help!

Samweis2111: Where could I find the BIOSCopy.csv?

@Samweis2111
Copy link

PeterM18: BIOSCopy.csv should be in the root of your key. Or just unzip the sp142721.exe archive with 7z and it will be in field/BIOSCopy.csv.

I just tried to create the key from within a Win10 VM. Creation works, but the key does not. It behaves in the same way as before (and the directories look the same, too).
After the key was created a message popped up that any BIOS upgrades require the download of 4 additional files:
echo http://ftp.hp.com/pub/softpaq/sp105501-106000/sp105878.exe
echo http://ftp.hp.com/pub/softpaq/sp105501-106000/sp105879.exe
echo http://ftp.hp.com/pub/softpaq/sp112001-112500/sp112026.exe
echo http://ftp.hp.com/pub/softpaq/sp139501-140000/sp139758.exe
Doh... I am in a remote place with only mobile connection and not much bandwidth left for this month...

@Samweis2111
Copy link

On a side note: The proper location for the BIOS files appears to have changed in the key.
I added the downloaded *.bin and *.sig files to the BIOS.zip archive and executed BIOSCopy.exe (both are in the same folder as BIOSCopy.csv). BIOSCopy.exe asks for the board ID or the street name of the board and then copies the BIOS *bin and *.sig files to Hewlett-Packard/BIOS/Current and HP/BIOS/Current .
BIOSCopy.exe lists 4 boards for street name "255 G8". When I choose the correct board ID it complains that it cannot find the BIOS files for this board. 087D1 != 8905.
So HP has 4 different boards for 255 G8 laptops but provides the BIOS for just one of them? I am afraid to brick the laptop if I just rename the file...

@PeterM18
Copy link

PS I suspect that HP's more recent 4-in-1 USBs are not meant to be bootable, just accessible from F2. Also, according to the ArchLinux blog, BIOS updates from USB may only be available on higher-end HP laptops.

@PeterM18
Copy link

Thanks for the info Samweis2111! Incidentally, the message I got about those 4 additional files I read as saying these were necessary for BIOS repair, which I imagine is different than updating--perhaps.

@PeterM18
Copy link

Samweis2111: Incidentally, I don't seen my laptop precisely in the .csv file -- it's a HP Pavilion 15t-cs300. That's similar to some of the entries, but not exactly the same. The board product number is 86E2, which also doesn't occur. So, I'm guessing that there is no way for me to update the BIOS on this laptop with the method being discussed here.

One thing that gives me pause: The instructions I see here indicate that after the BIOS recovery, the system needs to be rebooted with a certain key combination pressed. I was able to run the BIOS updater from a Hiren Boot USB, and everything seemed to work, except that once I restarted the system, the BIOS had not changed. Maybe I was supposed to hold down a key combination. Argh!

@Samweis2111
Copy link

Samweis2111 commented Dec 17, 2022

PeterM18: I downloaded the BIOS for your laptop, file sp141894.exe, then executed
wine sp141894.exe /s /f sp141894
(in /tmp, as normal user, not root!)
This created a directory sp141894 (as instructed by the /f switch) in the current directory, extracted 086AAF17.exe to /tmp/sp141894 and executed it. It gave a number of error messages, probably because it tried to access the BIOS from within wine, then a window popped up with three options:

  • Update the BIOS on this device
  • Create Recovery USB flash drive
  • Copy BIOS image to any file location
    Select the third and it will copy 086AA.bin and 086AA.s12 to a location you choose. If you did not get this window, maybe your sp141894.exe was corrupted during download?

Also, I found your board ID in BIOSCopy.csv:

System_Board_ID, Street_Name, Binary_Prefixes, Product_Name
...
86E2,HP Pavilion Laptop PC 15-cs3000,086AA,

I would interpret this as: Board 86E2 is supported, Binary_Prefixes (=name of the BIOS files without suffix ) is 086AA. So 086AA.bin and 086AA.s12 should work for you.

@Samweis2111
Copy link

Solved!
I finally found a BIOS for my laptop.

@eNV25
I assume the new key works a bit differently than the one you described. It does not boot as it is - I guess you will need the other 4 packages for it to boot, but I have not verified this. It can still be used for a BIOS update even without those packages.
Here is what I did. Changes to your procedure marked bold.

cd /tmp
Extract files for HP Diagnostic Key to /tmp/sp142721:
7z x -osp142721 ~/Downloads/sp142721.exe

This will do the same, just cancel when asked for the drive letter:
wine ~/Downloads/sp142721.exe /s /f sp142721

Extract BIOS files from your downloaded HP BIOS spxxxxx.exe:
wine ~/Downloads/spxxxxx.exe /s /f spxxxxx

When asked select "copy to any file location".
Copy to /tmp/sp142721/field/Hewlett-Packard/BIOS/Current and to /tmp/sp142721/field/HP/BIOS/Current.

Now the key:
A USB key with a normal fat32 partition will suffice. No need for an efi partition.
The USB key created by Windows does not have an efi partition either.

The fat32 partition must be labeled HP_TOOLS:

fatlabel /dev/sdX1 HP_TOOLS

Otherwise it will not work. I tried.

Shut down your computer, insert the key, push the keys "Windows" and "B" while you power on.
Keep pressed for at least 3 seconds.

The BIOS Update window will appear. Wait for the process to complete. Do not interrupt!
This procedure uses the EFI files on the key and leaves a logfile in Hewlett-Packard/BIOSUpdate/.

Caution!
You may need a bootable USB Stick afterwards.
The boot block of the internal hard disk will be restored to factory state - so grub will be gone!
I tried with two laptops: One of them allowed to boot the internal system via "Boot from EFI file".
The other does not offer to boot from an EFI file unless it finds a working boot device.

@PeterM18
Copy link

PeterM18 commented Dec 17, 2022

PeterM18: ...
Also, I found your board ID in BIOSCopy.csv:

System_Board_ID, Street_Name, Binary_Prefixes, Product_Name
86E2,HP Pavilion Laptop PC 15-cs3000,086AA,

I would interpret this as: Board 86E2 is supported, Binary_Prefixes (=name of the BIOS files without suffix ) is 086AA. So 086AA.bin and 086AA.s12 should work for you.

Thank you for all your input! However, I cannot find a line in BIOSCopy.csv that contains '86E2', my board number (or so I think: it was called 'BaseBoard Product 86E2' in msinfo when I still had Windows on the laptop; dmidecode gives my board product name as 2AF3, which does not occur in either msinfo or in BIOSCopy.csv). I re-downloaded and extracted sp142721.exe in case there was some download error. The result is the same. My BIOSCopy.csv line reads: 86AB HP Pavilion Laptop PC 15-cs3000 086AA . There are 2 other lines like that with the first value of 8600 86000 . You got BIOSCopy.csv from sp142721.exe under 'field'? I'm concerned that if my board is not specifically mentioned, flashing the BIOS by this method may brick my laptop.

A few other odds 'n ends for clarity:

  • So you just do a normal copy of the sp142721/field/* to the flash drive?
  • The USB flash drive Windows created for me does have HP_TOOLS as a label. It also has two flags: boot and lba . Did you find that unnecessary?
  • I couldn't create the USB flash drive in Windows without first creating a partition table and then placing the FAT32 partition on the drive. (gparted allows doing just the latter, but the drive won't read, at least not consistently, on Windows). Necessary or not?
  • Would you fix the 'grub gone' issue by a) booting from a linux usb drive, b) using chroot to 'become' the laptop, c) using update grub?

@Samweis2111
Copy link

Samweis2111 commented Dec 17, 2022

PeterM18:

For the drive I created a gpt partition table as eNV25 described, then created a normal fat32 partition, labeled the partition HP_TOOLS and just copied sp142721/field/* to the drive mounted as /mnt/HP_Tools.

Then grep gives me this:

$ grep 86AA HP_TOOLS/BIOSCopy.csv
86AB,HP Pavilion Laptop PC 15-cs3000,086AA,
86E2,HP Pavilion Laptop PC 15-cs3000,086AA,
86E3,HP Pavilion Laptop PC 15-cs3000,086AA,
86AA,HP Pavilion Laptop PC 14t-ce0000,086AA,
86E1,HP Pavilion Laptop PC 14t-ce0000,086AA

On the one laptop that refuses to boot after the upgrade the boot selection menu (F10) becomes available as soon as a bootable medium is available to the system. Don't know what genius at HP had this idea...
So just insert a bootable CD, DVD, linux USB drive, or USB hdd and hit "F10" quickly enough to get to the boot selection screen. From there you can boot the grub EFI file on the internal harddisk. As soon as the system is up you can grub-install /dev/sdX (or /dev/nvme.. whatever your internal drive is). This way you don't boot the external medium an don't need to chroot.

Edit: you should find your board number on the system information screen. Press F1 when booting.

@PeterM18
Copy link

Holy sweet potatoes--that worked for me! Many, many thanks Samweis2111 :-) .

A question and an observation:

When I hit Window-B and started my laptop, it went to a mostly black screen with a progress meter that said it was flashing the BIOS and did so quite quickly. After that finished, it went to a more sophisticated GUI that said it was recovering the BIOS. Is this sequence what you experienced? I thought recovering was flashing, so am surprised at seeing both. I am wondering whether the first screen was perhaps a BIOS flash that I had managed to put on my system with the Hiren Boot USB but had not previously activated with a needed Windows key combo.

Also, running the recovery seemed to have reset my CMOS. So when I tried to reboot from anything, it wouldn't let me because SecureBoot was on. Once I changed the security settings, I was able to boot without problems.

Anyway, the procedure that eNV25 present and that Samweis2111 updated here is a really terrific way for people experiencing problems updating their BIOS in Linux to do that. As I mentioned above, I considered every method of doing this I could find with a search engine, many from the ArchLinux blog, and either the method failed or seemed too likely to brick my laptop to be worth trying. The method here is all-linux and looks like it will work for most if not all HP laptops.

@Samweis2111
Copy link

PeterM18:
Good to hear it worked for you!
The procedure seems to vary depending on the unit. I upgraded two different HP laptops. Both showed at some point a progress bar with "Flashing boot sector" (which I thought was odd and misleading, since I would use "write" in this context).
However, the order was reversed: One wrote the boot block before the BIOS upgrade, the other in the end of the procedure.

And yes, settings saved in the CMOS may not survive. Having encryption keys stored in the CMOS before a BIOS upgrade is probably a pretty cool way to lock yourself out of your hard drive for good. ;-)

@PeterM18
Copy link

Thanks again for a clear explanation Samweis2111!

@PeterM18
Copy link

BTW, the reason I couldn't find my board ID is because I used LibreOffice Calc to view the .csv file. It for some reason converted 86E2 to 8600. But I could see 86E2 with nano or grep.

@FLAGEL
Copy link

FLAGEL commented Dec 29, 2022

Great write-up! Unfortunately, executing some of HP's sp-files via Wine will result in an "unable to initialize memory manager" error. I wrote a few notes for a workaround, were that to happen.

##
# HP BIOS/Firmware Update Procedure
##
# Note: When preparing an USB-flashdrive for updating:
# 1) Windows may be required for HP file execution, execution via Wine does not always work (as of 2022.12.28),
# 2) If no Windows-installation is available, a free Microsoft-provided Windows Enterprise evaluation-ISO can be used,
# 3) If no physical Windows-installation is available, any hypervisor with USB-passthrough can be used,
# 4) An USB-harddrive will not be accepted by the HP-exe, an USB-flashdrive is required.
##
# 1) Prepare USB-flashdrive by filling it with zeroes:
	dd if=/dev/zero of=/dev/XXX bs=4M conv=fsync oflag=direct status=progress

# 2) Get HP-signed Windows-exe from hp.com via laptop serial number:
	wget [URL to HP-exe]
	
# 3) Attach USB-flashdrive to Windows-machine and format it with default settings.
	
# 4) Run HP-exe in Windows, select option to prepare USB-flashdrive.

# 5) Ensure power-adapter is attached to machine that is to be updated.

# 6) Attach prepared USB-flashdrive to machine that is to be updated.

# 7) Hold keys "Windows" and "b" before pressing power button.

@PeterM18
Copy link

Thanks FLAGEL! While my current spXXX.exe is an older one, it's good to have info about how to do this with something more recent, in case I need to upgrade in the future. Your instructions look very helpful.

One question: in your 2) are you referring to the BIOS upgrade file spXXX.exe? The way this is written it sounds like you might be indicating a way to get a copy of Windows from HP.

@FLAGEL
Copy link

FLAGEL commented Dec 30, 2022

Hello Peter,

Point 2) does indeed refer to the spXXX.exe-file from HP that upgrades BIOS/Firmware. HP-signed meaning said exe-file is digitally signed by HP. As for getting a copy of Windows, that can be found here: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise (90-day use limit, registration data form accepts any data, without verification).

@PeterM18
Copy link

PeterM18 commented Dec 31, 2022 via email

@Bpr3
Copy link

Bpr3 commented Jan 1, 2023

Solved! I finally found a BIOS for my laptop.

@eNV25 I assume the new key works a bit differently than the one you described. It does not boot as it is - I guess you will need the other 4 packages for it to boot, but I have not verified this. It can still be used for a BIOS update even without those packages. Here is what I did. Changes to your procedure marked bold.

cd /tmp Extract files for HP Diagnostic Key to /tmp/sp142721: 7z x -osp142721 ~/Downloads/sp142721.exe

This will do the same, just cancel when asked for the drive letter: wine ~/Downloads/sp142721.exe /s /f sp142721

Extract BIOS files from your downloaded HP BIOS spxxxxx.exe: wine ~/Downloads/spxxxxx.exe /s /f spxxxxx

When asked select "copy to any file location". Copy to /tmp/sp142721/field/Hewlett-Packard/BIOS/Current and to /tmp/sp142721/field/HP/BIOS/Current.

Now the key: A USB key with a normal fat32 partition will suffice. No need for an efi partition. The USB key created by Windows does not have an efi partition either.

The fat32 partition must be labeled HP_TOOLS:

fatlabel /dev/sdX1 HP_TOOLS

Otherwise it will not work. I tried.

Shut down your computer, insert the key, push the keys "Windows" and "B" while you power on. Keep pressed for at least 3 seconds.

The BIOS Update window will appear. Wait for the process to complete. Do not interrupt! This procedure uses the EFI files on the key and leaves a logfile in Hewlett-Packard/BIOSUpdate/.

Caution! You may need a bootable USB Stick afterwards. The boot block of the internal hard disk will be restored to factory state - so grub will be gone! I tried with two laptops: One of them allowed to boot the internal system via "Boot from EFI file". The other does not offer to boot from an EFI file unless it finds a working boot device.

HP 255 g8 here, laptop was crashing sometimes, just updated bios in one go thanks to you ! See later if crashes stop ;)

@dmitrmax
Copy link

@Samweis2111, many thanks you for your post. I also have HP 255 G8 which came with F.27 BIOS and rebooted seconds after laptop woke up because of BIOS bug which was fixed in F.31.

Several moments I want to append.

First of all - all these manipulations with USB key are unneeded. In UEFI everything that works on USB key works also on EFI partition on your HDD, i.e. USB key has no special meaning like it was with classic BIOS. So I've just copied HP and Hewlett-Packard directories to /boot/efi/EFI and had the same experience like you do with the USB Key. Furthermore, running a System Diagnostics now hooks up new version from EFI partion.

The second moment and I want to stress that it is the Rosetta Stone of this discussion - it is the Win+B combination pressed during power on. Where the hell did you, @Samweis2111, found information about it? ) Everything I've read before stated that a new menu item have to appear in the HP Startup Menu but it didn't.

The third moment - the procedure is quite a nervious one. After initial flashing laptop powers off for a minute or so, blinking with couple of LEDs on the left side with no other signs of life. After a minute it powers up and starts BIOS "recovery" (this time I thought that first step failed). Then it powers off for a minute again, and starts up with flashing boot block again. And only then it notifies that recovery was successful and upon reboot I've found that I have new version F.32! So be patient!

Final words go to HP guys. You are crazy idiots! It is such simple procedure to update BIOS via Linux. You have to provide just a tar.gz which user should unpack to /boot/efi/EFI and write a README to mention Win+B. Instead you have packed all the stuff into installer into installer into installer which can be run only on Windows or wine and left your customers googling for such a dirty magic!

@eNV25
Copy link
Author

eNV25 commented Jan 21, 2023

@dmitrmax

just copied HP and Hewlett-Packard directories to /boot/efi/EFI

Hahaha. I haven't tried it, but if that's true, that's crazy.

The second moment and I want to stress that it is the Rosetta Stone of this discussion - it is the Win+B combination pressed during power on. Where the hell did you, @Samweis2111, found information about it? ) Everything I've read before stated that a new menu item have to appear in the HP Startup Menu but it didn't.

I had noticed the built-in "System Diagnostics" before, but I didn't see a BIOS update option.

@dmitrmax
Copy link

dmitrmax commented Jan 22, 2023

Hahaha. I haven't tried it, but if that's true, that's crazy.

Yep. I don't even have a USB key - all of them lost due to being unused for along time. I've even installed Linux via PXE because of this )

Actually when you install BIOS update via Windows installer it does the same job - copies its files to EFI hidden partion and deletes afterwards. Except that it adds temporary EFI boot entry so BIOS update starts instead of the OS bootloader.

I had noticed the built-in "System Diagnostics" before, but I didn't see a BIOS update option.

@eNV25 it is strange but on HP 255 G8 there is no BIOS management menu item in System Diagnostics either. Though I'm pretty sure that it boots System Diagnostics from HDD because there are so many differences between built-in one and that one I have installed. It seems that it depends on the laptop model. I think that HP wants to emphasize that my laptop is pretty budget one and I have to suffer doing some maintenance tasks instead of doint it the simple way. I see no other reason to hide this menu item in System Diagnostics for this model )

@eNV25
Copy link
Author

eNV25 commented Jan 23, 2023

BIOS management menu item in System Diagnostics either

I saw an update for "HP PC Hardware Diagnostics UEFI" it seems to provide the functionality we're looking for. Maybe older models need this update.

But again, this is for windows, don't know about Linux.

From the release notes:

DESCRIPTION:
This package provides the HP PC Hardware Diagnostics UEFI for the supported models running a supported operating system. The HP PC Hardware Diagnostics UEFI provides UEFI based hardware diagnostics for the supported models which is used to validate if a system is functioning correctly. In addition, it provides support for updating and managing the system BIOS and other device firmware on the system.

@eNV25
Copy link
Author

eNV25 commented Jan 24, 2023

I have updated the gist so that it doesn't use a separate USB drive.

@dmitrmax
Copy link

dmitrmax commented Jan 24, 2023

@eNV25 nice! But I'm not sure whether it should be /efi/HP/BIOS/Current or /efi/HP/BIOS/New. I saw different variants around the internet. So I just did both before I attemped and it succeeded )

Also mine worked when Win-B was pressed and held before power on button was pressed. May be it is also important.

@TicTac7x
Copy link

TicTac7x commented May 22, 2023

I updated my omen 15 ek-1000 to F.32 and now I can't downgrade it any longer. The bios updater from windows doesn't allow selecting the update option to be selected.

Trying to flash old bios from usb also fails (Failed to find bios signature file).

Also tried with this method, where i manually copy old bios files to efi partition, then running bios managememt efi from bios update folder (same error about signature failure)

And Win + B only shows that bios recovery files are not found or corrupted (i copied them both to HP folders including Current and New folders).

Any ideas?

@eNV25
Copy link
Author

eNV25 commented May 22, 2023

@TicTac7x Did you copy the signature file (.s12, or similar) too?

@TicTac7x
Copy link

TicTac7x commented May 22, 2023

Yes, mine is .sig file, i also tried to make duplicate of it and rename it to .s12, still fails with the signature check.

If i use the latest bios version, the .sig file is in same place and there is no error about the sig file. I have no idea how to downgrade the bios now...

Feel free to add me on discord to discuss it, willing to pay money if someone helps me get it resolved.

TicTac7x#5352

@eNV25
Copy link
Author

eNV25 commented May 23, 2023

Why do you want to downgrade? Just curious.

@TicTac7x
Copy link

TicTac7x commented May 23, 2023 via email

@TicTac7x
Copy link

Found following tool to flash bios from linux without verification: https://ftp.hp.com/pub/caps-softpaq/cmit/linuxtools/HP_LinuxTools.html

Has anyone tried using it or is this something better not to use?

@dmitrmax
Copy link

Found following tool to flash bios from linux without verification: https://ftp.hp.com/pub/caps-softpaq/cmit/linuxtools/HP_LinuxTools.html

Has anyone tried using it or is this something better not to use?

Nope. I see it for the first time in my life. If I didn't find out how to deal with EFI way of flashing (above) I would definitely give it a try.

@TicTac7x
Copy link

EFI way of flashing is easier than compiling this thing tho... But i'm not sure if I have the guts to try this out, wouldn't want to turn my laptop to a paperweight :)

@dmitrmax
Copy link

EFI way of flashing is easier than compiling this thing tho... But i'm not sure if I have the guts to try this out, wouldn't want to turn my laptop to a paperweight :)

Well, you know, the most nervous flash was the one described above. Because it was rebooting several times with intervals of being off for quite a time with no indication that everything is going fine. I'd expect that this tool you've found is more user friendly and will check for compatibility of firmware file and will explain you further steps and what to expect.

So, next time I'll give it a try because I don't expect to get a brick at the end with it )

@TicTac7x
Copy link

TicTac7x commented May 24, 2023 via email

@supertin
Copy link

@Samweis2111
Thank you so much... The Win+B thing was what I needed. I wish HP would just let you download a bootable disk image with the flash toop and a binary file for the BIOS like many other vendors do... Never have this issue with Asus systems for example.

@ant9000
Copy link

ant9000 commented Sep 18, 2023

Since this version im getting BIOS reset errors, fan curve is different, laptop is running hotter, resume from sleep no longer works (screen stays black, i need to force poweroff from button and then again i get BIOS RESET error). So yeah, this version is really bad compared to previous ones... Looking for any way to downgrade this.

Hello, same problem here: latest version from HP resets the laptop after 15-30 seconds, on and on forever, and downgrading does not work.
Have you ever found a solution?

Thx in advance!

@ant9000
Copy link

ant9000 commented Sep 19, 2023

In answer to my own question: I did a BIOS recovery again with the same version (the latest). No errors (as before), and this time my laptop works correctly. Likely, I borked something on the first attempt.

@DuxAlex
Copy link

DuxAlex commented Dec 8, 2023

Could you help me ? Which version should I install? See the specs of my laptop.

Item Valor
Nome do Sistema Operacional Microsoft Windows 10 Pro
Versão 10.0.19045 Compilação 19045
Outra Descrição do Sistema Operacional Não disponível
Fabricante do Sistema Operacional Microsoft Corporation
Nome do sistema KRYPTO
Fabricante do sistema Hewlett-Packard
Modelo do sistema HP Pavilion g7 Notebook PC
Tipo do sistema PC baseado em X64
SKU do sistema D6X23EA#UUZ
Processador AMD A8-4500M APU with Radeon(tm) HD Graphics, 1900 Mhz, 4 Núcleo(s), 4 Processador(es) Lógico(s)
Versão/data do BIOS Insyde F.2A, 18/07/2016
Versão do SMBIOS 2.7
Versão do Controlador Incorporado 57.53
Modo da BIOS UEFI
Fabricante da BaseBoard Hewlett-Packard
Produto BaseBoard 184B
Versão da BaseBoard 57.35
Função da Plataforma Móvel
Estado da Inicialização Segura Desativado
Configuração PCR7 Ligação Impossível
Pasta do Windows C:\Windows
Pasta do sistema C:\Windows\system32
Dispositivo de inicialização \Device\HarddiskVolume1
Localidade Brasil
Camada de Abstração de Hardware Versão = "10.0.19041.3636"

@eNV25
Copy link
Author

eNV25 commented Dec 8, 2023

You should search your serial code in the HP drivers and firmware website. You will find the update file there.

@5cover
Copy link

5cover commented Jan 1, 2024

In the "Complete BIOS update using HP Hardware Diagnostics" section:

Are you sure the /efi/ESP/HP/BIOS/New path is correct? Isn't it /efi/EFI/HP/BIOS/New?

@eNV25
Copy link
Author

eNV25 commented Jan 1, 2024

That's a typo. Fixed.

@matez0
Copy link

matez0 commented Jan 5, 2024

BIOS update for HP ProBook x360 435 G8

  • Download the BIOS firmware package (sp*.exe) of the product from HP.
  • Unzip (7zip) the .exe file.
  • Copy the .bin file (T80_*.bin) into the path /HP/DEVFW/firmware.bin of a FAT32 formatted USB stick.
  • Reboot and press ESC key.
  • Select "Update System and Supported Device Firmware" menu.

Note: if the .bin file is copied with the same name to the folder required by the BIOS update tool, it will not find that. The filename firmware.bin is important. 🙈

@berarma
Copy link

berarma commented Jan 7, 2024

Newer updates only contain the file WinFlash.exe. How can we proceed in this case?

@eNV25
Copy link
Author

eNV25 commented Jan 8, 2024

Try running in wine like wine WinFlash.exe /?. It might list options and give a hint.

@berarma
Copy link

berarma commented Jan 8, 2024

Try running in wine like wine WinFlash.exe /?. It might list options and give a hint.

Thanks. It immediately tries to upgrade the BIOS and fails.

I've found this thread recommending to create a Windows recovery disk and use it to execute the file and update the BIOS. I'll try this but I would prefer the EFI method if it could work again.

@dmitrmax
Copy link

dmitrmax commented Jan 8, 2024

Try running in wine like wine WinFlash.exe /?. It might list options and give a hint.

Thanks. It immediately tries to upgrade the BIOS and fails.

It is OK, that it tries and fails. But do not acknowledge error message and don't finish the application. Until you accept error message, it will keep its files unpacked in the temporary folder. You can find the folder, copy all files and the finish the app by accepting its error message.

@berarma
Copy link

berarma commented Jan 8, 2024

It doesn't show any window, only messages in the terminal. It looks for a driver with a name that seems related to BIOS and then exits with an error.

@UbayGD
Copy link

UbayGD commented Jan 15, 2024

Although I have not yet been able to update the BIOS (rather I have not dared to update it) I want to thank you for this guide because I was already imagining having to deal with USB or similar devices.

The only "problem" I've had is that when I extract the update files I get 3 different ones (each one with its own .bin, .s12 and .sig) and then I don't know which one to choose :') And I'm afraid of leaving the laptop as a paperweight or something similar.

@dmitrmax
Copy link

@UbayGD the later two files are digital signature of .bin blob. You just couldn't flash them instead of the right binary.

@eNV25
Copy link
Author

eNV25 commented Jan 15, 2024

@UbayGD Just copy all of those files to the directory depending on the method.

@UbayGD
Copy link

UbayGD commented Jan 15, 2024

@UbayGD the later two files are digital signature of .bin blob. You just couldn't flash them instead of the right binary.

@UbayGD Just copy all of those files to the directory depending on the method.

The thing is that I have 3 .bin to flash and I'm afraid to select the wrong one :')

  • 089A0ME0.bin
  • 08A1EME0.bin
  • 08A1DME0.bin

@eNV25
Copy link
Author

eNV25 commented Jan 15, 2024

@UbayGD Where did these come from? Were all of these from your device specific BIOS update?

I think the HP PC Hardware Diagnostics 4-IN-1 USB KEY files should have a .csv file somewhere. That might help.

@dmitrmax
Copy link

@UbayGD use dmidecode tool. Its output contains Base Board Information section. There will be a Product Name that will contain one of these codes.

@eNV25 HPs has incompatible hardware in some models and has different BIOSes for them which should be matched by the product code.

@UbayGD
Copy link

UbayGD commented Jan 16, 2024

@UbayGD use dmidecode tool. Its output contains Base Board Information section. There will be a Product Name that will contain one of these codes.

Thank you very much! Browsing through all the information provided by dmidecode I have seen that one of the .bin starts with the product name of the laptop.

Wish me luck!

@mridlen
Copy link

mridlen commented Jan 22, 2024

Ok, so I ran into issues and this is my solution:

I needed to download 2 files:

  1. Download the HP PC Hardware Diagnostics UEFI for my system - this creates the bootable USB to run the firmware update
  2. Download the latest BIOS update for my system - this is the firmware payload

On my end I have both Windows and Linux so I am doing the Windows stuff on the Windows side.

  1. Create HP PC Hardware Diagnostics UEFI using the USB option (WIndows)
  2. Run the BIOS update and select extract files to location (Windows)
  3. Copy the extracted *.bin and *.sig files to HP/BIOS/New and Hewlett-Packard/BIOS/New on the USB stick (Windows)
  4. Boot laptop with ESC and select F2 Diagnostics menu
  5. If it takes a few moments, this is good because it is reading from USB
  6. GUI should appear (this is good because the previous was a text UI) - this means it is reading from the USB
  7. Select Firmware Update from the menu, and click through to install it
  8. BIOS update takes a long time... go get a cup of coffee. I am writing these instructions and it is only halfway done installing.

@DJCrashdummy
Copy link

It doesn't show any window, only messages in the terminal. It looks for a driver with a name that seems related to BIOS and then exits with an error.

@berarma if your terminal was full with something similar like this, i had and solved the same issue...

...
wine: Assertion failed at address 00007F6DB8CDD00B (thread 0032), starting debugger...
20 - Error: Unable to initialize memory manager
0015:err:service:process_send_command service protocol error - failed to write pipe!

thankfully i remembered that i had to state i'm using Windows 10 to be able to download the stupid exe-file... and i created a new wineprefix to be on the safe side and don't mess up my other wineprefixes by any chance.
but the default winver= is empty which is equal to winver=win7! so i set it to winver=win10 and it worked like a charm.

@DJCrashdummy
Copy link

Where did these come from? Were all of these from your device specific BIOS update?

@eNV25 yes, in my case there are 4 *.bin files with corresponding *.sig files...

use dmidecode tool. Its output contains Base Board Information section. There will be a Product Name that will contain one of these codes.

@dmitrmax unfortunately greping the name of all my files didn't give a result and even going through the whole output didn't give any hint.
...but i think i remember quite some time ago (when HP still provided a way to create a bootable stick on linux resp. independent from the OS) there were also more than one *.bin file for one of my notebooks and their guide said to copy all files to the stick.

-> so i copied all files to the New folders, and it worked fine.

@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