Difference between revisions of "MacBookPro11,x"

From ArchWiki
Jump to: navigation, search
(See Also: use sentence case per style guide)
m (Updated the timestamp on "what does not work" after making previous change here)
 
(130 intermediate revisions by 43 users not shown)
Line 1: Line 1:
 
[[Category:Apple]]
 
[[Category:Apple]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.}}
+
{{Related|Installation guide}}
{{Article summary heading|Related}}
+
{{Related|Beginners' guide}}
{{Article summary wiki|Official Arch Linux Install Guide}}
+
{{Related|General Recommendations}}
{{Article summary wiki|Beginners Guide}}
+
{{Related|MacBookPro10,x}}
{{Article summary wiki|General Recommendations}}
+
{{Related|MacBook}}
{{Article summary wiki|MacBookPro10,x}}
+
{{Related articles end}}
{{Article summary wiki|MacBook}}
+
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}
{{Article summary end}}
+
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).
  
 
== Preparing for the Installation ==
 
== Preparing for the Installation ==
 +
 
=== Preparing the hard drive ===
 
=== Preparing the hard drive ===
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.
+
 
 +
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition.  
 +
 
 +
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}
  
 
== Installation ==
 
== Installation ==
 +
 
=== Booting the live image ===
 
=== Booting the live image ===
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). When it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption.
 
  
=== Internet ===  
+
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}
+
 
 +
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.
 +
 
 +
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.
 +
 
 +
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[hardware video acceleration]].
 +
 
 +
=== Console ===
 +
 
 +
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;
 +
 
 +
$ setfont sun12x22
 +
 
 +
=== Internet ===
 +
 
 +
==== Wired ====
 +
 
 +
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically.
 +
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}
  
 
==== Wireless ====
 
==== Wireless ====
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:
+
 
  $ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz
+
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:
 +
  $ curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/broadcom-wl-dkms.tar.gz
 
  $ tar -zxvf broadcom-wl-dkms.tar.gz
 
  $ tar -zxvf broadcom-wl-dkms.tar.gz
 
  $ cd broadcom-wl-dkms
 
  $ cd broadcom-wl-dkms
 
  $ makepkg -s
 
  $ makepkg -s
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using
+
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:
 
  # pacman -U broadcom-wl-*.pkg.tar.xz
 
  # pacman -U broadcom-wl-*.pkg.tar.xz
 
  # modprobe wl
 
  # modprobe wl
during install.
+
You may now use {{ic|wifi-menu}} to connect to your network of choice.  
You may now use {{ic|wifi-menu}} to connect to your network of choice.
+
 
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}
+
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system ,
 +
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):
 +
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}
 +
 
 +
=== Bootloader ===
  
=== The installation ===
 
 
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}
 
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}
Run the installation wizard.
+
 
 
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}
 
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}
  
=== Bootloader ===
+
==== Using the MacBook's native EFI bootloader (recommended) ====
==== Using the MacBook's native EFI bootloader ====
+
 
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot.  
+
===== Method 1: creating an extra apple-format bootable partition with GRUB =====
 +
 
 +
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].
 
   
 
   
 
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}
 
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}
 +
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}
  
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.
+
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.
  
First, [[pacman|install]] the {{Pkg|grub}} package from the [[Official Repositories|official repositories]].
+
First, [[install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).
  
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:
+
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:
{{bc|
+
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"
<nowiki>
+
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"
+
</nowiki>
+
}}
+
  
 
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.
 
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.
Line 60: Line 85:
 
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}
 
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}
  
Now we generate the {{ic|boot.efi}} file:
+
Now we generate the {{ic|boot.efi}} file (in our current working directory):
 
  # grub-mkconfig -o /boot/grub/grub.cfg
 
  # grub-mkconfig -o /boot/grub/grub.cfg
 
  # grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg
 
  # grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg
Line 66: Line 91:
 
Put this file on a USB (or other OS X accessible media) and reboot into OS X.
 
Put this file on a USB (or other OS X accessible media) and reboot into OS X.
  
Launch {{ic|DiskUtility.app}} and erase the extra partition, mentioned above, to HFS+ and mount it.
+
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:
 +
$ mount -t hfs /dev/diskXsY <Path to root of extra partition>
 
  $ mkdir -p <Path to root of extra partition>/System/Library/CoreServices
 
  $ mkdir -p <Path to root of extra partition>/System/Library/CoreServices
  $ mkdir <Parth to root of extra partition>/mach_kernel
+
  $ touch <Path to root of extra partition>/mach_kernel
 +
 
 +
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.
  
 
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:
 
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:
Line 74: Line 102:
  
 
Edit that file to look like this:
 
Edit that file to look like this:
{{bc|
+
{{bc|1=<?xml version="1.0" encoding="utf-8"?>
<nowiki>
+
<xml version="1.0" encoding="utf-8"?>
+
 
<plist version="1.0">
 
<plist version="1.0">
 
<dict>
 
<dict>
Line 87: Line 113:
 
</dict>
 
</dict>
 
</plist>
 
</plist>
</nowiki>
 
 
}}
 
}}
  
The last step is then to bless the extra partition using:
+
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}
# bless --device disk0sX --setBoot
+
  
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:
+
The last step is then to bless (make bootable) the extra partition (as root):
  # diskutil list
+
  # bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot
 +
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot
  
{{Note|If you change kernel or need to modify the boot process, you will most likely need to re generate the boot.efi file. Simply replace the old boot.efi on the extra partition with the new one.}}
+
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}
 +
 
 +
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}
 +
 
 +
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:
 +
# grub-mkconfig -o /boot/grub/grub.cfg
 +
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition
 +
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg
 +
 
 +
===== Method 2: Using the default EFI System Partition with Grub =====
 +
{{Stub|Coming this weekend...}}
  
 
==== Direct EFI booting (rEFInd) ====
 
==== Direct EFI booting (rEFInd) ====
''See: [[UEFI_Bootloaders]]''
 
  
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.)
+
See: [[UEFI_Bootloaders]]
 +
 
 +
As of April 2016, rEFInd(0.10.2) can automatically detect the Arch kernel. So this is should be the easiest way. Simply install rEFInd. If you follow [[Beginners' guide]], you can simply skip [[Beginners' guide#Install_a_boot_loader]].
 +
 
 +
==== Direct EFI booting (gummiboot) ====
 +
 
 +
See [[Beginners' guide#For_UEFI_motherboards]]
  
 
==== GRUB (with OS X) ====
 
==== GRUB (with OS X) ====
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load Linux mainline instead of the normal one. You might want to append {{ic|nomodeset}} to the kernel line again, at least for now.
+
 
 +
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load Linux mainline instead of the normal one.
  
 
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}
 
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}
Line 114: Line 155:
 
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.
 
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.
  
To generate a nicer config use: {{ic|grub-mkconfig}}, (add in {{ic|nomodeset}} if you are using framebuffer), remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:
+
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:
 
  cd /
 
  cd /
 
  grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg
 
  grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg
 
  sudo mount /dev/sda1 /mnt
 
  sudo mount /dev/sda1 /mnt
 
  sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi
 
  sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi
 +
 +
{{note|You will need {{ic|hfsprogs}} to run the above commands}}
  
 
== Post installation ==
 
== Post installation ==
 +
 
=== Console ===
 
=== Console ===
 +
 
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}
 
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}
 
It is still tiny but is at least readable.
 
It is still tiny but is at least readable.
  
 
=== Graphics ===
 
=== Graphics ===
MacBook Pro 11,1
+
 
* Intel works fine
+
====== MacBook Pro 11,1 ======
MacBook Pro 11,2
+
 
* Intel works on Linux 3.13 and on Linux 3.12 with patch, see https://bugs.freedesktop.org/show_bug.cgi?id=71049
+
* Intel works on 3.12 with nomodeset
** Alternatively, use framebuffer, {{Pkg|xf86-video-fbdev}}.
+
* Intel works from 3.13.4-1-ARCH
MacBook Pro 11,3
+
 
 +
====== MacBook Pro 11,2 ======
 +
 
 +
* Intel works from 3.13.4-1-ARCH
 +
 
 +
====== MacBook Pro 11,3 ======
 +
 
 
* Nvidia works (both 319.60 and 331.17 drivers)
 
* Nvidia works (both 319.60 and 331.17 drivers)
 
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/
 
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/
 +
* Intel works after patching grub, see below
 +
 +
====== MacBook Pro 11,5 ======
 +
 +
* The {{Pkg|xf86-video-nouveau}} package seems to be stable. Switching to VTs and back works fine from MATE and GNOME. SOmetimes Chromium causes a "kernele rejected pixbuf" error which freezes the desktop.
 +
* The {{AUR|nvidia-dkms}} driver has been crashing a lot.
 +
* The {{Pkg|nvidia}} driver seems to be super stable, but GNOME desktop won't like to start, showing you a "Oh no! Something has gone wrong" message. Cinnamon Desktop is buttery smooth with the nvidia driver, and if you want your GNOME desktop, you can run `gnome-shell --relace &` while in cinnamon desktop to switch to Gnome Shell as a workaround.
 +
 +
 +
====== Microcode ======
 +
 +
You may need to install {{Pkg|intel-ucode}}, especially if you have Nvidia drivers. Read the wiki page to learn more about [[Microcode]].
 +
 +
====== HiDPI ======
  
 
See [[HiDPI]] for information on how to tweak the system for a Retina screen.
 
See [[HiDPI]] for information on how to tweak the system for a Retina screen.
 +
 +
====== Xfce ======
  
 
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.
 
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.
 +
 +
====== lightdm ======
 +
 +
If you are using lightdm on HiDPI/Retina screens you may experience a small login box
 +
, to use the native resolution of 2560x1600 on the login screen create a script
 +
 +
  #!/bin/sh
 +
  xrandr --output eDP1 --primary --mode 2560x1600
 +
 +
and set it as display-setup-script in /etc/lightdm/lightdm.conf
 +
 +
====== MATE ======
 +
 +
MATE's Marco seems to have problems. Replace it with GNOME's Mutter for nice animated effects. This works best with the nouveau driver.
 +
 +
# mutter --replace &&
 +
 +
Or configure MATE to use Mutter in dconf...
 +
 +
====== GNOME ======
 +
 +
It all works great out of the box with the nouveau driver.
 +
 +
==== Getting the integrated intel card to work on 11,3 ====
 +
 +
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:
 +
 +
$ packer -G grub-git
 +
$ cd grub-git
 +
 +
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html
 +
 +
Put the patch contents into a file labeled something like "apple.patch"
 +
 +
Add this patch to your PKGBUILD and run:
 +
 +
$ makepkg -si
 +
 +
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.
 +
 +
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.
 +
 +
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.
 +
 +
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.
 +
 +
==== Alternative method to disable NVIDIA card ====
 +
 +
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).
 +
 +
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.
 +
 +
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.
 +
 +
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.
 +
 +
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.
 +
 +
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].
 +
 +
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.
 +
 +
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:
 +
 +
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code>
 +
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code>
 +
 +
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.
 +
 +
To see if you dedicated GPU is actually disabled, run:
 +
 +
<code>
 +
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
 +
</code>
 +
 +
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.
  
 
=== Sound ===
 
=== Sound ===
 +
 
* Headphones work
 
* Headphones work
 
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch
 
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch
Line 153: Line 297:
  
 
=== Touchpad ===
 
=== Touchpad ===
 +
 
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:
 
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:
 
  Section "InputClass"
 
  Section "InputClass"
Line 169: Line 314:
 
     Option "VertScrollDelta" "-100"
 
     Option "VertScrollDelta" "-100"
 
     Option "HorizScrollDelta" "-100"
 
     Option "HorizScrollDelta" "-100"
 +
EndSection
 +
 +
==== Ctrl-Click as Right-Click ====
 +
 +
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.
 +
 +
==== input-mtrack ====
 +
 +
Another method is to use {{AUR|xf86-input-mtrack-git}}. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.
 +
 +
With this config the touchpad behavior becomes more osx-like.
 +
 +
/etc/X11/xorg.conf.d/00-touchpad.conf
 +
 +
Section "InputClass"
 +
    MatchIsTouchpad "on"
 +
    Identifier      "Touchpads"
 +
    Driver          "mtrack"
 +
    Option          "Sensitivity" "0.64"
 +
    Option          "FingerHigh" "5"
 +
    Option          "FingerLow" "1"
 +
    Option          "IgnoreThumb" "true"
 +
    Option          "IgnorePalm" "true"
 +
    Option          "DisableOnPalm" "true"
 +
    Option          "TapButton1" "1"
 +
    Option          "TapButton2" "3"
 +
    Option          "TapButton3" "2"
 +
    Option          "TapButton4" "0"
 +
    Option          "ClickFinger1" "1"
 +
    Option          "ClickFinger2" "2"
 +
    Option          "ClickFinger3" "3"
 +
    Option          "ButtonMoveEmulate" "false"
 +
    Option          "ButtonIntegrated" "true"
 +
    Option          "ClickTime" "25"
 +
    Option          "BottomEdge" "30"
 +
    Option          "SwipeLeftButton" "8"
 +
    Option          "SwipeRightButton" "9"
 +
    Option          "SwipeUpButton" "0"
 +
    Option          "SwipeDownButton" "0"
 +
    Option          "ScrollDistance" "75"
 +
    Option          "VertScrollDelta" "-111"
 +
    Option          "HorizScrollDelta" "-111"
 
  EndSection
 
  EndSection
  
 
=== Keyboard backlight ===
 
=== Keyboard backlight ===
 +
 
* Works, see [[MacBook#Keyboard_Backlight]]
 
* Works, see [[MacBook#Keyboard_Backlight]]
 +
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)
 +
[Unit]
 +
Requires=upower.service
 +
After=upower.service
  
 
=== Screen backlight ===
 
=== Screen backlight ===
 +
 
* Intel, works on Linux 3.13
 
* Intel, works on Linux 3.13
 
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.
 
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.
* Nvidia, does not work
+
* Brightness in {{ic|/sys/class/backlight/gmux_backlight/brightness}} can be modified comfortably via the {{AUR|gmux_backlight}} utility without root privileges. Requires the {{ic|setpci}} setting below.
 +
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.
 +
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}
  
 
=== Suspend ===
 
=== Suspend ===
* Works on MacBook Pro 11,2 with Linux 3.13
+
 
 +
* Works from Linux 3.13
 +
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.
 
* No backlight after suspend with Linux 3.12
 
* No backlight after suspend with Linux 3.12
 
** Use hibernate instead
 
** Use hibernate instead
 +
 +
=== Powersave ===
 +
 +
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:
 +
 +
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=
 +
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"
 +
}}
 +
 +
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=
 +
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"
 +
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"
 +
}}
 +
 +
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.
 +
 +
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.
 +
 +
=== SD Card Reader ===
 +
 +
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:
 +
  # Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend
 +
  options xhci_hcd quirks=0x80
 +
 +
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.
 +
 +
=== Repurpose the power key ===
 +
 +
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting
 +
    HandlePowerKey=ignore
 +
systemd ignores power key events.
 +
 +
Now the power key can be repurposed as keycode 124. For example in i3 conf:
 +
    bindcode 124 ...
 +
 +
=== Web cam ===
 +
 +
A reverse engineered driver is being developed here: https://github.com/patjak/bcwc_pcie/ . It is marked experimental, but basic functionality seems to be working. Install {{AUR|bcwc-pcie-dkms}} or {{AUR|bcwc-pcie-git}}.
  
 
== What does not work ==
 
== What does not work ==
Updated 2013-12-07
+
 
 +
Updated 2016-07-21
  
 
=== General ===
 
=== General ===
  
 
=== Wi-Fi ===
 
=== Wi-Fi ===
* {{AUR|broadcom-wl}} from the [[AUR]] works
 
** Stability is an issue for some
 
  
=== Web cam ===
+
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.
+
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)
* In OS X, the camera is listed as FaceTime HD camera 1570.
+
 
* No known Linux driver.
+
=== Backlight keys / Suspend support ===
 +
{{AUR|linux-macbook}} is an AUR package created specifically for MacBook laptops that includes patches for these issues, as well fixing powering off correctly and CPU frequency scaling with the intel_pstate driver.
  
 
== Discussions ==
 
== Discussions ==
 +
 
* https://bbs.archlinux.org/viewtopic.php?id=171883
 
* https://bbs.archlinux.org/viewtopic.php?id=171883
  
 
== See also ==
 
== See also ==
 +
 
* [[MacBookPro10,x]]
 
* [[MacBookPro10,x]]
 
* [[MacBook]]
 
* [[MacBook]]

Latest revision as of 19:17, 21 July 2016

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: This page flat-out ignores every possible style rule (Discuss in Talk:MacBookPro11,x#)

This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).

Preparing for the Installation

Preparing the hard drive

Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition.

Note: Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize

Installation

Booting the live image

To begin your installation, download the current Archboot ISO and write it to your USB drive according to the USB flash installation media instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding Alt on power on.

rEFIt and REFInd depending on how they are configured can also allow you to boot from the media.

If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing Tab to edit the entry and append nomodeset this will prevent visible screen corruption.

If the install media you are using has a kernel version later than 3.13 do not use nomodeset as it is not needed and will break hardware video acceleration.

Console

As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;

$ setfont sun12x22

Internet

Wired

Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically.

Note: You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.

Wireless

As mentioned below, broadcom-wl is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use broadcom-wl-dkms. Both are available from the AUR. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error (ERROR: could not insert 'wl': Invalid argument) upon modprobe. Build the package as follows:

$ curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/broadcom-wl-dkms.tar.gz
$ tar -zxvf broadcom-wl-dkms.tar.gz
$ cd broadcom-wl-dkms
$ makepkg -s

This will give you a package (broadcom-wl-*.pkg.tar.xz) which can be installed using pacman. Put this package on a USB drive, mount it, and install the package using:

# pacman -U broadcom-wl-*.pkg.tar.xz
# modprobe wl

You may now use wifi-menu to connect to your network of choice.

Note: You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system ,

these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):

dkms,wpa_supplicant, dhcpcd (dialog and netctl are needed if you want to use wifi-menu again after you boot)

Bootloader

Note: Refer to the MacBook page if you do not want to have a separate partition for GRUB but rather prefer to use rEFInd (or rEFIt).
Tip: If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.

Using the MacBook's native EFI bootloader (recommended)

Method 1: creating an extra apple-format bootable partition with GRUB

This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see GRUB EFI Examples#Apple Mac EFI systems.

Note: For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.
Note: It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.

At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a boot.efi file on an extra partition used by the MacBook's native bootloader.

First, install the grub package from the official repositories. Make sure to follow the steps for setting up grub on a partition using the grub-install and grub-mkconfig commands, like normal. We will use the config file that grub-mkconfig creates to generate a standalone boot.efi file using the grub-mkstandalone command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).

When generating a grub config file, GRUB looks to /etc/default/grub for its configuration. Edit the parameter GRUB_CMDLINE_LINUX_DEFAULT to look something like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"

The libata.force=noncq parameter will prevent SSD lockups and the rootflags option is used for SSD-performance.

Note: Do not use the rootflags option on Btrfs. It is not supported.

Now we generate the boot.efi file (in our current working directory):

# grub-mkconfig -o /boot/grub/grub.cfg
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg

Put this file on a USB (or other OS X accessible media) and reboot into OS X.

Launch DiskUtility.app and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:

$ mount -t hfs /dev/diskXsY <Path to root of extra partition>
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices
$ touch <Path to root of extra partition>/mach_kernel

where diskXsy is the disk your partition is on (e.g. disk0s1). You can use diskutil list to list your disks and partitions.

Copy the boot.efi file to the <Path to extra partition>/System/Library/CoreServices/ directory. Using your editor of choice, create a SystemVersion.plist file in the CoreServices directory, which is located here:

<path to extra partition>/System/Library/CoreServices/SystemVersion.plist

Edit that file to look like this:

<?xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string></string>
    <key>ProductName</key>
    <string>Linux</string>
    <key>ProductVersion</key>
    <string>Arch Linux</string>
</dict>
</plist>
Note: It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.

The last step is then to bless (make bootable) the extra partition (as root):

# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot
Note: It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.
Note: In order to change grub settings both grub.cfg and boot.efi will have to be generated. This can be done from in Linux, without booting OS X.

Generate grub.cfg and boot.efi from Arch Linux:

# grub-mkconfig -o /boot/grub/grub.cfg
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg
Method 2: Using the default EFI System Partition with Grub

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: Coming this weekend... (Discuss in Talk:MacBookPro11,x#)

Direct EFI booting (rEFInd)

See: UEFI_Bootloaders

As of April 2016, rEFInd(0.10.2) can automatically detect the Arch kernel. So this is should be the easiest way. Simply install rEFInd. If you follow Beginners' guide, you can simply skip Beginners' guide#Install_a_boot_loader.

Direct EFI booting (gummiboot)

See Beginners' guide#For_UEFI_motherboards

GRUB (with OS X)

Another solution is to install GRUB. Edit /tmp/install/boot/grub/grub.cfg and edit the boot entry to load Linux mainline instead of the normal one.

Note: libata.force=noncq helps with hangs due to SSD speed.

Now cd into /tmp/install/ and create the GRUB image by running:

grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg

This will create file called boot64.efi which contains GRUB and the configuration file incorporated inside. It is important to cd into the right directory to make it pick up the configuration file and put it into the right place within the image.

Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the Alt button pressed. It should appear as EFI boot.

To generate a nicer config use: grub-mkconfig, remove quiet if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:

cd /
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg
sudo mount /dev/sda1 /mnt
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi
Note: You will need hfsprogs to run the above commands

Post installation

Console

Largest console font (although ugly) achieved by adding FONT=sun12x22 to /etc/vconsole.conf It is still tiny but is at least readable.

Graphics

MacBook Pro 11,1
  • Intel works on 3.12 with nomodeset
  • Intel works from 3.13.4-1-ARCH
MacBook Pro 11,2
  • Intel works from 3.13.4-1-ARCH
MacBook Pro 11,3
MacBook Pro 11,5
  • The xf86-video-nouveau package seems to be stable. Switching to VTs and back works fine from MATE and GNOME. SOmetimes Chromium causes a "kernele rejected pixbuf" error which freezes the desktop.
  • The nvidia-dkmsAUR driver has been crashing a lot.
  • The nvidia driver seems to be super stable, but GNOME desktop won't like to start, showing you a "Oh no! Something has gone wrong" message. Cinnamon Desktop is buttery smooth with the nvidia driver, and if you want your GNOME desktop, you can run `gnome-shell --relace &` while in cinnamon desktop to switch to Gnome Shell as a workaround.


Microcode

You may need to install intel-ucode, especially if you have Nvidia drivers. Read the wiki page to learn more about Microcode.

HiDPI

See HiDPI for information on how to tweak the system for a Retina screen.

Xfce

If you are using Xfce, you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like compton with backend = "glx".

lightdm

If you are using lightdm on HiDPI/Retina screens you may experience a small login box , to use the native resolution of 2560x1600 on the login screen create a script

  #!/bin/sh
  xrandr --output eDP1 --primary --mode 2560x1600

and set it as display-setup-script in /etc/lightdm/lightdm.conf

MATE

MATE's Marco seems to have problems. Replace it with GNOME's Mutter for nice animated effects. This works best with the nouveau driver.

# mutter --replace &&

Or configure MATE to use Mutter in dconf...

GNOME

It all works great out of the box with the nouveau driver.

Getting the integrated intel card to work on 11,3

By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the grub-gitAUR package from the AUR. Using something like:

$ packer -G grub-git
$ cd grub-git

Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html

Put the patch contents into a file labeled something like "apple.patch"

Add this patch to your PKGBUILD and run:

$ makepkg -si

Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.

Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.

You should now be able to install xf86-video-intel and get your card running.

Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.

Alternative method to disable NVIDIA card

While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).

First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.

Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.

Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run gpu-switch -i as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run gpu-switch -d as sudo. You must have booted with the aforementioned patch for this to work.

Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.

To do that, please refer to the following article, MacBookPro10,x#Graphics_2.

You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.

I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:

@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch @reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch

I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.

To see if you dedicated GPU is actually disabled, run:

sudo cat /sys/kernel/debug/vgaswitcheroo/switch

NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.

Sound

If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.

Volume keys can be made to work with xfce4-volumed (if you are using Xfce).

Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install pavucontrol and set Analog Stereo as the fallback device.

Touchpad

One method is to install xf86-input-synaptics and configure to your liking in /etc/X11/xorg.conf.d/50-synaptics.conf:

Section "InputClass"
    MatchIsTouchpad "on"
    Identifier      "touchpad catchall"
    Driver          "synaptics"
    # 1 = left, 2 = right, 3 = middle
    Option          "TapButton1" "1"  
    Option          "TapButton2" "3"
    Option          "TapButton3" "2"
    # Palm detection
    Option          "PalmDetect" "1"
    # Horizontal scrolling
    Option "HorizTwoFingerScroll" "1"
    # Natural Scrolling (and speed)
    Option "VertScrollDelta" "-100"
    Option "HorizScrollDelta" "-100"
EndSection

Ctrl-Click as Right-Click

Using this SuperUser receipt [1] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.

input-mtrack

Another method is to use xf86-input-mtrack-gitAUR. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.

With this config the touchpad behavior becomes more osx-like.

/etc/X11/xorg.conf.d/00-touchpad.conf
Section "InputClass"
    MatchIsTouchpad "on"
    Identifier      "Touchpads"
    Driver          "mtrack"
    Option          "Sensitivity" "0.64"
    Option          "FingerHigh" "5"
    Option          "FingerLow" "1"
    Option          "IgnoreThumb" "true"
    Option          "IgnorePalm" "true"
    Option          "DisableOnPalm" "true"
    Option          "TapButton1" "1"
    Option          "TapButton2" "3"
    Option          "TapButton3" "2"
    Option          "TapButton4" "0"
    Option          "ClickFinger1" "1"
    Option          "ClickFinger2" "2"
    Option          "ClickFinger3" "3"
    Option          "ButtonMoveEmulate" "false"
    Option          "ButtonIntegrated" "true"
    Option          "ClickTime" "25"
    Option          "BottomEdge" "30"
    Option          "SwipeLeftButton" "8"
    Option          "SwipeRightButton" "9"
    Option          "SwipeUpButton" "0"
    Option          "SwipeDownButton" "0"
    Option          "ScrollDistance" "75"
    Option          "VertScrollDelta" "-111"
    Option          "HorizScrollDelta" "-111"
EndSection

Keyboard backlight

  • Works, see MacBook#Keyboard_Backlight
  • On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file /etc/systemd/system/kdm.service.d/kbd_backlight.conf with this content (you might need to create the directory as well)
[Unit]
Requires=upower.service
After=upower.service

Screen backlight

  • Intel, works on Linux 3.13
  • Framebuffer, works for MacBook Pro 11,1 and 11,3 via /sys/class/backlight/gmux_backlight/brightness.
  • Brightness in /sys/class/backlight/gmux_backlight/brightness can be modified comfortably via the gmux_backlightAUR utility without root privileges. Requires the setpci setting below.
  • Nvidia, does not work using default settings. Try adding setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0 to /etc/rc.local.
Note: If the screen does not show the prompt or the login manager (i.e. a black screen), append i915.invert_brightness=1 to the kernel.

Suspend

  • Works from Linux 3.13
    • It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.
  • No backlight after suspend with Linux 3.12
    • Use hibernate instead

Powersave

Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following udev rules:

/etc/udev/rules.d/99-apple_cardreader.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"
/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"

As udev's OPTIONS=="ignore_device" may not work reliably, the above rules use a script to manually remove the usb device from /sys/bus/usb/devices/.

If battery life is not satisfactory, it may help to use power saving utilities, such as tlp, and/or powertop from the official repositories. To better optimize battery life, TLP also has a configuration file located at /etc/default/tlp that you can edit to suit your machine. For more information, visit the wiki pages for these tools, TLP and Powertop, respectively.

SD Card Reader

  • Disappears sporadically after suspend as of Linux 3.18. Workaround is to create /etc/modprobe.d/xhci-reset-on-suspend.conf with:
  # Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend 
  options xhci_hcd quirks=0x80

Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix may not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.

Repurpose the power key

By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting

   HandlePowerKey=ignore

systemd ignores power key events.

Now the power key can be repurposed as keycode 124. For example in i3 conf:

   bindcode 124 ...

Web cam

A reverse engineered driver is being developed here: https://github.com/patjak/bcwc_pcie/ . It is marked experimental, but basic functionality seems to be working. Install bcwc-pcie-dkmsAUR or bcwc-pcie-gitAUR.

What does not work

Updated 2016-07-21

General

Wi-Fi

Backlight keys / Suspend support

linux-macbookAUR is an AUR package created specifically for MacBook laptops that includes patches for these issues, as well fixing powering off correctly and CPU frequency scaling with the intel_pstate driver.

Discussions

See also