BIOS update on an HP 250 G7 notebook with Linux

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
nullplan
Member
Member
Posts: 1643
Joined: Wed Aug 30, 2017 8:24 am

BIOS update on an HP 250 G7 notebook with Linux

Post by nullplan »

Hi all,

I just wasted two hours of my life on this, so I'm writing this to spare others the same frustration. Maybe it'll be useful for someone else. I wanted to update the BIOSes on my devices because of the Logofail vulnerability. Well, apparently my PC is too old, since its mainboard vendor last released a BIOS in May of 2023, and that was in Beta status. The vuln was not announced until late 2023, so it cannot possibly have the fix. But HP put out a new BIOS for this laptop in December, so I decided to give it a shot.

In order to do the update, you will need a PC with Windows around, and a USB stick. Download the update file from HP to the PC. You will see that it is an EXE file. It is a self-extracting archive, and you could unzip it in Linux as well, but it contains another EXE file. That file could update the BIOS immediately if run on the laptop, but alas, that is not possible, for the laptop runs Linux. And I seriously don't want to mess with Wine and BIOS updates! It can also just write a bunch of files to a USB stick, and we will use that option later.

Also, download a Linux live image. Use Rufus (or something similar) to write the image to a USB stick. Then use the HP update utility you downloaded to create a "recovery USB stick". Let it run, then unmount the stick as normal and plug it into the laptop. Ignore the instructions the HP program gives you, they don't work.

Reboot the laptop and hold Win+B. If you disabled the boot delay (like I did), tell GRUB to launch the UEFI Firmware settings and hold Win+B after selecting that. When successful, you will see a DOS-like progress bar saying "Flashing boot block". You can let go of the keyboard. After that progress bar, you will get a few more reboots and then the "HP BIOS Update utility" will run and update the BIOS. And then it will be done.If the utility says something like "file not found", it means that your USB stick is broken, and you need to find another one.

So the update is now done. Success! As if.

See, the BIOS update clears the EFI variables. Among them the Boot variables that GRUB uses to announce its presence to the EFI. Result of that will be that the system will come up with an error 500 (BIOS was updated), and if you clear that, it will throw an error 3F0 (no OS found). This is where the live Linux comes in. Boot from the USB stick, mount the EFI system partition, and copy EFI/debian/grubx64.efi to EFI/boot/bootx64.efi. Umount everything and reboot. I should note that I use Debian, other distributions may install grub elsewhere.

Anyway, by now the Debian Grub should come up. Boot it. Once booted, delete the improper hack and put everything back the proper way. On Debian this is

Code: Select all

sudo rm -rf /boot/efi/EFI/boot
sudo dpkg-reconfigure grub-efi-amd64
That reinstalls the EFI variables. I'm sure that there's a distro-independent way of doing this, but this worked for me.
Carpe diem!
Post Reply