Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Setting up rEFInd on a macbook air from linux
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Mon May 07, 2018 6:15 pm    Post subject: [SOLVED] Setting up rEFInd on a macbook air from linux Reply with quote

So I got an old macbook air (3,1) from a friend and I want to put gentoo onto it.
I want to use refind as my bootloader, however despite my attempts to install it, it doesnt show up in the boot process.

The macbook came with 3 partitions:
sda1 EFI System partition (flagged as "boot, esp" in parted)
sda2: the main OSX partition
sda3: Recovery HD
I thought "sweet", put ext4 on sda2 and went on with the install as per the handbook.

I emerged refind and installed it using refind-install, which finished without complaints and installed refind under /boot/EFI/refind.
I put a kernel in the /boot/ directory and rebooted the machine. This however sent me into "OSX Disk Utility".
I rebooted from the live image and checked 'efibootmgr -v'. Sure enough there were a ton of entries. I deleted all of them and re-run refind-install.
Now 'efibootmgr -v' yields two entries:
Boot0000 rEFInd Boot Manager ...
BootFFFF PciRoot ...
I assume the latter one is the live image. However the machine still boots into OSX Disk Utility.

I checked some online guides (eg. https://www.spurint.org/misc/installing-gentoo-on-a-macbookair31/), most mention to install refind from OSX, which unfortunatly is not an option for me anymore. Other than that there doesn't seem to be anything special about the setup.
So how do I get the machine to actually run rEFInd?


Last edited by Dr.Willy on Wed May 09, 2018 5:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue May 08, 2018 3:07 am    Post subject: Reply with quote

http://www.rodsbooks.com/refind/installing.html
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Tue May 08, 2018 10:05 am    Post subject: Reply with quote

DONAHUE wrote:
http://www.rodsbooks.com/refind/installing.html

That is the rEFInd homeplage. I believe I read the relevant sections thoroughly, but I seem to be unable to identify the information that solves my problem.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue May 08, 2018 12:36 pm    Post subject: Reply with quote

I don't have a macbook.
However, I've been installing rEFInd manually using direct download and Rod's instructions since 2012 without problems.
Recommend same and minimize changes from the default refind.conf (after running emerge -C refind). My 2012 rEFInd has not needed upgrade to date.
http://www.rodsbooks.com/refind/bootcoup.html may be directly relevant. System Integrity Protection?
Rod might respond to a PM, he's srs5694.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Tue May 08, 2018 4:13 pm    Post subject: Reply with quote

Ok, I think I got it now:
I booted into the MacOS Recovery and ran
Code:
bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/efi/refind/refind_x64.efi --shortform
as described here.
That seemed to have done the trick. :-)
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue May 08, 2018 4:32 pm    Post subject: Reply with quote

Good on you. I would follow up by emerge -d refind to prevent updates from causing the problem to recur if you are still on the original emerged refind.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Mon May 14, 2018 3:04 pm    Post subject: Reply with quote

For the record and in case someone without access to a MacOS Recovery stumbles upon this topic:
'bless' added the following EFI-Entry:
Code:
Boot0080 Mac OS X HD(1,GPT,$PARTUUID,0x28,0x64000)/FILE(\EFI\refind\refind_x64.efi)

where $PARTUUID is the PARTUUID of /dev/sda1, which is my esp partition.
If it did any other magic, I don't know.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 14, 2018 3:46 pm    Post subject: Reply with quote

Dr.Willy wrote:
For the record and in case someone without access to a MacOS Recovery stumbles upon this topic: 'bless' added the following EFI-Entry:
Code:
Boot0080 Mac OS X HD(1,GPT,$PARTUUID,0x28,0x64000)/FILE(\EFI\refind\refind_x64.efi)

where $PARTUUID is the PARTUUID of /dev/sda1, which is my esp partition.

Dr.Willy ... I'm not sure why you needed to do this, but it isn't necessary (at least I've never had to).

Code:
# efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000
Boot0000* rEFInd   HD(1,28,64000,a5d32078-64a7-4c13-a0f1-1286c2f6422b)File(\efi\refind\refind_ia32.efi)

That was created with the following:

Code:
# efibootmgr --create --part 1 --label "rEFInd" --loader "\efi\refind\refind_ia32.efi"

I suspect you had/have other entries that required '-B,--delete-bootnum' ... and that would have been set as 'BootOrder', had you held 'alt' at boot you'd have got a menu where you could have selected known efi boot entries (so, the 'refind' entry added via efibootmgr), and once booted this would have set 'BootOrder' to that entry.

Dr.Willy wrote:
If it did any other magic, I don't know.

On a HFS+ volume it also changes the filesystem in some way (I assume adding a flag).

best ... khay
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Mon May 14, 2018 6:29 pm    Post subject: Reply with quote

khayyam wrote:
Code:
# efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000
Boot0000* rEFInd   HD(1,28,64000,a5d32078-64a7-4c13-a0f1-1286c2f6422b)File(\efi\refind\refind_ia32.efi)

That was created with the following:

Code:
# efibootmgr --create --part 1 --label "rEFInd" --loader "\efi\refind\refind_ia32.efi"

I suspect you had/have other entries that required '-B,--delete-bootnum' ... and that would have been set as 'BootOrder', had you held 'alt' at boot you'd have got a menu where you could have selected known efi boot entries (so, the 'refind' entry added via efibootmgr), and once booted this would have set 'BootOrder' to that entry.

Definitely not. As I mentioned in the first post I deleted all entries at one point.
<edit> Also if I booted normally I ended up in OSXRecovery. Holding down Alt was the only way to boot from USB stick at all. And the menu showed 2 entries: The Recovery and the stick. </edit>

However now that I look at the old entry added by refind-install:
Code:
Boot0000 rEFInd Boot Manager HD(1,MBR,0x33e95,0x1,0x3c7bff)File(\EFI\refind\refind_x64.efi)/dev/sda.1........H

It seems odd to me that it says MBR, because the disk really is gpt-partitioned.
Also what the f# is that '/dev/sda.1....' at the end of the line?


Last edited by Dr.Willy on Mon May 14, 2018 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 14, 2018 6:55 pm    Post subject: Reply with quote

khayyam wrote:
I suspect you had/have other entries that required '-B,--delete-bootnum' ... and that would have been set as 'BootOrder', had you held 'alt' at boot you'd have got a menu where you could have selected known efi boot entries (so, the 'refind' entry added via efibootmgr), and once booted this would have set 'BootOrder' to that entry.

Dr.Willy wrote:
Definitely not. As I mentioned in the first post I deleted all entries at one point.

Dr.Willy ... my bad, I'd only read the last post.

Dr.Willy wrote:
However now that I look at the old entry added by refind-install:

Code:
Boot0000 rEFInd Boot Manager HD(1,MBR,0x33e95,0x1,0x3c7bff)File(\EFI\refind\refind_x64.efi)/dev/sda.1........N

It seems odd to me that it says MBR, because the disk really is gpt-partitioned. Also what the f# is that '/dev/sda.1....' at the end of the line?

Definitely, the EFI specification doesn't support MBR, does your firmware have a 'legacy' mode perhaps? As for '/dev/sda.1', I've never seen anything after the 'File()', it seems like garbage as the disk is defined via 'HD()'. It's probably efibootmgr that is to blame, there are untold reported issues with >0.5.4 (which I'm still using, though it's not in tree). I've never used refind-install, I've always used the manual method, so perhaps the issue is there.

best ... khay
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Mon May 14, 2018 9:13 pm    Post subject: Reply with quote

khayyam wrote:
Definitely, the EFI specification doesn't support MBR, does your firmware have a 'legacy' mode perhaps?

I have _no_ idea. This topic mentiones that mac 'infer' that from the partition type … now im reading up what a hybrid-mbr is.
Macs are weird.

khayyam wrote:
As for '/dev/sda.1', I've never seen anything after the 'File()', it seems like garbage as the disk is defined via 'HD()'. It's probably efibootmgr that is to blame, there are untold reported issues with >0.5.4 (which I'm still using, though it's not in tree).

0.5.4? efibootmgr in the tree is 15 :lol:
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue May 15, 2018 1:11 am    Post subject: Reply with quote

Dr.Willy wrote:
khayyam wrote:
Definitely, the EFI specification doesn't support MBR, does your firmware have a 'legacy' mode perhaps?

I have _no_ idea. This topic mentiones that mac 'infer' that from the partition type … now im reading up what a hybrid-mbr is. Macs are weird.

Dr.Willy ... srs5694's post in that thread is spot on, but it doesn't explain the why a GPT partitioned disk would be considered MBR. I'd stay clear of hybrid-MBR (for reasons made clear in srs5694's guide). Apple use to provide an application called 'bootcamp' which would create hybrid-MBR for installing Windows along side OSX, and some use it thinking it was required for linux (mostly due to issues with the early framebuffer and grub2). They may have abandoned it now Windows supports GPT ... it was a horrible hybrid-MBR hack. Anyhow, GPT and EFI is by far the best option.

khayyam wrote:
As for '/dev/sda.1', I've never seen anything after the 'File()', it seems like garbage as the disk is defined via 'HD()'. It's probably efibootmgr that is to blame, there are untold reported issues with >0.5.4 (which I'm still using, though it's not in tree).

Dr.Willy wrote:
0.5.4? efibootmgr in the tree is 15 :lol:

Yes, 0.5.4-r1, that's partly because later versions switched to using efivarfs rather than NVRAM, and that transition was a bit mad ... as I said, the number of weird breakages I read at the time had me thinking it wasn't worth tracking development ... it works, I don't need to ever change it, and so why would I need efivarfs (particularly after it was revealed you could brick the machine due to it being rw).

best ... khay
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue May 15, 2018 1:39 am    Post subject: Reply with quote

quoting gdisk on my gpt labeled disks:
Found valid GPT with protective MBR; using GPT.
All my UEFI boards asrock, asus, gigabyte have selectable legacy bios, uefi, and combination legacy bios and uefi modes under a variety of name schemes.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum