Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2/EFI & a 2010 Macbook Pro
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
datafatmunger
n00b
n00b


Joined: 02 Apr 2016
Posts: 25

PostPosted: Sat Apr 02, 2016 12:11 pm    Post subject: Grub2/EFI & a 2010 Macbook Pro Reply with quote

I had Gentoo running working on a 2010 Macbook Pro up until a couple days ago when I decided I want to encrypt the harddrive. Now I can't for the life of me find whatever wiki/blog/whatever I used to manage to get the thing to boot. Gentoo is the only OS on this machine...so no dual boot. So please no "go download rEFIt responses".

I'm looking for the magic combination of: partition table/grub2-install args/grub2-mkconfig args to get the thing running again. Ideally with an encrypted harddrive, if anyone has suggestions as to when that should be introduced into the process.

I have only purple links via Google. :?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


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

PostPosted: Sat Apr 02, 2016 3:24 pm    Post subject: Re: Grub2/EFI & a 2010 Macbook Pro Reply with quote

datafatmunger wrote:
So please no "go download rEFIt responses".

datafatmunger ... go download rEFInd ;) ... unlike grub2 pseudo-firmware OS you don't need a degree in over-engineering to figure out how its ^n features work, or how to configure it (and no, its not 'rEFIt', nor does it require OSX or 'blessing' the HD from same).

datafatmunger wrote:
I'm looking for the magic combination of: partition table/grub2-install args/grub2-mkconfig args to get the thing running again. Ideally with an encrypted harddrive, if anyone has suggestions as to when that should be introduced into the process.

I have exactly this sort of setup on a macbook1,1 ... only without grub2.

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

/boot/efi/refind/refind.conf:
timeout 5
hideui banner
dont_scan_dirs efi/grub2

print -rl /boot/efi/linux/:
/boot/efi/linux/refind_linux.conf
/boot/efi/linux/vmlinuz-3.13.11-ck.efi

cat /boot/efi/linux/refind_linux.conf:
"Boot with standard options"  "quiet ro nopat threadirqs elevator=bfq video.use_native_backlight=1 rootfstype=ext4 luks enc_root=/dev/sda2 lvm root=/dev/mapper/vg-root swsusp resume=/dev/mapper/vg-swap"
"Boot to single-user mode"    "quiet ro nopat threadirqs elevator=bfq video.use_native_backlight=1 rootfstype=ext4 luks enc_root=/dev/sda2 lvm root=/dev/mapper/vg-root tuxonice resume=/dev/mapper/vg-swap single"

The initramfs is better-initramfs and I have it built into the kernel ... (build or download the prebuilt 64bit). Note: I have lvm2 volumes within the LUKS/dm-crypt container... if you don't then adjust the above kernel parameters to reflect 'root' and 'resume' (and obviously remove the 'lvm' parameter). If you want to hibernate via the in kernel uswsusp then replace 'tuxonice' with 'uswsusp'.

On boot you should be prompted for the password for the luks/dm-crypt volume, the initramfs should open the volume and then run lvm, resume from a hibernate image (if it exists), or perform a regular boot.

Thats really all there is to it ... and with better-initramfs you don't need to do anything with it on a kernel update (its self contained). When updating a kernel all I do is copy it to the ESP (which in the above is mounted as /boot), refind will then present it as a boot option (using the above kernel parameters in refind_linux.conf). Simple, and very little maintainance required.

EDIT: one other point: if you don't want to build the initramfs into the kernel (via CONFIG_INITRAMFS_SOURCE ... as /path/to/initramfs/sourceroot/ or *.cpio) then you would need to rename the initfamfs.cpio.gz to match the kernel name, see the refind docs for an explanation of how refind autodetects which initramfs to use for which kernel).

HTH & best ... khay
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