Difference between revisions of "MacBookPro9,2 (Mid-2012)"

From ArchWiki
Jump to: navigation, search
(15 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|MacBook}}
 
{{Article summary wiki|MacBook}}
{{Article summary wiki|MacBookPro}}
+
{{Article summary wiki|MacBook Pro 7,1}}
{{Article summary wiki|MacBook_Pro_7,1}}
+
{{Article summary wiki|MacBook Pro 8,1 / 8,2 / 8,3 (2011)}}
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}
+
{{Article summary wiki|MacBook Pro 9,2 (Mid-2012)}}
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}
+
 
{{Article summary end}}
 
{{Article summary end}}
  
This guide outlines a more recent situation of running Arch on Macbook 9,x (Mid-2012) hardware.  The original information written here dates from April 2013, installing kernel 3.8.  You'll need a wired connection to complete the initial steps of this installation.  For general help on the install preocedure see the [[Beginners' Guide]]
+
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating systemThis requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. 
  
For now I assume a dual-booted install alongside OSX. Please feel free to contribute information regarding other setups.
+
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.
  
==Preparation==
+
For general help on the install preocedure see the [[Beginners' Guide]]
  
{{Warning | Remember to back up your data using a utility such as Time Machine before beginning!}}
+
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}
 +
 
 +
==Preparation==
  
 
===Recording UIDs===
 
===Recording UIDs===
Line 26: Line 27:
  
 
===Install Boot Manager===
 
===Install Boot Manager===
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch.  This will place a boot menu on startup.  The config will be in your OSX partition - if this is not what you want simply install it later in Arch.  For more information consult [[UEFI]].
+
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch.  This will place a boot menu on startup.  The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch.  For more information consult [[UEFI]].
  
 
===Shrinking Macintosh HD===
 
===Shrinking Macintosh HD===
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility.  Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount.  Leave the new partition as free space.
+
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility.  Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount.  Leave the new partition as free space for now.
  
 
==Installation==
 
==Installation==
Line 42: Line 43:
  
 
====Sample partition layout====
 
====Sample partition layout====
 +
{{note|Apple prefers having 128MB of unallocated space between partitions.  Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.}}
 +
 
  partition  mountpoint  size      type  label
 
  partition  mountpoint  size      type  label
 
  /dev/sda1  /boot/efi  200MiB    vfat  EFI
 
  /dev/sda1  /boot/efi  200MiB    vfat  EFI
 
  /dev/sda2  -          ?          hfs+  Mac OS X
 
  /dev/sda2  -          ?          hfs+  Mac OS X
 
  /dev/sda3  -          ?          hfs+  Recovery
 
  /dev/sda3  -          ?          hfs+  Recovery
  /dev/sda4 -          100MiB    hfs+  Boot Arch Linux from the Apple boot loader (optional)
+
  /dev/sda4  /boot      100MiB    boot  boot
/dev/sda5 /boot      100MiB    boot  boot
+
  /dev/sda5 /          10GiB      ext4  root
  /dev/sda6  -          ?          swap  swap (optional)
+
  /dev/sda6 /home      remaining  ext4  home (optional)
/dev/sda7 /          10GiB      ext4  root
+
/dev/sda7  ?          ?          ?    shared (optional)
  /dev/sda8 /home      remaining  ext4  home
+
  
Single-boot setups can simply omit the OSX and Recovery partitions.
+
For sharing files between OSX and Linux, a number of filesystem options exist.  FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB.  Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux.  Full read-write support is available for unjournaled HFS+ filesystems.  ExFAT support can be made available by installing {{Pkg|fuse-exfat}} and {{Pkg|exfat-utils}}.
  
 
====Install Bootloader====
 
====Install Bootloader====
Line 70: Line 72:
  
 
==Post Installation==
 
==Post Installation==
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].
+
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:
  
 
===Users===
 
===Users===
Line 77: Line 79:
 
  # useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]
 
  # useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]
  
In order to be able to access a OSX user's directory, only id's need to match.
+
In order to be able to access a OSX user's directory, only the uid and gid need to match. (usernames can differ)
  
 
===Wireless===
 
===Wireless===
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi.  Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.
+
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi.  As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.
  
 +
====b43====
 
  $ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2
 
  $ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2
 
  $ tar xjf compat-drivers-2013-03-28-5.tar.bz2
 
  $ tar xjf compat-drivers-2013-03-28-5.tar.bz2
Line 90: Line 93:
 
  $ sudo make install
 
  $ sudo make install
  
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.
+
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.
  
Then, install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.
+
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.
  
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}
+
====wl====
 +
''more to come.''
 +
 
 +
Install {{Pkg|dkms}} from the offical repositories, then Install {{AUR|broadcom-wl-dkms}} from [[AUR]] and reboot.
  
 
===Xorg===
 
===Xorg===
 
Main Page: [[Xorg]]
 
Main Page: [[Xorg]]
  
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.
+
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.
  
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad.  More on this in the "Bells & Whistles" section.
+
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.
  
 
==Bells & Whistles==
 
==Bells & Whistles==
  
 
===Emulating OSX Touchpad Gestures===
 
===Emulating OSX Touchpad Gestures===
With a little bit of work it's possible to tweak the multitouch options on the track.
+
With a little bit of work it's possible to tweak the multitouch options on the trackpad.  This can be achieved with a combination of X11 driver settings and open source software.
  
 
====Using synclient====
 
====Using synclient====
{{ic|synclient}} is included with the xf86-input-synaptics driver.  It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session.  Many OSX options can be emulated without any additional software.
+
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver.  It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session.  Many OSX options can be emulated without any additional software.
  
Run {{ic|synclient -l}} to have a look at all the available options.  Here are some OSX-like suggestions:
+
Run {{ic|synclient -l}} to have a look at all the available options.  Here are some suggestions which resemble the options found in OSX's System Preferences:
  
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.
+
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|1=synclient TapAndDragGesture=0}} will turn this off.
 
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers.  set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.
 
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers.  set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.
 
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}.  If the last two options are not visible, set {{ic|1=Clickpad=1}}.
 
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}.  If the last two options are not visible, set {{ic|1=Clickpad=1}}.
Line 119: Line 125:
 
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.
 
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.
  
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver.  To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}
+
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver.  To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}
  
 
====Using Touchegg====
 
====Using Touchegg====
[code.google.com/projects/touchegg Touchegg] is an application that can recognize additional gestures.  To use this you'll need {{AUR|xf86-input-synaptics-mtpatch}}.
+
{{AUR|touchegg}} is an application that can recognize additional gestures.  To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.
 +
 
 +
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=
 +
...
 +
<application name="All">
 +
        ...
 +
        <gesture type="DRAG" fingers="3" direction="ALL">
 +
                <action type="DRAG_AND_DROP"></action>
 +
        </gesture>
 +
        ...
 +
</application>
 +
...
 +
}}

Revision as of 15:51, 19 September 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure.

This article is written with a dual-boot setup in mind, and does not cover how to replace OSX with Arch.

For general help on the install preocedure see the Beginners' Guide

Note: Remember to back up your pre-existing OSX installation before proceeding!

Preparation

Recording UIDs

If you want to access your OSX user directories from Linux, write down the UID and GID for the users.

Note: OSX begins with the first user's UID at 501 while Arch defaults to 1000.
Warning: Never, ever change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.

Install Boot Manager

Optional. The easiest way to begin is by installing rEFInd on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult UEFI.

Shrinking Macintosh HD

Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.

Installation

Preparing Installation Media

Download Arch and burn it to a USB, CD or DVD, and boot into the Arch install.

Running the Arch Installation

Proceed from the Installation section in either Beginners' Guide/Installation or Installation Guide#Installation. Note that you'll need a wired connection to continue for now.

The following differences will apply to MacBooks:

Sample partition layout

Note: Apple prefers having 128MB of unallocated space between partitions. Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.
partition  mountpoint  size       type  label
/dev/sda1  /boot/efi   200MiB     vfat  EFI
/dev/sda2  -           ?          hfs+  Mac OS X
/dev/sda3  -           ?          hfs+  Recovery
/dev/sda4  /boot       100MiB     boot  boot
/dev/sda5  /           10GiB      ext4  root
/dev/sda6  /home       remaining  ext4  home (optional)
/dev/sda7  ?           ?          ?     shared (optional)

For sharing files between OSX and Linux, a number of filesystem options exist. FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB. Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux. Full read-write support is available for unjournaled HFS+ filesystems. ExFAT support can be made available by installing fuse-exfat and exfat-utils.

Install Bootloader

Use GRUB2#UEFI_systems_2 for more information.

After setting up the base system, do the following in your chrooted environment:

# pacman -S grub-efi-x86_64

# mkdir -p /boot/efi
# mount -t vfat /dev/sda1 /boot/efi

# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo


Post Installation

Continue with Beginners' Guide/Post-installation or Installation Guide#Post-installation, noting the following modifications:

Users

If you wrote down your OSX uid's and gid's eariler, new users can be created by running:

# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]

In order to be able to access a OSX user's directory, only the uid and gid need to match. (usernames can differ)

Wireless

Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.

b43

$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2
$ cd compat-drivers-2013-03-28-5

$ scripts/driver-select b43
$ make
$ sudo make install

Create /etc/modules-load.d/b43.conf and write b43 to load wireless at startup.

Install b43-firmwareAUR from AUR and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.

wl

more to come.

Install dkms from the offical repositories, then Install broadcom-wl-dkmsAUR from AUR and reboot.

Xorg

Main Page: Xorg

Install xf86-video-intel and setup Xorg as you normally would.

The built-in keyboard and most usb input devices will work out-of-the-box, but xf86-input-synaptics is needed in order to use the built-in touchpad.

Bells & Whistles

Emulating OSX Touchpad Gestures

With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.

Using synclient

synclient is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.

Run synclient -l to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:

  • By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. synclient TapAndDragGesture=0 will turn this off.
  • TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set TapButton2=3 and ClickFinger2=3 to assign two-finger click to the right mouse button.
  • Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from RightEdge and BottomEdge and plugging the new values into RightButtonAreaLeft and RightButtonAreaTop. If the last two options are not visible, set Clickpad=1.

To make settings permanent, just modify /etc/X11/xorg.conf.d/10-synaptics.conf.

Note: Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file /usr/local/bin/synarea.sh with the required synclient commands, and add the script to the X startup sequence.

Using Touchegg

toucheggAUR is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with xf86-input-synaptics-mtpatchAUR.

$(HOME)/.config/touchegg/touchegg.conf
...
<application name="All">
        ...
        <gesture type="DRAG" fingers="3" direction="ALL">
                <action type="DRAG_AND_DROP"></action>
        </gesture>
        ...
</application>
...