Triple boot on MacBook Pro 6,2

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
MintJoe
Level 1
Level 1
Posts: 5
Joined: Sun Jan 03, 2016 11:21 am

Triple boot on MacBook Pro 6,2

Post by MintJoe » Sun Jan 03, 2016 8:46 pm

Just wanted to share my experience so far.

So far I had Mac Os X 10.10 and Windows 7 dual booting via bootcamp.

After booting off a 64bit Linux Mint 17.3 USB drive and seeing everything seemed to work fine out of the box (even wifi and BT!) I decided to give it a try. Most tutorials explain how to shrink partitions with diskutil and explain a lot of complicated stuff. I just launched gparted from the Live USB and shrinked my Win7 partition. I created a 4GB swap and a 30GB ext4 root partition.

After rebooting I went directly into Mint without having the option to choose my OS. When pressing the ALT key I was given the option to choose between OS X and Windows, albeit the Windows option was broken (bummer!).

After installing refind from Mac OS (not so hard, just followed the instructions from the refind homepage) I was finally able to choose from all 3 OS installed and all booted just fine (no alt key needed).

The first big problem I run into was a black screen after installing nvidia drivers. I was able to get into recovery, do the mount -o remount,rw / thing and after a sudo apt-get purge nvidia* I was able to get into Linux Mint again. I came across this thread http://forums.linuxmint.com/viewtopic.php?f=49&t=204982 but was not able to succeed.
I'm still reluctant to try setting up a hybrid mbr to be able to boot in CMS/BIOS mode, this seems to be as far as I could find out reading lots of forum postings the only reliable way to get the nvidia card to work well with Linux.

Next problem I run into was the F1, F2,... keys just working in combination with the fn key, how cumbersome! This thread is just what you need: https://help.ubuntu.com/community/AppleKeyboard
I'm still looking for a way to save the keyboard backlight settings on restart, they get turned off all the time. I've seen pommed, but it seems to be deprecated.

Another problem seems to be the missing right click key on the mousepad. On Windows it seems to work just fine, can not understand why Mint does not detect a right click pressing the bottom right corner of the pad. So far I configured it so that two fingers are a right click, but can not get used to it.

Next thing I'm going to try is to deactivate the nvidia card if I can not get it to run correctly, but I don't know which of both options is more complicated.

Bottom line, I've been messing around more time than actually using my computer. Not very amusing. :(

I will try to update this post with new information as I get along.


edit:
I was able to save my keyboard backlight settings by editing my /etc/rc.local file:

echo '99' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
## the values range from 1 to 255.
Last edited by MintJoe on Sun Jan 03, 2016 10:08 pm, edited 1 time in total.

cwsnyder
Level 6
Level 6
Posts: 1242
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: Triple boot on MacBook Pro 6,2

Post by cwsnyder » Sun Jan 03, 2016 9:33 pm

First, I believe you violated the forum rules by posting to a closed [Solved} thread.http://forums.linuxmint.com/viewtopic.php?f=49&t=204982

You are asked to open a new thread, not post to someone else's thread to ask a new question.

You don't have to set up a hybrid boot, but you do have to install Mint per instructions for an EFI boot process, that is, http://forums.linuxmint.com/viewtopic.php?t=163126. You may also want to read the Mint 17.2 Release notes: http://linuxmint.com/rel_rafaela_cinnamon.php
LMDE Mate 64-bit, LM17.3 Cinnamon 64-bit
Debian Mate 64-bit, Xubuntu xenial 64-bit, Ubuntu-Mate 14.04 64-bit, Antergos Xfce 64-bit, PCLinuxOS Mate 64-bit

MintJoe
Level 1
Level 1
Posts: 5
Joined: Sun Jan 03, 2016 11:21 am

Re: Triple boot on MacBook Pro 6,2

Post by MintJoe » Sun Jan 03, 2016 9:56 pm

cwsnyder wrote: You are asked to open a new thread, not post to someone else's thread to ask a new question.

You don't have to set up a hybrid boot, but you do have to install Mint per instructions for an EFI boot process, that is, http://forums.linuxmint.com/viewtopic.php?t=163126. You may also want to read the Mint 17.2 Release notes: http://linuxmint.com/rel_rafaela_cinnamon.php
The thread is not solved since the question I asked is not new but about the exact same matter as the original post. Discussing about the solution the original poster proposes is best done on the same thread. I apologize if things are treated different around here.

Thank you cwsnyder for the links, but EFI on a Mac is a whole different story. What people suggest for the nvidia bug is to boot via CMS and not using EFI. From what I understand I need to set a hybrid mbr first.
If I could sort out the matter with the setpci settings I'd rather go for that solution.

cwsnyder
Level 6
Level 6
Posts: 1242
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Re: Triple boot on MacBook Pro 6,2

Post by cwsnyder » Mon Jan 04, 2016 8:30 am

You should be able to install gdisk from the repositories on a boot of the Live DVD/thumb drive used to install Linux Mint and follow Gentoo's guide to creating a hybrid partition table: https://wiki.gentoo.org/wiki/Hybrid_partition_table

What I don't know is if this will allow booting either OS X or Windows.
LMDE Mate 64-bit, LM17.3 Cinnamon 64-bit
Debian Mate 64-bit, Xubuntu xenial 64-bit, Ubuntu-Mate 14.04 64-bit, Antergos Xfce 64-bit, PCLinuxOS Mate 64-bit

fabien85
Level 6
Level 6
Posts: 1395
Joined: Tue Mar 11, 2014 4:30 pm

Re: Triple boot on MacBook Pro 6,2

Post by fabien85 » Thu Jan 07, 2016 5:30 pm

I got the same problem with nvidia driver on my MacBook Pro 7,1
if you want to read the whole story, here it is : http://forums.linuxmint.com/viewtopic.php?f=46&t=208402 (I first thought I had a problem with system integrity protection)

For the MBP7,1, there is a solution to this problem. The problem is in fact that one of the PCI bus is not initialised correctly by the Apple firmware. You can correct this by putting a setpci command in grub.cfg, so that this is executed at boot before loading the linux kernel.
Specifically for me, I put the lines

Code: Select all

setpci -s "00:17.0" 3e.b=8
setpci -s "04:00.0" 04.b=7
in /etc/grub.d/40_custom
then updated grub. (this solution comes from : https://askubuntu.com/questions/264247/ ... 573#613573)
Then I launch grub from refind.
If you want this to work from refind without grub, it is possible and I found a solution detailed in the thread, but be warned this is a bit complex, you are going to need to learn about the EFI shell.

Anyway you need to adapt the line I gave above to your case (assuming this is also a pci problem for the MBP6,2 as for the MBP7,1). i.e. you need to find the appropriate bus. To do this, issue

Code: Select all

sudo lshw -businfo -class bridge -class display
(as in the thread you linked to). Note the bus for the nvidia card and for the pci express bridge to it.
Then for these buses you need to find what byte has to be set to what to get it activated. I dont know how to do that from Linux, you can drop to the EFI shell to find it. Assuming that it's the same bytes and buses as on my computer, you can check the buses are activated with

Code: Select all

$ sudo setpci -s "00:17.0" 3e.b
 $ sudo setpci -s "04:00.0" 04.b
which should respectively answer 8 (for the bridge) and 7 (for the graphic card). If any of these values are 0, then bingo that's what you want to repair by putting the appropriate line in /etc/grub.d/40_custom
If both values are non-zero, then it means the pci are correctly activated, so the problem is not coming from here, and you just wasted your time reading my answer.

MintJoe
Level 1
Level 1
Posts: 5
Joined: Sun Jan 03, 2016 11:21 am

Re: Triple boot on MacBook Pro 6,2

Post by MintJoe » Mon Nov 07, 2016 5:44 pm

So I decided to give this another try with the release of Sarah and it seems I was not lucky.

"sudo setpci -s "01:00.0" 04.b" outputs correctly "07", but I tried all bus addresses and get always 00 for "3e.b=8" (which sincerly I have no idea what it means, just copy pasting here).

If anyone can give me some advice, this is my lshw output:

Code: Select all

==============================================================
pci@0000:00:00.0                   bridge         Core Processor DRAM Controller
pci@0000:00:01.0                   bridge         Core Processor PCI Express x16 Root Port
pci@0000:01:00.0                   display        GT216M [GeForce GT 330M]
pci@0000:00:02.0                   display        Core Processor Integrated Graphics Controller
pci@0000:00:1c.0                   bridge         5 Series/3400 Series Chipset PCI Express Root Port 1
pci@0000:00:1c.1                   bridge         5 Series/3400 Series Chipset PCI Express Root Port 2
pci@0000:00:1c.2                   bridge         5 Series/3400 Series Chipset PCI Express Root Port 3
pci@0000:00:1c.3                   bridge         5 Series/3400 Series Chipset PCI Express Root Port 4
pci@0000:00:1e.0                   bridge         82801 Mobile PCI Bridge
pci@0000:00:1f.0                   bridge         HM55 Chipset LPC Interface Controller
pci@0000:ff:00.0                   bridge         Core Processor QuickPath Architecture Generic Non-core Registers
pci@0000:ff:00.1                   bridge         Core Processor QuickPath Architecture System Address Decoder
pci@0000:ff:02.0                   bridge         Core Processor QPI Link 0
pci@0000:ff:02.1                   bridge         1st Generation Core i3/5/7 Processor QPI Physical 0
pci@0000:ff:02.2                   bridge         1st Generation Core i3/5/7 Processor Reserved
pci@0000:ff:02.3                   bridge         1st Generation Core i3/5/7 Processor Reserved
Thanks!

fabien85
Level 6
Level 6
Posts: 1395
Joined: Tue Mar 11, 2014 4:30 pm

Re: Triple boot on MacBook Pro 6,2

Post by fabien85 » Tue Nov 08, 2016 7:08 am

Hi,
your hardware is sufficiently different from the MBP7,1 that I think the workaround that I linked to does not apply. I have to say I also applied it without really understanding all this stuff about PCI.
As far as I understood, in the MBP7,1 case, the bus corresponding to the bridge between the graphic card and something else (rest of motherboard? screen? I dont know) was not activated. So the workaround was to manually activate through grub before booting linux.

Now in your case, from your lshw output, the PCI of the nvidia card is at 01:00.0, so it seems it is activated correctly.
I dont identify a line corresponding to the bridge, in the case of the MBP7,1 it was

Code: Select all

pci@0000:00:17.0                  bridge      MCP89 PCI Express Bridge
So either you have to identify the proper bridge in your case, or the problem is completely different. Problem may be elsewhere.
Interestingly, ubuntu does not mention any issue with nvidia : https://help.ubuntu.com/community/MacBookPro6-2/Precise
but I think it's because they use the hybrid MBR method in their how-to for installation.
(though someone on the forums does seem to have a nvidia issue : https://ubuntuforums.org/showthread.php ... okPro6%2C2)

Do you use refind ? Because in one of the latest version, Roderick Smith added a setting ("spoof_osx_version") with the following description :
"A new feature, spoof_osx_version, causes rEFInd to tell a Mac that it's about to launch OS X. This alters how some Macs initialize hardware, which can make secondary video chipsets work on some Macs."
see rev 0.10.0, second bullet, in http://www.rodsbooks.com/refind/revisions.html
So if you use refind, try updating it to the latest version, then activate the feature by editing refind.conf and uncommenting the line

Code: Select all

#spoof_osx_version "10.9"
(btw you can try another OSX version for spoofing, though I dont think it will make any difference)

If you really want to dig into the PCI stuff, you will need to install an EFI shell (v1 in https://wiki.archlinux.org/index.php/Un ... UEFI_Shell, a shell v2 shouldnt work because its for EFI >2.3 and Mac is EFI 1.1). And this page could help you try to understand the PCI&EFI cryptics :
http://multiboot.info/wiki/index.php?ti ... and_Values
Though I dont know if this is really the problem for you or if it's something else.
Last edited by fabien85 on Wed Nov 09, 2016 9:00 am, edited 1 time in total.

MintJoe
Level 1
Level 1
Posts: 5
Joined: Sun Jan 03, 2016 11:21 am

Re: Triple boot on MacBook Pro 6,2

Post by MintJoe » Tue Nov 08, 2016 5:37 pm

I'm indeed using Roderick's refind, I will definitely give the spoof option a try, thanks!

I might first explore the PCI option, since you pointed me to the right direction with the link on how to install the EFI shell (I've been wondering how to get into the EFI shell ignoring that I had to install anything first).

Thank again, I hope to be able to post back soon.

fabien85
Level 6
Level 6
Posts: 1395
Joined: Tue Mar 11, 2014 4:30 pm

Re: Triple boot on MacBook Pro 6,2

Post by fabien85 » Wed Nov 09, 2016 6:47 am

Hi,
I would try first the spoof option, that's definitely the simplest thing to do : just download latest refind version, install it and uncomment a line.

By contrast, for the EFI shell you will need to install it, get it to run via refind, then learn the commands, and try to decipher the cryptics. That's a heavier task.
Some pointers though :
- I cant really remember how I installed the shell, but I think I just downloaded the efi executable and put it on the EFI System Partition, then refind automatically gave it an entry in the second row of its menu. I have it here :

Code: Select all

$ ls /boot/efi/EFI/tools/
shellx64.efi
What tools appear in the second row of refind, is governed by the option "showtools" in refind.conf. But the shell is there by default.
- references for shell commands :
https://software.intel.com/en-us/articles/uefi-shell/
https://github.com/tianocore/tianocore. ... umentation where you can download the full manual in pdf (link "Shell Command Reference Manual"). With full syntax and examples. Can be useful to print, except that it's 113 pages...
- I remember that on my MBP, when launching the shell it was by default at low graphical resolution, i.e. not occupying all of the screen. This can get annoying, especially when you have to examine long outputs. There is a command to change the resolution, though I cannot remember it at the moment. (will edit if I find it back)
- when a command gives an output longer than your screen, you normally can just see the end, and you are not able to scroll up. Luckily these commands have an option to display one screen at a time : -b. e.g.

Code: Select all

devices -b
to see the list of devices.
- good luck !

Edits:
- the EFI shell I installed is the Shell_Full.efi from EDKII of tianocore :
https://github.com/tianocore/edk2/tree/ ... lShell/X64
I think I had to rename it shellx64.efi for refind to detect it, or maybe I just did that for cosmetics. Cant remember either why I put it at ESP/EFI/tools and not elsewhere, maybe just to keep things organised, or maybe that's where refind expects to find it.
Tianocore (http://www.tianocore.org/) is like the official hub of core UEFI developments, as far as I understood.
- I remember that there is another shell v1 which supposedly works on Macs : that from refit. You can extract it (it's at efi/tools/shell.efi) from the refit tar.gz package that you can download at http://refit.sourceforge.net/. Though I cant remember if I tested this shell and whether it worked.

fabien85
Level 6
Level 6
Posts: 1395
Joined: Tue Mar 11, 2014 4:30 pm

Re: Triple boot on MacBook Pro 6,2

Post by fabien85 » Wed Nov 09, 2016 11:08 am

Hey again,
I dived back into the EFI shell to refresh my memory.
The command which can supposedly change the resolution on the screen is 'mode' (for details, do 'help mode' in the shell), though I couldnt get it to work this time.
In terms of identifying the problem, in my case I already knew the adress to the PCI bridge, it was 00:17:00. I could check this from the shell :

Code: Select all

$pci -i 00 17 00
(snip) ... (snip)
class : Bridge Device PCI/PCI bridge
(snip) ... (snip)
Bridge Control (3E)  0000
(snip) ... (snip)
(03) VGA Enable :         0
here we can see that the bit controlling the bridge is 3E, so memory adress 0017003E, and VGA is not enabled. VGA enable is at position 03, so to put it to 1, I have to put 0017003E at 2^3=8. From the shell I thus issue

Code: Select all

mm 0017003E -PCI 8
and then I can check it worked :

Code: Select all

$ pci -i 00 17 00
(snip) ... (snip)
Bridge Control (3E)  0008
(snip) ... (snip)
(03) VGA Enable :         1
then I type 'exit' to exit the shell, get back to refind, launch linux Mint .. and miracle! it worked, I'm now booted into Mint with nvidia drivers in use.
Then I can automate this by putting the line "setpci -s "00:17.0" 3e.b=8" in /etc/grub.d/40_custom and updating grub.

In your case, you have to first identify the PCI address of the bridge. It's not obvious from your lshw output. It might be 00:01:00 (just guessing here, because it's the bridge which is listed just before the graphic card). I'm not too sure how to identify it, but you will get more pointers by looking at the output of

Code: Select all

sudo lshw -class bridge
For example, among my output I have

Code: Select all

     *-pci:3
          description: PCI bridge
          produit: MCP89 PCI Express Bridge
          fabriquant: NVIDIA Corporation
          identifiant matériel: 17
          information bus: pci@0000:00:17.0
          version: a1
          bits: 32 bits
          horloge: 33MHz
          fonctionnalités: pci pm msi normal_decode bus_master cap_list
(my Mint is installed in french, not english, hence the language). I have 3 other PCI bridges in the output, also produced by Nvidia, but they are identical, while this one at 00:17:00 stands out alone.
Once you have identified the good bridge and its address, you can adapt the "pci -i" command I gave above so as to find what bit controls the 'VGA enable", and see whether that's already enabled or not. (maybe this can be done already from linux, but I'm ignorant). If it's already enabled, well I'm sorry I wasted your time, problem was not there. If it's disabled, adapt my "mm" command to enable it, exit to refind and see if you can now boot linux. (the change by "mm" will not persist to the next reboot, so you then have to automate this by including the line in grub).

Edit: you can find which bridge is connected to the VGA controller following the method from http://multiboot.info/wiki/index.php?ti ... and_Values.
Steps :
- find the VGA controller from the output of "pci -b".
Note that in fact you already know it from your lshw output : it's 01:00.0. So it's on bus 01. (but it doesnt hurt to confirm)
- from the page linked above "the first PCI bridge in a PCI listing would give you bus 01. The second PCI Bridge would give you bus 02, etc.".
So the bridge linked to your VGA controller should be the first one on the list of "pci -b". If the lshw is in the same order, that would confirm suspicion on

Code: Select all

pci@0000:00:01.0                   bridge         Core Processor PCI Express x16 Root Port
- you can check that this bridge is indeed connected to bus 01 :

Code: Select all

pci -i 00 01 00 -b
should give you at some point in the output (in the second page for me) :

Code: Select all

(Bus Numbers)  Primary(18)     Secondary(19)   Subordinate(1A)
              ------------------------------------------------------
              00               01               01
(I'm not sure about the secondary, but the primary is the important one)
meaning that 01:00.0 is connected to 00:01.00
- another way to check that 00:01.00 is indeed the bridge which has not been initialised properly, is that the output of "pci -i 00 01 00" will not have any PCIex dump at the end, while for other bridges that do have been initialised, you get a long and cryptic PCIex dump (at least on my computer).

Post Reply

Return to “Installation & Boot”