|
|
Subscribe / Log in / New account

Garrett: Booting with EFI

Matthew Garrett investigates the subtleties of booting Linux with EFI. Once again, hardware vendors are myopically focusing on Windows. "As we've seen many times in the past, the only thing many hardware vendors do is check that Windows boots correctly. Which means that it's utterly unsurprising to discover that there are some systems that appear to ignore EFI boot variables and just look for the fallback bootloader instead. The fallback bootloader that has no namespacing, guaranteeing collisions if multiple operating systems are installed on the same system. [...] It could be worse. If there's already a bootloader there, Windows won't overwrite it. So things are marginally better than in the MBR [Master Boot Record] days. But the Windows bootloader won't boot Linux, so if Windows gets there first we still have problems."

to post comments

Garrett: Booting with EFI

Posted Jul 14, 2011 21:32 UTC (Thu) by jgg (subscriber, #55211) [Link] (2 responses)

I've got a system here I went to the trouble to make boot with EFI, and it is still a big pain. Got it working with Ubuntu Maverick, but when I fresh installed Natty it formatted the EFI partition, which made Windows completely unbootable. Plus I get a kernel oops on reboot every time.

Not sure EFI is worth the hassle, but once you've got Windows installed as EFI I think there isn't much choice for Linux - or at least it is even more hassle :|

On the plus side, the Asus EFI BIOS seems to work mostly OK, it can EFI boot from USB and AHCI, but curiously not from the on board IDE.

Garrett: Booting with EFI

Posted Jul 15, 2011 2:22 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

Try booting with reboot=a, or wait for 3.0. Some machines appear to assume that they've got a flat address space when rebooting.

Garrett: Booting with EFI

Posted Jul 15, 2011 13:50 UTC (Fri) by n1ho (guest, #55855) [Link]

I took a 1TB USB drive and put EFI and GUID partitions on it, and then installed Ubuntu Natty on it with GRUB2. It took a bit of playing around with 'parted' to set everything up just right, but it does work. In fact, I was then able to create multiple partitions on it, and was able to install openSUSE 11.4 and Mageia on two of them. They were slightly confused, but they did install, and I had to remember to 'update-grub' under Ubuntu before being able to actually try to boot either openSUSE or Mageia. However, both Fedora 14 and 15's installer utterly failed to recognize the partitions and crapped out with seg faults when I attempted installations. (Mandriva also worked, but I've since dropped it in favor of Mageia). And, this is all on an Acer Aspire One netbook, not an Apple machine.

So, some (slow) progress is being made in the Linux community, but it appears there is a fair amount of distribution-specific work ahead.

Garrett: Booting with EFI

Posted Jul 14, 2011 21:46 UTC (Thu) by elanthis (guest, #6227) [Link] (5 responses)

The windows boot loader will quite happily let you add entries to boot from other partitions, which can include ones with GRUB installed.

Garrett: Booting with EFI

Posted Jul 14, 2011 22:32 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (4 responses)

You don't boot partitions in EFI.

Garrett: Booting with EFI

Posted Jul 15, 2011 4:40 UTC (Fri) by bdonlan (guest, #51264) [Link] (3 responses)

And you don't actually register partitions in the windows bootloader, you put a boot sector into a file and pass _that_ to the windows bootloader.

Garrett: Booting with EFI

Posted Jul 15, 2011 12:13 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

Boot sectors also being something that doesn't exist in EFI :)

Garrett: Booting with EFI

Posted Jul 15, 2011 13:25 UTC (Fri) by proski (subscriber, #104) [Link] (1 responses)

I think installing a smart fallback bootloader to EFI is still a better idea than messing with a Windows install.

Garrett: Booting with EFI

Posted Jul 15, 2011 13:28 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

Doing so implies overwriting the fallback bootloader that Windows installed, so in a sense you're still messing with it. Probably safely, though.

Garrett: Booting with EFI

Posted Jul 15, 2011 1:52 UTC (Fri) by pjones (subscriber, #31722) [Link] (11 responses)

Once again, hardware vendors are myopically focusing on Windows.

This is a bit hyperbolic - enough to be a somewhat unrealistic assessment. While it is true that there are vendors who don't care about Linux at all, many others do. In general, there's been quite a bit of cooperation in making sure Linux supports UEFI platforms. There could be more, and there have been setbacks; I'm not saying it's a perfect scenario. But at the same time, we, the Linux community, could be much more involved than we currently are.

As an example, the UEFI forum holds two plugfests per year; one in North America and one in Asia (where many hardware vendors are). The most recent plugfest was held last week at the Microsoft campus in Redmond, WA. Of Linux vendors, only Red Hat and Canonical sent any representatives whatsoever. The atmosphere was fairly collegial, and nobody *refused* to allow testing of any kind.

It's not just hardware vendors that could be communicating and working together better.

Garrett: Booting with EFI

Posted Jul 15, 2011 2:20 UTC (Fri) by mjg59 (subscriber, #23239) [Link] (10 responses)

...and the problem is, obviously, to a large extent influenced by a specification that explicitly allows this kind of behaviour while later on disclaiming any responsibility for how operating systems should handle it. The only way to handle that is by having more participation in the appropriate bodies.

Garrett: Booting with EFI

Posted Jul 15, 2011 4:04 UTC (Fri) by ringerc (subscriber, #3071) [Link] (9 responses)

It sounds like EFI also needs a better test suite. Don't just boot Windows, boot the EFI test suite image. Require that vendors that claim "EFI support" pass the test suite.

If a test suite that checks for all these quirks can be grown over time as issues are discovered, and if there's an incentive for vendors to actually use the test suite, then things might improve. It's not too late in the implementation of EFI to get that sort of thing moving.

Garrett: Booting with EFI

Posted Jul 15, 2011 13:39 UTC (Fri) by pjones (subscriber, #31722) [Link] (8 responses)

It actually does have this.

Garrett: Booting with EFI

Posted Jul 15, 2011 15:01 UTC (Fri) by hitmark (guest, #34609) [Link] (7 responses)

Let me guess, MS has their own test suite...

Garrett: Booting with EFI

Posted Jul 15, 2011 17:04 UTC (Fri) by pjones (subscriber, #31722) [Link]

Not that I know of. As far as I know they use the SCT on uefi.org just like everybody else does.

There really isn't anything obviously nefarious going on here.

Garrett: Booting with EFI

Posted Jul 15, 2011 17:27 UTC (Fri) by mjg59 (subscriber, #23239) [Link] (5 responses)

The problem is actually that none of the bugs we've hit are in paths exercised by the test suite, either because it doesn't test them or because they only trigger once you've set up non-executable pages or non-1:1 pagetables.

Garrett: Booting with EFI

Posted Jul 15, 2011 18:05 UTC (Fri) by cesarb (subscriber, #6266) [Link] (1 responses)

Would it be possible to have them enhance the test suite to catch these kinds of problems?

Garrett: Booting with EFI

Posted Jul 15, 2011 20:24 UTC (Fri) by pjones (subscriber, #31722) [Link]

That's something I'm looking into for the future, but for various reasons hasn't happened yet.

Garrett: Booting with EFI

Posted Jul 15, 2011 18:10 UTC (Fri) by luto (guest, #39314) [Link] (2 responses)

Does the test suite not include things like "intelligently handles the boot menu?"

It would be fairly easy to test. Just put three bootloaders in the system partition: EFI/boot/bootx64.efi, EFI/test/a.efi, and EFI/test/b.efi. Set a.efi first in the boot order and b.efi second. Then tell the user running the test to navigate their firmware menu and boot from b.efi.

Sadly, even my shiny new Intel board can't do that. You'd think that the inventor of the original EFI spec would get this right. (Of course, the board can't reboot via EFI either. Oh, well.)

Garrett: Booting with EFI

Posted Jul 15, 2011 18:13 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

No, because it's simply an application that runs under the EFI shell.

Garrett: Booting with EFI

Posted Jul 20, 2011 1:14 UTC (Wed) by pjones (subscriber, #31722) [Link]

In addition to what Matthew said, the boot menu is also not standardized. I think there's some chance we can script some boot menus, if they're compliant with the HII guidelines, but some of them are simply outside the realm of possibility.

Garrett: Booting with EFI

Posted Jul 15, 2011 20:18 UTC (Fri) by UnderScore (guest, #31918) [Link] (3 responses)

Can anyone comment on the state of PXE booting and UEFI? I haven't seen much (not that I've really looked hard) about it and it appears that cobbler does not yet support it.
Thanks,
James

Garrett: Booting with EFI

Posted Jul 15, 2011 20:33 UTC (Fri) by pjones (subscriber, #31722) [Link] (2 responses)

IPv4 netbooting should currently work in Fedora/RHEL (look here for some instructions; this should also be in a future version of the Installation Guide.)

IPv6 pxeboot isn't ready just yet.

Garrett: Booting with EFI

Posted Jul 15, 2011 22:04 UTC (Fri) by smoogen (subscriber, #97) [Link]

Oh cool. That will make getting the new Fedora boxes up a lot faster. Currently the boxes are taking forever trying to boot uefi pxe, timing out, trying other things then falling back to internal ethernet pxe. Feels like it takes about 8 minutes to get a box to being able to install.

Garrett: Booting with EFI

Posted Aug 5, 2011 2:35 UTC (Fri) by breakneck (guest, #77736) [Link]

I followed your instructions and was unable to get PXE boot to work using RHEL 6.1 (it just dumps me to the GRUB shell).

I finally thought to look at the traffic with Wireshark and saw some strange behavior. bootx64.efi transfers successfully, but then when it tries to download the GRUB config file, it requests a filename which includes the client's MAC address. It doesn't make a request for "default" or "efidefault". If I change my config filename to the filename it's looking for, PXE boot starts working great.

Is there a setting to specify where my config file is located?

Here's some info about my setup:

------------------------
Wireshark log for TFTP request:
-------------------------
No. Time Source Destination Protocol Length Info
700 4.829030 192.168.100.53 192.168.100.100 TFTP 108 Read Request, File: /86800000-0011-0010-0080-E06995883282, Transfer type: octet, tsize\000=0\000, blksize\000=512\000

------------------------
/var/log/messages log file:
-------------------------
Aug 4 18:47:18 red dhcpd: DHCPDISCOVER from e0:69:95:88:32:82 via eth1
Aug 4 18:47:19 red dhcpd: DHCPOFFER on 192.168.100.53 to e0:69:95:88:32:82 via eth1
Aug 4 18:47:21 red dhcpd: DHCPREQUEST for 192.168.100.53 (192.168.100.100) from e0:69:95:88:32:82 via eth1
Aug 4 18:47:21 red dhcpd: DHCPACK on 192.168.100.53 to e0:69:95:88:32:82 via eth1
Aug 4 18:47:21 red in.tftpd[9493]: RRQ from 192.168.100.53 filename BOOTX64.efi
Aug 4 18:47:21 red in.tftpd[9493]: tftp: client does not accept options
Aug 4 18:47:21 red in.tftpd[9494]: RRQ from 192.168.100.53 filename BOOTX64.efi
Aug 4 18:47:22 red in.tftpd[9495]: RRQ from 192.168.100.53 filename BOOTX64.efi
Aug 4 18:47:22 red in.tftpd[9496]: RRQ from 192.168.100.53 filename /86800000-0011-0010-0080-E06995883282
Aug 4 18:47:22 red in.tftpd[9497]: RRQ from 192.168.100.53 filename //86800000-0011-0010-0080-E06995883282
Aug 4 18:47:22 red in.tftpd[9498]: RRQ from 192.168.100.53 filename //86800000-0011-0010-0080-E06995883282
Aug 4 18:47:22 red in.tftpd[9499]: RRQ from 192.168.100.53 filename //86800000-0011-0010-0080-E06995883282
Aug 4 19:02:22 red xinetd[9304]: EXIT: tftp status=0 pid=9459 duration=1090(sec)

------------------------
86800000-0011-0010-0080-E06995883282 GRUB config file
-------------------------
default=0
timeout 10
title RHEL6
root (nd)
kernel /rhel/vmlinuz keymap=us lang=en_US method=ftp://192.168.100.100/RHEL6 ip=dhcp noipv6
initrd /rhel/initrd.img

-------------------------
dhcpd.conf
-------------------------
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.50 192.168.100.250;
option routers 192.168.100.254;
option subnet-mask 255.255.255.0;
next-server 192.168.100.100;
filename "BOOTX64.efi";
}


Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds