Experiments with my new laptop, Linux and UEFI

Experiments with my new laptop, Linux and UEFI

Summary: Installing Fedora and Mageia has been easy - but configuring UEFI Boot has been a nightmare

SHARE:

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

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

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

Fedora 20: Hands on with five different desktops

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

Topics: Linux, Open Source, Operating Systems

J.A. Watson

About J.A. Watson

I started working with what we called "analog computers" in aircraft maintenance with the United States Air Force in 1970. After finishing military service and returning to university, I was introduced to microprocessors and machine language programming on Intel 4040 processors. After that I also worked on, operated and programmed Digital Equipment Corporation PDP-8, PDP-11 (/45 and /70) and VAX minicomputers. I was involved with the first wave of Unix-based microcomputers, in the early '80s. I have been working in software development, operation, installation and support since then.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

23 comments
Log in or register to join the discussion
  • PC makers no incentive to make UEFI friendly

    Why would PC makers need to make UEFI friendly? Their sole purpose is to make the native OS work and boot correctly. Their interest in a end user installing Linux or some other OS is not their problem. I see plenty of issues with users downgrading from Windows 8 to Windows 7 on PC's. Mostly because newer models won't have driver support from the PC maker for alternative Windows installs. Frankly I would expect as much if I bought a Linux PC and wanted to duel boot Windows. The only expectation people should have is that the OS that the PC maker installs works. Nothing else.
    JohnnyES
    • You ever hear of "retargeting"?

      It is also called "extending the useful life".

      Your "solution" is to make EVERY PC/tablet/... more junk every time the software for a platform is updated... just to make you buy another platform.

      There is enough electronic waste as it is.

      Giving a platform new life and use by loading an alternate operating system is an excellent way to save money.
      jessepollard
      • An observation, not a solution.

        He is just saying that companies have no business incentive to make your system more flexible. And he is right about that. Some do.

        I too think it is nice when systems can be configure the way you want them. As far as "retargeting" I think that works, but usually i find that once a system gets very old, while you can put an older OS (or keep the one that came with it), cooling fans fail, power cord connectors get loose, hinges (laptops) wear out, USB connectors are worn and a myriad of other problems. I seldom ever replace a PC because it isn't fast enough but usually because it is beginning to be more trouble than its worth.

        I don't think very many people really want to resurrect old worn-out hardware by running Linux on it. It is an option. And note while linux will run on really old processors, that doesn't mean the applications will run very well. Gimp is not going run very well on a PIII with 512 MB of memory. Running Linux doesn't make your computer faster. It simply requires fewer resources to run (mostly memory and disk). CPU cycle wise there really isn't much difference. If you have adequate memory Gimp will run just as fast on Windows as it does on Linux. If you have less than adequate (say 1 Gig memory) Gimp will do better on Linux since there would be more free memory.

        BTW, you can run Windows on really old hardware too. I had XP on a PIII with 512Mb of memory. By SP3 it crawled. I also ran linux on it which did work better but wasn't exactly blistering fast either.

        My current laptop is no barn burner it has gone through 3 Windows OS (Vista, Win7 and Win8) and it is the fastest with Win8 (booting mainly). I've replaced the battery a few times.
        DevGuy_z
    • Do You Believe That?

      PC makers sell hardware. If you want to run DOS on thing why should they care as long as they get your money?
      revspaminator
      • That's it though

        They don't care if you do that. However, they have no incentive to make sure it runs DOS well.
        Jason Joyner
        • No Obligation, and No Incentive to Buy

          This is correct, the OEM has no obligation to make the system, the BIOS, the firmare or anything else work well with Linux, or with any other operating system than the one it was sold with. But I hope there is some chance that users who are better informed about what works and what doesn't, and how easily, will make a better decision about which systems to buy when they intend to run Linux, whether alone or dual-boot. That is the reason that I write this blog, to try to spread some information and perhaps be of help to some others.

          As it happens, I have really like HP hardware over the years, I have found it to be generally well designed, well built and well supported. But their UEFI implementation is absolutely awful, so for the past year or so I have strongly advised my friends and family to avoid buying HP systems. I hope that readers of my blog might have gotten the same impression, when I use words like "irritating", "frustrating", "maddening".

          jw
          j.a.watson@...
          • I also have an HP laptop with UEFI

            J.A., I have to agree with you on the problems with HP's implementation of UEFI.

            I'm running Fedora right now because when I got the laptop in April 2013, it was the only distribution I could successfully install and dual-boot with Windows 8.

            The problem with boot order is maddening. There seems to be no way to get it to boot Linux first.

            I think the key might be adding Linux to the Windows boot menu and putting it first, and then letting the laptop boot to the Windows bootloader, where Linux would be the first choice.

            Unfortunately I haven't been able to figure this out. It might have something to do with Fedora creating a separate EFI partition (I think you've covered this before).

            Changing the boot order in the BIOS is impossible, as you've also found out. I thought that this would be fixed at some point in a BIOS/firmware update from HP, but that hasn't happened.

            Eventually I'm going to just single-boot Linux and leave all of this trouble behind, but it would be nice to have HP's BIOS give the user the choice of what to boot first.
            Steven Rosenberg
          • I still call it a BIOS ...

            I just read the comments, and as far as I'm concerned, there' s difference between calling it a UEFI BIOS and UEFI firmware. Especially in my HP Pavilion g6, it looks the same -- just as ugly as any BIOS from the last 15 years.

            I forgot to mention that efibootmgr in Linux can fix a lot of things in HP's UEFI implementation, but s J.A. says, any changes in boot order do not stick after a reboot.

            HP should fix this and allow changes in boot order in the "firmware."
            Steven Rosenberg
    • And only one incentive to make it unfriendly

      What that would be is left as an exercise for the student.
      John L. Ries
    • Re: PC makers no incentive to make UEFI friendly

      "Duel boot" indeed.
      HughRed
  • Yes, UEFI is terrible!

    I have no experience with the Compaq computer cited here, but have had to tackle issues with other manufacturers' UEFI systems. Not pretty and very much prone to error and failure to boot. My kneejerk reaction so far is to reset the BIOS from UEFI to legacy and reinstall everything from scratch onto a clean hard drive. UEFI is a solution for problems that do not exist.

    Well, at least the Toshiba Prius recalled yesterday does not have UEFI.
    ben_myers@...
  • Run Linux As Your Host System

    I suggest running Linux as your host operating system and moving Windows to a VM. VMware offers vCenter Converter Standalone as a free application that will build a virtual machine of your Windows installation. Once the Windows installation has been captured you can let Linux have the whole drive. Install VMware for Linux and run Windows as a guest OS. Works like a charm.
    Pronounce
    • Linux install bricks my Samsung laptop requiring samsung service center

      Some Samsung laptops will not allow a linux install because of hardware incompatibilities according to Samsung
      russwrose
  • No chorus of indignant MS-fans?

    Maybe we are making progress after all. I still think Jamie should be added as a co-author to the Linux and Open Source column, as that is his usual subject matter.
    John L. Ries
  • I'm a MS fan

    and I have EUFI secure boot enabled with Win 8.1. I do run Ubuntu and Mint but I use VMWare Workstation 10 to run them. I also run Windows Vista, XP and 7 as well as OSX Snow Leopard and Mountain Lion. So that leaves me with zero problems for EUFI :-) My computer is custom built.
    bvonr@...
    • In the past...

      ...any complaints about the MS-mandated version of UEFI were met by a chorus of "just turn it off" or "OEM's shouldn't cater to a small minority of Linux zealots". This is better than the refrain of "MS has a right to cripple the competition" of 15 years ago, but what we really want is serious discussion of issues regarding MS, or anyone else without the partisan drivel.

      The talkbacks on this particular article are as close to the preferred standard as I've seen on an article discussing Linux.
      John L. Ries
  • Also

    I do have android running in a VM but it sucks the big one :-)
    bvonr@...
  • Not "BIOS"

    Please call it "UEFI firmware", not "UEFI BIOS". It is not a BIOS, more or less by definition: if it was a BIOS it'd act like a BIOS and it wouldn't be UEFI. BIOS is a specific type of system firmware, just like UEFI, not a generic term for 'system firmware'.

    It sounds a lot like the particular UEFI firmware you're dealing with here is buggy and/or overly 'helpful'. And yes, "there are huge differences in UEFI [firmware] implementations today: every OEM seems to do it differently", but then there are huge differences in BIOS firmware implementations too, we just got quite good at dealing with them, and after 20+ years of BIOS they'd pretty much exhausted all the insanity they could come up with.

    UEFI is a much more complex spec than BIOS and therefore there's all kinds of exciting ways to get it wrong. Which is going to be just *so* much fun. Le sigh.

    Have you reported the problem to HP? They might fix it. Stranger things have happened.
    AdamWill
    • Thanks

      Hi Adam, Thanks for the correction, I will try to keep that in mind. Yes, I have reported it to HP - actually I had already reported it some time ago in connection with the Pavilion dm1 system. The reply that I got was that it "works as designed", and it is designed that way to "correct mistakes made by users". Not very encouraging.

      Thanks for reading and commenting, as always.

      jw
      j.a.watson@...
    • Re: Not "BIOS"

      Of course you are right. Except I think that most systems have BIOS functions so that you can turn of UEFI if you want.

      Also, I just updated the firmware on my brand new Lenovo Yoga 2 pro, and Lenovo called the firmware "BIOS".

      (I'm here for hints on how to have a problem-free Fedora 20 installation.)
      HughRed