HOWTO: Update You HP BIOS From Linux

Linux users consistently get the short end of the stick when it comes to BIOS updates. Oftentimes dmesg will show us that something is wrong in the BIOS and we have no way to fix it. This is especially infuriating when you have a laptop with no CDROM drive and it doesn’t like to boot off usb because of… a bug in the BIOS. This is the HP 6730b laptop with the 00D BIOS. It’s a disaster of a monumental scale. It’s a nice laptop when it works, but oftentimes with fedora or suse (or any other distro which uses the intel driver rather than vesa) the screen “flickers” and the laptop runs like junk until you CTRL+ALT+F2 it and back again a few times. The dmesg log will be filled with errors about intel_iommu and the kernel will report a crash.

Officially the problem is a buggy BIOS, what’s actually happening is the iommu register is being mapped to ‘0’ rather than any actual address. This means the CPU has it, the BIOS maps it incorrectly and then tells the OS to use ‘0’ as the address in memory. If the kernel didn’t do sanity checking your box would crash. As it stands it simply causes an interrupt (the screen flashing) and then it’s caught.

HP’s site is amazingly bad and offers up three options – Bootable CD, USB and floppy. The laptop won’t USB boot, because of the 00D BIOS. The laptop doesn’t have a floppy drive, and who does anymore? The laptop will boot off a CD, but this requires you to actually find a CD. I tried a DVD and booktyped it as a CD just for grins and it didn’t work. How are we supposed to update this crap? Install windows?

The workaround: If you don’t want to do this, the cheap workaround is to turn off “virtualization technology” in the BIOS and set intel_iommu=0 in the grub.conf. You will lose access to virtualization accelleration. It will still cause kernel problems, but it will happen much less frequently. This also fixes the problem with sleeping unless the box had the problem when it started up.

The fix: Ready to take the plunge? Get yourself an HP account first. Registration is free.

Install syslinux. In fedora, this is yum install syslinux and it puts in in /usr/share/syslinux. I would also install the perl stuff if you plan on doing a lot of servers with this. If HP continues this sort of crap for servers that they did with laptops, plan on doing this – a lot.

Grab sp50750. There’s actually an F17 BIOS, but it only affects Windows 7 and appears to have driver updates also.  If you want that one instead, use sp51317. As of right now the sp51317 download link doesn’t work, I believe they pulled it.

At this point I used wine to unpack the executable and I used rar to dump out ROM.CAB. Grab the ROM.BIN file and tuck it somewhere safe.

Grab sp50751. This is the F16 BIOS but this is for a different laptop. Do not apply this BIOS to your laptop. You have been warned. I didn’t try to apply the BIOS from that link to this laptop.

When you unpack that one, you will notice an ISO directory. You want to go in to that directory and mount the ROM.ISO – mount -o loop rom.iso tmp will mount the iso to a tmp directory. Create tmp first if it doesn’t exist.

Inside of your tmp directory (which is really the iso), you will see a /boot directory. Inside of that directory is a release.img file. Now we’re getting somewhere! You can run file release.img and see that it’s actually a floppy disk. Sweet! Copy this floppy image out of the ISO.

Mount up the floppy image. mount -o loop release.img tmp will do it, just like the CD. The difference is we can read and write to the floppy image while we can’t do that to a CD image. Doing an ls into our floppy image shows a 68PDD.BIN file, which is the BIOS. How am I so sure? It’s the only BIN file in there. Copy your ROM.BIN file we extracted earlier over the 68PDD.BIN file. Hit yes to overwrite it and then unmount the image.

WHAT DO WE DO WITH IT?

We can boot from it!

Copy release.img and /usr/share/syslinux/memdisk to /boot.

Edit /boot/grub/menu.lst and add the following:

title Floppy Disk Image
root (hd0,0)
kernel /memdisk
initrd /release.img

Reboot and select “Floppy Disk Image” from the grub menu, and it will boot into freeDOS and flash F16 to your laptop! Next time you boot you’ll have the new BIOS after it does some tests.

Proof?

[    0.000000] WARNING: at drivers/pci/dmar.c:633 warn_invalid_dmar+0x7d/0x8d()
[    0.000000] Hardware name: HP Compaq 6730b (SERIAL NUMBER)
[    0.000000] Your BIOS is broken; DMAR reported at address 0!
[    0.000000] BIOS vendor: Hewlett-Packard; Ver: 68PDD Ver. F.16; Product Version: F.16

New F16 bugs! Good thing HP fixes them all!

Flash Player for Linux

I really hate Adobe’s stuff, I truely do.

If you’ve recently gotten screwed by the latest flash release, this post is for you. I know the update has been around forever, but it shows you how often I actually get on youtube or whatever to use flash.

If you’re using the RPM, stop right now. You fail.

If you’re using the .DEB, it might work. The deb is slightly less braindead than the RPM.

If you’re using Ubuntu you have your own set of issues to deal with and shouldn’t be fucking around on youtube anyway.

Everyone else – here’s what you do: The following is loosely based on the official adobe instructions. If you’re saying “I did follow them and I broke my firefox” you’re in the right place! It doesn’t work, at all, as it’s packaged.

Step 1: Go to the official website and get flash player. Or you can use this link, which does the same thing.

Step 2: As root, remove all previous versions of libflashplayer.so either through your package management application or simply ripping them out wholesale. find / -name libflashplayer.so will show you all the places it’s lurking.

Step 3: Grab the tar.gz version. Skip the deb, skip the rpm, skip whatever other crap you’re offered.

Step 4: As your user execute mkdir $HOME/.mozilla/plugins

Step 5: cd $HOME/.mozilla/plugins and then tar -zxvf $HOME/install_flash_player_10_linux.tar.gz

Restart your browser. You should be able to visit about:plugins and see shockwave flash and futuresplash. The reason we did it this way was because your user and only your user should have access to the flash.so so that if some weird remote exploit comes out, you don’t have to worry about polluting everyone’s shared libraries with your filth. More on the point if you ever have to write off your account entirely due to a remote exploit, we can ensure the only thing which the exploit can touch is your home directory. There’s no reason for adobe to be putting this in the shared libraries directory and more on the point I believe selinux doesn’t permit it’s execution anyway.

My guess is that Adobe either doesn’t know how it works or they want to prevent the forking of flash with competing products. If they make it so flash must be installed system wide then they keep the other forks of flash out of the system.