Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] grub2 as only bootmanager for gentoo and os x
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
DZoom
n00b
n00b


Joined: 13 Jun 2010
Posts: 55

PostPosted: Tue Jan 21, 2014 10:43 pm    Post subject: [SOLVED] grub2 as only bootmanager for gentoo and os x Reply with quote

Hi,

i want to reinstall gentoo on my macbook (8,1).
os x still resides on it, i'm following the handbook as usual and in parallel this guide, paying closest attention to the part adressing the bootloader:
http://ck.kennt-wayne.de/2012/jun/gentoo-linux-on-the-macbook-pro-82-late-2011
so basically i emerge sys-boot/efibootmgr after adding it to package.keywords, i did not add grub2 as a stable release is available in portage.
i also added the GRUB_PLATFORMS="efi-64" to my make.conf.

now in the installation process i'm stuck after compiling my kernel.

the following command is a problem:
Code:
grub2-install --boot-directory=/boot --bootloader-id=grub2 --no-floppy --recheck
/usr/lib/grub/i386-pc doesn't exist. Please specify --target or --directory

ok, so i did. looking up what resides in /usr/lib/grub and changing the command appropriatly, receiving another error:
Code:
grub2-install --boot-directory=/boot --bootloader-id=grub2 --no-floppy --recheck --target=x86_64-efi
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.

OK, so i loaded the modul, but the error message staid.
what else can i do while accessing the system in a chrooted environment?
i also tried loading the services in the chrooted environment (which told me that it is not a good idea), but still no change.
but without a boot manager i won't be able to boot gento... or even choose between gentoo and mac os.

any help is appreciated.


Last edited by DZoom on Sun Jan 26, 2014 1:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Wed Jan 22, 2014 8:08 am    Post subject: Reply with quote

suggest use refind and forget grub
http://www.rodsbooks.com/refind/getting.html
http://www.rodsbooks.com/refind/installing.html#osx
_________________
Defund the FCC.
Back to top
View user's profile Send private message
DZoom
n00b
n00b


Joined: 13 Jun 2010
Posts: 55

PostPosted: Fri Jan 24, 2014 12:30 am    Post subject: Reply with quote

DONAHUE wrote:
suggest use refind and forget grub
http://www.rodsbooks.com/refind/getting.html
http://www.rodsbooks.com/refind/installing.html#osx


No :)
I'm searching an actual solution.
Despite the error message something happened, the EFI partition received a grub2 folder.

After restarting, mac os x loaded.
i therein applied the commands taken from here: https://wiki.archlinux.org/index.php/GRUB_EFI_Examples
Code:

su
# cd /Volumes
# mkdir efi
# mount -t msdos /dev/disk0s1 /Volumes/efi
# bless --folder=/Volumes/efi --file=/Volumes/efi/EFI/grub2/grubx64.efi --setBoot
# bless --mount=/Volumes/efi --file=/Volumes/efi/EFI/grub2/grubx64.efi --setBoot
diskutil unmount /dev/disk0s1


after rebooting the macbook, grub2 showed up and gentoo is bootable.
at first mac os x maverick was not, turned out the correct grub2 entry for booting directly into mac os x is the following:
Code:
menuentry "OS X Maverick" {
    insmod part_gpt
    insmod hfsplus
    set root='hd1,gpt2'
    chainloader /System/Library/CoreServices/boot.efi
}


whysoever it is hd1 and not hd0 i can not figure out, the hdd layout is as follows:
/dev/sda1 EFI
/dev/sda2 os x
/dev/sda3 recovery hd
/dev/sda4 swap
/dev/sda5 root

no second hard disk installed.
anyway now all of this works like a charm:
using grub2 only to boot either gentoo or mac os x.
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