Upgrading BIOS on a HP computer
Posted: Thu Dec 22, 2022 3:30 pm
I initially posted about this in a discussion thread, but was requested to place my solution here.
HP computers, esp. less expensive laptops, have little or no support for upgrading a BIOS on a linux-only machine. Nothing I found online worked (FreeDos, Windows PE using Hiren's, fwupd, various UEFI solutions) or seemed safe on my laptop (FlashDOS). I found a solution by piecing together a set of steps from the discussion here: https://gist.github.com/eNV25/c8001491d ... id=4033855 .
My steps are:
*NOTE: Any BIOS update, but especially one that is Jerry-rigged because the software is purely for windows and your computer is purely linux, is risky and could brick your computer. Weigh the risks and benefits before proceeding.
*Using gparted, create a blank USB flash drive of at least 3GB. Preferably a USB 3.0 drive for speed.
*Using gparted, put a partition table on the USB drive (NO EFI partion needed). Then, format the drive to FAT32.
*In gparted, using Partition > Name Partiton, set the partition label to: HP_TOOLS .
*Also, using Partition > Manage Flags, set the partition flags to: boot lba
*Shifting attention back to your computer (from the USB drive): Install wine and wine32:i386 (I also had wine-gecko and wine-mono on my system, but I don't think these matter)
*Download the latest 'HP PC Hardware Diagnostics 4-IN-1 USB KEY' from (currently) https://support.hp.com/us-en/help/hp-pc ... iagnostics (select 'Diagnose other potential issues'). The current one is called sp142721.exe and I will refer to this below (but substitute any more current version). Put this file in your Downloads folder, if not there already.
*Download the BIOS update for your HP computer from https://support.hp.com/us-en/drivers. Be sure to indicate that you are running the Windows OS so you get access. I will call the file spXXXXXX.exe here. Put this file in your Downloads folder, if not there already.
*Switch to superuser with: sudo su
*Issue the following commands. This will create a sp142721 folder in /tmp that contains the 4-IN-1 USB KEY files you will need.
# cd /tmp
# 7z x -osp142721 ~/Downloads/sp142721.exe
*Check /tmp/sp142721/HP_TOOLS/BIOSCopy.csv and make sure that your system board ID is listed. Do not attempt the rest of this procedure if it is not.
# You can get your system board ID on boot up (My system: ESC repeatedly to get to a BIOS menu, press F2 for System Information)
# Look at BIOSCopy.csv with a text editor or using the grep command. Libreoffice calc somehow converts some of the board ID values, which are in hexidecimal, to regular numbers, so is misleading.
*Extract BIOS files with the following command. Ignore / click cancel on error messages. Eventually you will get the option to download files to USB. Download these files (which should be a .bin and a .s12 file) to a folder of your choice.
# wine ~/Downloads/spxxxxx.exe /s /f spxxxxx
*Copy BOTH the .bin and .s12 files from the previous step to two locations:
# /tmp/sp142721/field/Hewlett-Packard/BIOS/Current
# /tmp/sp142721/field/HP/BIOS/Current
*Now, copy the *contents* of /tmp/sp142721 (that is, /tmp/sp142721/*) to the USB drive. Any normal copy will do (file manager, copy from command line).
*Properly unmount your USB key.
*Turn off your laptop, if on. Plug it in to external power.
*Insert USB key into laptop, hold down the Windows and 'B' keys, and then turn on the laptop. Keep holding the keys for a while (30 seconds?).
# This should initiate the bios update. You'll see some combination of BIOS flashing with progress bar and BIOS recovery. Let this all happen.
# Be patient--may take a long while to complete, with several reboots that can take time to restart the laptop.
*Your CMOS is likely to be reset. Go into BIOS setup and make sure that SafeBoot is off, otherwise booting will not work.
*It's also possible your grub file will be erased in the process. To fix this (I've not tried this):
# You must place a bootable flash drive in the laptop and start it. Without a bootable flash drive, HP BIOS won't let you get to the BIOS boot selection screen.
# When you start, break to BIOS screens (on my computer, by hitting ESC many times).
# Go to boot selection screen. Boot from EFI file: Go to the grub EFI file on the internal hard disk.
# Once the system is up, rebuild your grub using:
## sudo grub-install /dev/XXX
## Here /dev/XXX is whatever your bootable internal hard disk is (e.g. /dev/sda or nvme etc.). Give it the whole disk, not a specific partition such as sda1.
HP computers, esp. less expensive laptops, have little or no support for upgrading a BIOS on a linux-only machine. Nothing I found online worked (FreeDos, Windows PE using Hiren's, fwupd, various UEFI solutions) or seemed safe on my laptop (FlashDOS). I found a solution by piecing together a set of steps from the discussion here: https://gist.github.com/eNV25/c8001491d ... id=4033855 .
My steps are:
*NOTE: Any BIOS update, but especially one that is Jerry-rigged because the software is purely for windows and your computer is purely linux, is risky and could brick your computer. Weigh the risks and benefits before proceeding.
*Using gparted, create a blank USB flash drive of at least 3GB. Preferably a USB 3.0 drive for speed.
*Using gparted, put a partition table on the USB drive (NO EFI partion needed). Then, format the drive to FAT32.
*In gparted, using Partition > Name Partiton, set the partition label to: HP_TOOLS .
*Also, using Partition > Manage Flags, set the partition flags to: boot lba
*Shifting attention back to your computer (from the USB drive): Install wine and wine32:i386 (I also had wine-gecko and wine-mono on my system, but I don't think these matter)
*Download the latest 'HP PC Hardware Diagnostics 4-IN-1 USB KEY' from (currently) https://support.hp.com/us-en/help/hp-pc ... iagnostics (select 'Diagnose other potential issues'). The current one is called sp142721.exe and I will refer to this below (but substitute any more current version). Put this file in your Downloads folder, if not there already.
*Download the BIOS update for your HP computer from https://support.hp.com/us-en/drivers. Be sure to indicate that you are running the Windows OS so you get access. I will call the file spXXXXXX.exe here. Put this file in your Downloads folder, if not there already.
*Switch to superuser with: sudo su
*Issue the following commands. This will create a sp142721 folder in /tmp that contains the 4-IN-1 USB KEY files you will need.
# cd /tmp
# 7z x -osp142721 ~/Downloads/sp142721.exe
*Check /tmp/sp142721/HP_TOOLS/BIOSCopy.csv and make sure that your system board ID is listed. Do not attempt the rest of this procedure if it is not.
# You can get your system board ID on boot up (My system: ESC repeatedly to get to a BIOS menu, press F2 for System Information)
# Look at BIOSCopy.csv with a text editor or using the grep command. Libreoffice calc somehow converts some of the board ID values, which are in hexidecimal, to regular numbers, so is misleading.
*Extract BIOS files with the following command. Ignore / click cancel on error messages. Eventually you will get the option to download files to USB. Download these files (which should be a .bin and a .s12 file) to a folder of your choice.
# wine ~/Downloads/spxxxxx.exe /s /f spxxxxx
*Copy BOTH the .bin and .s12 files from the previous step to two locations:
# /tmp/sp142721/field/Hewlett-Packard/BIOS/Current
# /tmp/sp142721/field/HP/BIOS/Current
*Now, copy the *contents* of /tmp/sp142721 (that is, /tmp/sp142721/*) to the USB drive. Any normal copy will do (file manager, copy from command line).
*Properly unmount your USB key.
*Turn off your laptop, if on. Plug it in to external power.
*Insert USB key into laptop, hold down the Windows and 'B' keys, and then turn on the laptop. Keep holding the keys for a while (30 seconds?).
# This should initiate the bios update. You'll see some combination of BIOS flashing with progress bar and BIOS recovery. Let this all happen.
# Be patient--may take a long while to complete, with several reboots that can take time to restart the laptop.
*Your CMOS is likely to be reset. Go into BIOS setup and make sure that SafeBoot is off, otherwise booting will not work.
*It's also possible your grub file will be erased in the process. To fix this (I've not tried this):
# You must place a bootable flash drive in the laptop and start it. Without a bootable flash drive, HP BIOS won't let you get to the BIOS boot selection screen.
# When you start, break to BIOS screens (on my computer, by hitting ESC many times).
# Go to boot selection screen. Boot from EFI file: Go to the grub EFI file on the internal hard disk.
# Once the system is up, rebuild your grub using:
## sudo grub-install /dev/XXX
## Here /dev/XXX is whatever your bootable internal hard disk is (e.g. /dev/sda or nvme etc.). Give it the whole disk, not a specific partition such as sda1.