You are not logged in.

#1 2013-01-20 22:21:19

enduser
Member
Registered: 2012-10-04
Posts: 25

[SOLVED] Using Apple's UEFI boot menu with Arch

Hello,
      I've successfully installed arch on my mid-2012 (5,1) 11" Macbook Air, and now I'm trying to get an entry in apple's boot menu (the one that shows when you hold 'option' when starting the computer).  From the author of rEFInd's install instructions (http://www.rodsbooks.com/refind/installing.html#osx) it sounds like I can just add some files to `/dev/sda1` (a vfat directory that contains the stuff needed to boot macos), and then run apple's `bless` command and we're good to go.  Unfortunately I've tried this a bunch of different ways, to no avail.  I think some of my failure is simply because of a misunderstanding of UEFI, here are some questions I (partially) don't understand and my current understanding of them:

1. Do I even need a bootloader on a pure GPT/UEFI system?  It seems like the answer is no, and I can just use the UEFI firmware and the linux kernel to load Arch (per: https://wiki.archlinux.org/index.php/UE … ux_Kernel).  Note: I'd like to have as little software between the firmware and the os, for speed and simplicity.  However, I'd still like to dual boot, but it sounds like the firmware can handle showing me a menu as long as there are entries pointing to parts of each OS.
2. Will grub/rEFInd/syslinux do some of the work for me initially/on a kernel update?  I think the answer is yes, which would be motivation (esp when I need to update the kernel) to just use a multibootloader and have it handle arch and the firmware pass control to either that or MacOS
3. Will `efibootmgr` brick my mac?  https://wiki.archlinux.org/index.php/UE … FI_systems says it will, but I think the `grub-install` command uses `efibootmgr`, so should I not try grub on here (this package: https://www.archlinux.org/packages/core … fi-x86_64/ ).  Also some of the other packages (like rEFInd-efi) depend on efibootmgr, so does that mean any kind of an install from them (a command from the package, not the `pacman -S pkg` command) will also brick my system? (see rEFInd-efi dependencies: https://www.archlinux.org/packages/extr … efind-efi/ )

I've been searching a bunch of different things, output of the `bless` commands I've been running, and have found the following:
* https://bbs.archlinux.org/viewtopic.php?id=148647
* Using OSX to install rEFInd manually (moving the files around and using OSXs `bless` command) http://www.rodsbooks.com/refind/installing.html#osx , I used the rEFInd files from Archs repos: https://www.archlinux.org/packages/extr … efind-efi/ )
* The Wiki docs on rEFInd https://wiki.archlinux.org/index.php/UE … ing_rEFInd

To summarize, I'm trying to set up a dual boot between MacOS (installed) and Arch (also installed, there's just no way to boot it on my system yet) using Apple's built in menu that deals with the EFI partition on /dev/sda1 .  Thanks in advance for any help!

end

Last edited by enduser (2013-03-18 12:00:17)

Offline

#2 2013-01-21 01:02:49

creese
Member
Registered: 2012-07-21
Posts: 26

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

I have a Macbook 5,1.

I followed the instructions in the Beginner's Guide under EFISTUB. It works.

Last edited by creese (2013-01-21 01:03:50)

Offline

#3 2013-01-21 01:12:42

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

enduser wrote:

I've successfully installed arch on my mid-2012 (5,1) 11" Macbook Air, and now I'm trying to get an entry in apple's boot menu (the one that shows when you hold 'option' when starting the computer).  From the author of rEFInd's install instructions (http://www.rodsbooks.com/refind/installing.html#osx) it sounds like I can just add some files to `/dev/sda1` (a vfat directory that contains the stuff needed to boot macos), and then run apple's `bless` command and we're good to go.

Not quite. That makes a boot loader bootable, but it doesn't add an entry to Apple's boot manager menu. There's a blog post somewhere by Matthew Garrett that describes the steps necessary to add something to Apple's boot manager, but I couldn't find it in a quick Web search. Maybe you'll have better luck, or be able to track down the same information somewhere else. As I recall, it involves using a separate HFS+ volume, creating two or three dummy files, and using "bless" in OS X.

1. Do I even need a bootloader on a pure GPT/UEFI system?

Yes, you do need a boot loader. It's important to distinguish between a boot loader and a boot manager, though. The former is a program that loads a kernel, and perhaps associated data, into memory and transfers control to the kernel. A boot manager presents a user interface that enables you to select which OS (or which boot loader) to launch. A boot manager is not strictly necessary, and Apple's EFI implementation includes its own simple boot manager, which is what you've been unsuccessful in configuring.

Note: I'd like to have as little software between the firmware and the os, for speed and simplicity.  However, I'd still like to dual boot, but it sounds like the firmware can handle showing me a menu as long as there are entries pointing to parts of each OS.

Many people make do with the firmware's own boot manager, but this can be rather inflexible. I'm not even sure if Apple's boot manager can handle passing options to Linux kernels' EFI stub loaders. This ability is not absolutely required, but without it you must compile your options into your kernel at compile time, which greatly reduces flexibility since you can't modify the options on a per-boot basis -- say, to boot into single-user mode if this is required.

2. Will grub/rEFInd/syslinux do some of the work for me initially/on a kernel update?

The usual Arch Linux method of handling kernel updates is to overwrite an old kernel with a new one, so no boot loader/boot manager changes are required. If you want to keep numbered kernels around (as most other distributions do), GRUB provides scripts that can help automate changes, but they are required in the grub.cfg file. rEFInd can auto-detect boot loaders, and if you're using the EFI stub loader, that means that the kernel is its own boot loader, and with a proper configuration, rEFInd can detect new kernels without changing its configuration file.

SYSLINUX has some very early and very experimental EFI support. The one and only time I tried it (about a month ago), it wouldn't compile for me. (I don't know of a precompiled binary available on the Web -- the support is that new!) I don't recommend trying it unless somebody who's gotten it to work offers to help you personally.

3. Will `efibootmgr` brick my mac?  https://wiki.archlinux.org/index.php/UE … FI_systems says it will, but I think the `grub-install` command uses `efibootmgr`, so should I not try grub on here (this package: https://www.archlinux.org/packages/core … fi-x86_64/ ).

There were reports of efibootmgr damaging Mac firmware several months ago (I believe over a year ago). Since then I've seen claims that this problem has been fixed with recent kernels (3.0 and later, IIRC), but I've seen no substantiation one way or the other. Overall, I recommend caution....

Also some of the other packages (like rEFInd-efi) depend on efibootmgr, so does that mean any kind of an install from them (a command from the package, not the `pacman -S pkg` command) will also brick my system? (see rEFInd-efi dependencies: https://www.archlinux.org/packages/extr … efind-efi/ )

On a Mac, I recommend installing rEFInd (or any other EFI boot loader) from OS X rather than from Linux. (Note that I'm rEFInd's maintainer, so that's an official recommendation from the software's developer.) Offhand, I don't know if the Arch package for rEFInd runs efibootmgr automatically on boot or just has it as a dependency because efibootmgr is the usual way to register a boot loader on UEFI systems. If the latter, it should be safe to install the Arch package for rEFInd, copy its files, and then reboot to OS X to run bless on it. It would be just as easy, if not easier, to install it completely from OS X, though.

Offline

#4 2013-01-21 23:10:28

enduser
Member
Registered: 2012-10-04
Posts: 25

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

Firstly thanks for all the information (everyone, both posts were useful).  Oddly enough it's working now.  I'm not sure what (if anything) I've changed, but now the menu shows up before (after a timeout) OSX loads.  Theres some config incorrect for my arch partition, but this should be trivial to fix.  I'll make sure to change the title to [SOLVED] if/when I get it working for sure.

Offline

#5 2013-02-10 22:37:36

enduser
Member
Registered: 2012-10-04
Posts: 25

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

Got it working!  It turns out rEFInd should have its own directory (/boot/efi/EFI/refind/) and arch should have its own.  The only bootloader-related I've run into since then has been I need to copy vmz-... and initramfs* to /boot/efi/EFI/arch each time there's a kernel update.  Thanks again for the help!

Offline

#6 2013-02-10 22:53:25

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

You should know your phrasing of your question and your resulting fix are quite confusing.  You are asking how to use the native bootloader on a mac, yet then go on to indicate that you are having trouble getting refind to work.  Then your solution is ultimately with refind.  So I think that you were never interested in getting the macs native bootloader to work, but rather you wanted to get a boot manager to work.

I am glad you go it working, but I think that you should know that there is a difference between what your title is asking and what your post is asking.

Offline

#7 2013-02-15 15:01:49

enduser
Member
Registered: 2012-10-04
Posts: 25

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

Right you are.  I guess what I really wanted was to boot arch.  I don't like spending lots of time working with bootloaders and managers, and though my computer takes a little more time to boot now (it's fast after it gets past rEFInd) I'm happy that it works smile.  I prefer having the smallest amount of software running from starting the computer to loading the OS, for simplicity's sake, and because I don't really understand bootloaders and prefer to spend time elsewhere.  tl;dr "It Works!"

Offline

#8 2013-03-18 11:59:01

enduser
Member
Registered: 2012-10-04
Posts: 25

Re: [SOLVED] Using Apple's UEFI boot menu with Arch

For future reference, the command that works is: `sudo bless --mount /whereTheEfiPartitionIs --setBoot --file /whereTheEfiPartitionIs/EFI/refind/refind_x64.efi` from macos

Offline

Board footer

Powered by FluxBB