X
Tech

Experiments with my new laptop, Linux and UEFI

Installing Fedora and Mageia has been easy - but configuring UEFI Boot has been a nightmare
Written by J.A. Watson, Contributor

The following are the highlights — and lowlights — of my adventures over the past 36 hours or so with the new Compaq 15 laptop which I picked up recently, Windows 8.1 and UEFI BIOS/boot.

Fedora and Korora

I started with Fedora: I found it installs with no problem, recognises all of the hardware, and works well. At the end of the previous post I had confirmed that the Fedora Live USB image booted and ran, and the critical hardware bits worked. 

Raspberry Pi add-ons: My experiments with camera and wi-fi

In this context I use 'critical' to indicate the parts which sometimes give Linux difficulty, such as the graphic controller (ATI/AMD Radeon in this case), wi-fi adapter (Atheros) and such. Installation was absolutely routine, exactly as I have described several times before on several other UEFI systems.

I left Secure Boot enabled, and I had no problem booting the Live USB image. Fedora installed its own signed "shim" file, so the installed image also boots just fine with UEFI Secure Boot enabled — and, of course, also with Secure Boot disabled, duh. 

During the installation, it added Fedora to the UEFI boot list and it modified the UEFI boot sequence to place Fedora first; when I rebooted after installation, it booted up Grub (and then Fedora), exactly as it "should".  I was extremely pleased and impressed with this, and I started to think that perhaps HP had improved its UEFI BIOS operation (although it seems I was wrong).

Next up was Korora: I figured that if Fedora worked so well, and considering that I am basically a pretty lazy person, I might as well go ahead and install Korora so that I would have Fedora plus all the extra goodies, without having to install the extras individually myself.

It turned out that the Korora image that I had handy was the Cinnamon version, so that is what I installed. As expected, installation was a snooze, exactly the same as installing Fedora. In this case, because I am keeping both Fedora and Korora on this system, I made Fedora use the existing (Windows) EFI boot partition, but I let Korora create a new EFI partition for itself, to avoid the name conflict on the EFI directory.

Installing Mageia

At this point I was pretty much "on a roll", and I happened to have a Mageia Live USB stick handy, so I decided to try installing that as well. The interest here is in the fact that Mageia 4 doesn't have UEFI support, so I had to be a bit more creative to install it. 

I enabled 'Legacy Boot' support in the BIOS setup, then booted and installed Mageia that way. When it asked for the bootloader target, I told it to put it in the root filesystem (/), basically just to keep it out of the way (I didn't want it writing to the MBR of this GPT disk).

After the installation finished I disabled legacy boot again, and added Mageia to the Fedora Grub configuration file. Unfortunately that didn't work; Fedora's Grub can't boot non-UEFI images (openSuSE can do this which is why I had got into the habit of using this approach).

That left me unable to boot Mageia, so I needed a different bootloader. And that meant rEFInd to the rescue.

I wrote about this wonderful program the first time that I tried installing Linux on a UEFI system (rEFInd is an extremely flexible and powerful boot manager).

It is very small, installs to one directory in the EFI boot partition, and then will find, list and boot pretty much everything bootable on a UEFI system. I haven't written about it much recently, because I have been able to do everything I need with openSuSE Grub, but rEFInd is much more powerful and flexible than that. 

It took about 10 minutes to download, install and configure to boot it. There is no initial configuration required in rEFInd itself, the stock setup will find any of the "normal" bootable images including both EFI and Legacy boot images. In this case it found Fedora, Korora, Mageia and Windows 8. Very good stuff.

My pain with UEFI

But as for UEFI: what a royal pain. For those who might not be personally familiar with UEFI boot yet, and especially for those who might be familiar with only one UEFI boot implementation, I'm going to include some more details here to explain and illustrate why it is, for me, such a pain.

The UEFI BIOS boot configuration is made up of two basic parts — a list of boot objects, and a sequence in which they should be attempted. When you get a new Windows 8 system, there is usually only one "real" item in the list, that being the Windows 8 Bootloader. 

There will probably also be some other "pseudo" items or "generic" items in the list which allow for CD/DVD and USB boot, for example. The boot sequence on the a new Windows 8 system will contain the Windows Boot item first, and then perhaps some or all of the pseudo/generic boot items.

This is the first place I saw something unexpected in this UEFI BIOS, because there were items included in the default sequence which don't even exist in the list of boot objects. Weird.

When you install another bootable operating system, such as Linux, it will add an item to the boot object list for itself, and that item will be placed at the front of the boot sequence list. 

This makes the new operating system the default boot object the next time you reboot the system — hopefully. 

You can check all of this when running Linux (even when running it from a Live image), by using the 'efibootmgr' command. In its simplest form, with no arguments, it gives a short list of the sequence and the names of the objects; if you add '-v' to the command, it gives a longer list with the complete object list information and some other details. If you are going to install Linux, try this command before and after installing to see how the UEFI BIOS boot configuration changes.

Fedora 20: Hands on with five different desktops

That's all well and good, and as long as nothing else changes the boot configuration, everything works great. Unfortunately, the people at HP seem to think they are a lot smarter than you are (or than anyone else is), or else they think that they can channel Carnac the Magnificent, because every once in a while this machine will decide it doesn't like the boot configuration, and will change it back to the original sequence, with Windows first in the list. 

I have yet to figure out what triggers this, or even how to stop it short of actually wiping the disk and reinstalling only Linux.

In the specific case at hand, as I said above Fedora made the necessary changes to the boot configuration, and when I rebooted after installation it worked just fine and booted Linux, not Windows.

I worked with that for a while, rebooted several times, and it was all just fine.  I was pleased and impressed. Then I shut down (powered off) the system, and when I came back an hour or so later and turned it on again, it booted Windows.

Why the heck did that happen? What changed? Why did it change? Is it something to do with power cycling rather than just rebooting? I don't know. It took a good bit of fiddling about to get it back to booting Fedora again, and it was so obscure and unpredictable that I can't even tell you what finally got it to "stick" again.  But it finally did.

Then, after some more rebooting and even a power cycle or two (and it did not change back to Windows that time — but why?), I installed Mageia and then rEFInd. 

I saw that rEFInd made the changes to put itself in the boot object list and first in the boot sequence list, but when I rebooted it came up with Windows again (not rEFInd, and not even Fedora). Another long round of fiddling with the boot configuration until I finally got rEFInd to stick as the default boot. Again (still) I can't explain why it broke, and I can't explain what fixed it. I can only explain that it is extremely irritating and frustrating, as I'm pretty sure you can tell from this write-up.

My conclusions so far

So where does all this leave us? Linux works very well on this Compaq 15 h033sz, at least the three distributions I have installed so far. I actually also tried installing Debian GNU/Linux, but found that it includes an older X.org release which does not yet include support for the Radeon graphic controller in this system.

The Debian installation actually works, but when I boot the installed system the desktop doesn't come up. I can switch to a text console and login with no problem, but I haven't tried to sort out the display problem yet.

The thing which makes installing and running Linux on this system difficult seems to be the UEFI BIOS boot configuration, and that has nothing to do with Linux itself. If the blasted BIOS would just remain in the configuration it is given, everything would work smoothly.

Finally, I would like to point out to those who insist on going around and saying "UEFI Installation is easy, just use Ubuntu, or Linux Mint", or whatever particular distribution they happen to have tried and succeeded with.

To me it seems there are huge differences in UEFI BIOS implementations today: every OEM seems to do it differently. My Acer was a bit difficult at first, but I got a BIOS update from them a while back, and it has been pretty easy and stable since then.

My experience with HP has been painful as detailed above: so please, don't post comments saying how easy UEFI installation is — at least unless you have personal experience with the specific system in question.

There's more to do on this system. both with testing the Linux distributions I have already installed and also installing some other distributions to see how they handle this hardware. It should be interesting!

Further reading

Editorial standards