https://wiki.archlinux.org/api.php?action=feedcontributions&user=Kousu&feedformat=atomArchWiki - User contributions [en]2024-03-19T10:38:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Iwd&diff=798008Iwd2024-01-23T20:10:30Z<p>Kousu: s/auth/auth/</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[ja:Iwd]]<br />
[[pt:Iwd]]<br />
[[ru:Iwd]]<br />
[[zh-hans:Iwd]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|wpa_supplicant}}<br />
{{Related articles end}}<br />
[https://iwd.wiki.kernel.org/ iwd] (iNet wireless daemon) is a wireless daemon for Linux written by Intel. The core goal of the project is to optimize resource utilization by not depending on any external libraries and instead utilizing features provided by the Linux Kernel to the maximum extent possible.<br />
<br />
iwd can work in standalone mode or in combination with comprehensive network managers like [[ConnMan]], [[systemd-networkd]] and [[NetworkManager#Using iwd as the Wi-Fi backend|NetworkManager]].<br />
<br />
{{Note|Do not follow the instructions on this page when using iwd via a [[network manager]] unless it is explicitly stated otherwise in that network manager's article.}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|iwd}} package.<br />
<br />
== Usage ==<br />
<br />
The {{Pkg|iwd}} package provides the client program {{ic|iwctl}}, the daemon {{ic|iwd}} and the Wi-Fi monitoring tool {{ic|iwmon}}.<br />
<br />
{{Aur|iwgtk}} provides a GUI front-end for iwd and an indicator (tray) icon.<br />
<br />
[[Start/enable]] {{ic|iwd.service}} so it can be controlled through the {{ic|iwctl}} command or through {{ic|iwgtk}}.<br />
<br />
{{Note|Only root and members of the {{ic|netdev}} or the {{ic|wheel}} [[user group]] are allowed to interact with ''iwd''. In order to use ''iwctl'' or ''iwgtk'', you need to [[Users and groups#Group management|add your user to one of those groups]].}}<br />
<br />
=== iwctl ===<br />
<br />
To get an interactive prompt do:<br />
<br />
$ iwctl<br />
<br />
The interactive prompt is then displayed with a prefix of {{ic|[iwd]#}}.<br />
<br />
{{Tip|<br />
* In the {{ic|iwctl}} prompt you can auto-complete commands and device names by hitting {{ic|Tab}}.<br />
* To exit the interactive prompt, send [[Wikipedia:EOF character|EOF]] by pressing {{ic|Ctrl+d}}.<br />
* You can use all commands as command line arguments without entering an interactive prompt. For example: {{ic|iwctl device wlan0 show}}.<br />
}}<br />
<br />
To list all available commands:<br />
<br />
[iwd]# help<br />
<br />
==== Connect to a network ====<br />
<br />
First, if you do not know your wireless device name, list all Wi-Fi devices:<br />
<br />
[iwd]# device list<br />
<br />
If the device or its corresponding adapter is turned off, turn it on:<br />
<br />
[iwd]# device ''device'' set-property Powered on<br />
<br />
[iwd]# adapter ''adapter'' set-property Powered on<br />
<br />
Then, to initiate a scan for networks (note that this command will not output anything):<br />
<br />
[iwd]# station ''device'' scan<br />
<br />
You can then list all available networks:<br />
<br />
[iwd]# station ''device'' get-networks<br />
<br />
Finally, to connect to a network:<br />
<br />
[iwd]# station ''device'' connect ''SSID''<br />
<br />
{{Note|For automatic IP and DNS configuration via DHCP, you have to [[#Enable built-in network configuration|manually enable]] the built-in DHCP client or configure a [[Network configuration#Network managers|standalone DHCP client]].}}<br />
{{Tip|The user interface supports autocomplete, by typing {{ic|station }} and {{ic|Tab}} {{ic|Tab}}, the available devices are displayed, type the first letters of the device and {{ic|Tab}} to complete. The same way, type {{ic|connect }} and {{ic|Tab}} {{ic|Tab}} in order to have the list of available networks displayed. Then, type the first letters of the chosen network followed by {{ic|Tab}} in order to complete the command.}} <br />
<br />
If a passphrase is required (and it is not already stored in one of the profiles that iwd automatically checks), you will be prompted to enter it. Alternatively, you can supply it as a command line argument:<br />
<br />
$ iwctl --passphrase ''passphrase'' station ''device'' connect ''SSID''<br />
<br />
{{Note|<br />
* {{ic|iwd}} automatically stores network passphrases in the {{ic|/var/lib/iwd}} directory and uses them to auto-connect in the future. See [[#Network configuration]].<br />
* To connect to a network with spaces in the SSID, the network name should be double quoted when connecting.<br />
* iwd only supports PSK pass-phrases from 8 to 63 ASCII-encoded characters. The following error message will be given if the requirements are not met: {{ic|PMK generation failed. Ensure Crypto Engine is properly configured}}.<br />
}}<br />
<br />
==== Connect to a network using WPS/WSC ====<br />
<br />
If your network is configured such that you can connect to it by pressing a button ([[Wikipedia:Wi-Fi Protected Setup]]), check first that your network device is also capable of using this setup procedure.<br />
<br />
[iwd]# wsc list<br />
<br />
Then, provided that your device appeared in the above list,<br />
<br />
[iwd]# wsc ''device'' push-button<br />
<br />
and push the button on your router. The procedure works also if the button was pushed beforehand, less than 2 minutes earlier.<br />
<br />
If your network requires to validate a PIN number to connect that way, check the {{ic|help}} command output to see how to provide the right options to the {{ic|wsc}} command.<br />
<br />
==== Disconnect from a network ====<br />
<br />
To disconnect from a network:<br />
<br />
[iwd]# station ''device'' disconnect<br />
<br />
==== Show device and connection information ====<br />
<br />
To display the details of a WiFi device, like MAC address:<br />
<br />
[iwd]# device ''device'' show<br />
<br />
To display the connection state, including the connected network of a Wi-Fi device:<br />
<br />
[iwd]# station ''device'' show<br />
<br />
==== Manage known networks ====<br />
<br />
To list networks you have connected to previously:<br />
<br />
[iwd]# known-networks list<br />
<br />
To forget a known network:<br />
<br />
[iwd]# known-networks ''SSID'' forget<br />
<br />
=== iwgtk ===<br />
<br />
Alternatively, {{Aur|iwgtk}} provides a GUI front-end through which iwd can be controlled.<br />
<br />
Running {{ic|iwgtk}} without any arguments launches the application window, which can be used to toggle your adapters and devices on/off, change their operating modes, view available networks, connect to available networks, and manage known networks.<br />
<br />
==== Indicator icon ====<br />
<br />
To launch iwgtk's indicator (tray) icon daemon, run:<br />
<br />
$ iwgtk -i<br />
<br />
If the indicator icon does not appear, then your system tray most likely lacks support for the StatusNotifierItem API, in which case you need to run a compatibility layer such as {{Aur|snixembed-git}}.<br />
<br />
The following system trays support StatusNotifierItem, and therefore work out of the box:<br />
<br />
* KDE Plasma<br />
* swaybar<br />
* xfce4-panel<br />
<br />
The following trays only support XEmbed, and therefore require {{Aur|snixembed-git}}:<br />
<br />
* AwesomeWM<br />
* i3bar<br />
<br />
==== Autostart ====<br />
<br />
The most common use case for iwgtk is to start the indicator daemon every time you log into your desktop. If your desktop environment supports the [[XDG Autostart]] standard, this should happen automatically due to the {{ic|iwgtk-indicator.desktop}} file which is placed in {{ic|/etc/xdg/autostart/}} by the AUR package.<br />
<br />
Alternatively, a systemd unit file to start the indicator daemon is provided by the AUR package. If your desktop environment supports systemd's {{ic|graphical-session.target}} unit, then iwgtk can be autostarted via systemd by [[enabling]] the {{ic|iwgtk.service}} [[user unit]].<br />
<br />
== Network configuration ==<br />
<br />
By default, ''iwd'' stores the network configuration in the directory {{ic|/var/lib/iwd}}. The configuration file is named as {{ic|''network''.''type''}}, where ''network'' is the network SSID and ''.type'' is the network type, either ''.open'', ''.psk'' or ''.8021x''. The file is used to store the encrypted {{ic|PreSharedKey}} and optionally the cleartext {{ic|Passphrase}} and can also be created by the user without invoking {{ic|iwctl}}. The file can be used for other configuration pertaining to that network SSID as well. For more settings, see {{man|5|iwd.network}}.<br />
<br />
{{Note|In string values, including identities and passwords, certain characters may be backslash-escaped. Leading spaces, \n, \r, and literal backslashes must be escaped. See {{man|5|iwd.network}}.}}<br />
<br />
=== WPA-PSK ===<br />
<br />
A minimal example file to connect to a WPA-PSK or WPA2-PSK secured network with SSID "spaceship" and passphrase "test1234":<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
PreSharedKey=aafb192ce2da24d8c7805c956136f45dd612103f086034c402ed266355297295}}<br />
<br />
{{Note|The SSID of the network is used as a filename only when it contains only alphanumeric characters or one of {{ic|- _}}. If it contains any other characters, the name will instead be an {{ic|1==}}-character followed by the hex-encoded version of the SSID.}}<br />
<br />
To calculate the pre-shared key from the passphrase, one of these two methods can be used:<br />
<br />
* Enter the passphrase in cleartext in the configuration file:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
Passphrase=test1234}}<br />
<br />
:The pre-shared key will be appended to the file at the first connect:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
Passphrase=test1234<br />
PreSharedKey=aafb192ce2da24d8c7805c956136f45dd612103f086034c402ed266355297295}}<br />
<br />
* Or the pre-shared key can be calculated from the SSID and the passphrase using ''wpa_passphrase'' (from {{Pkg|wpa_supplicant}}) or {{AUR|wpa-psk}}. See [[wpa_supplicant#Connecting with wpa_passphrase]] for more details.<br />
<br />
=== WPA Enterprise ===<br />
<br />
==== EAP-PWD ====<br />
<br />
For connecting to a EAP-PWD protected enterprise access point you need to create a file called: {{ic|''essid''.8021x}} in the {{ic|/var/lib/iwd}} directory with the following content:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=PWD<br />
EAP-Identity=''your_enterprise_email''<br />
EAP-Password=''your_password''<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
If you do not want autoconnect to the AP you can set the option to False and connect manually to the access point via {{ic|iwctl}}. The same applies to the password, if you do not want to store it plaintext leave the option out of the file and just connect to the enterprise AP.<br />
<br />
{{Note|There is no way to change priorities of different SSIDs, you may want to set {{ic|1=AutoConnect=false}} as a workaround.}}<br />
<br />
==== EAP-PEAP ====<br />
<br />
Like EAP-PWD, you also need to create a {{ic|''essid''.8021x}} file in the directory. Before you proceed to write the configuration file, this is also a good time to find out which CA certificate your organization uses. This is an example configuration file that uses MSCHAPv2 password authentication:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=PEAP<br />
EAP-Identity=anonymous@realm.edu<br />
EAP-PEAP-CACert=/path/to/root.crt<br />
EAP-PEAP-ServerDomainMask=radius.realm.edu<br />
EAP-PEAP-Phase2-Method=MSCHAPV2<br />
EAP-PEAP-Phase2-Identity=johndoe@realm.edu<br />
EAP-PEAP-Phase2-Password=hunter2<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
MsCHAPv2 passwords can also be stored as a encrypted hash. The correct md4 hash can be calculated with:<br />
<br />
$ iconv -t utf16le | openssl md4 -provider legacy<br />
<br />
Insert an EOF after your password by pressing {{ic|Ctrl+d}}, do not hit {{ic|Enter}}. The resulting hash needs to be stored inside the {{ic|EAP-PEAP-Phase2-Password-Hash}} key.<br />
<br />
{{Tip|If you are planning on using ''eduroam'', see also [[#eduroam]].}}<br />
<br />
==== TTLS-PAP ====<br />
<br />
Like EAP-PWD, you also need to create a {{ic|''essid''.8021x}} file in the directory. Before you proceed to write the configuration file, this is also a good time to find out which CA certificate your organization uses. This is an example configuration file that uses PAP password authentication:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=TTLS<br />
EAP-Identity=anonymous@uni-test.de<br />
EAP-TTLS-CACert=cert.pem<br />
EAP-TTLS-ServerDomainMask=*.uni-test.de<br />
EAP-TTLS-Phase2-Method=Tunneled-PAP<br />
EAP-TTLS-Phase2-Identity=user<br />
EAP-TTLS-Phase2-Password=password<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
==== EAP-TLS ====<br />
<br />
EAP-TLS uses x509 ''client certificates'' to authenticate you. Like ssh keys, these use public-key cryptography, so the wifi authentication server never needs to be sent a secret, and you do not need to copy and reuse a password between devices. Usually each device will use a distinct cert, one that can, in theory at least, be revoked without forcing you to change a password or disrupt your other devices.<br />
<br />
As with the other enterprise methods you need to know the CA cert your organization uses ({{ic|cacert.pem}}), which is used to prove to your device it is connecting to the right place. You also need to have the client certificate, which represents you and will be uploaded on each connection ({{ic|client-cert.pem}}), and the private key that goes with it ({{ic|client-key.pem}}), which is used to prove you own that client certificate.<br />
<br />
When you have collected the credentials, put this in your {{ic|/var/lib/iwd/''essid''.8021x}} file:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
<br />
EAP-Method=TLS<br />
EAP-TLS-CACert=/path/to/cacert.pem<br />
EAP-Identity=''your_enterprise_email''<br />
EAP-TLS-ClientCert=/path/to/client-cert.pem<br />
EAP-TLS-ClientKey=/path/to/client-key.pem<br />
#EAP-TLS-ClientKeyPassphrase=key-passphrase # if client-key.pem is encrypted, provide its passphrase<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
==== eduroam ====<br />
<br />
eduroam offers a [https://cat.eduroam.org/ configuration assistant tool (CAT)], which unfortunately does not support iwd. However, the installer, which you can download by clicking on the download button then selecting your university, is just a Python script. It is easy to extract the necessary configuration options, including the certificate and server domain mask. Also, some institutions are upgrading to EAP-TLS, and outsourcing the generation of {{ic|client-cert.pem}} to [https://www.securew2.com/ SecureW2], in which case you will need to use their tool as well to generate a client cert.<br />
<br />
The following table contains a mapping of iwd configuration options to eduroam CAT install script variables.<br />
<br />
{| class="wikitable<br />
! Iwd Configuration Option !! CAT Script Variable<br />
|-<br />
| ''essid'' || one of {{ic|Config.ssids}}<br />
|-<br />
| {{ic|EAP-Method}} || {{ic|Config.eap_outer}}<br />
|-<br />
| {{ic|EAP-Identity}} || {{ic|Config.anonymous_identity}}<br />
|-<br />
| {{ic|EAP-''method''-CACert}} || the content of {{ic|Config.CA}} or an absolute path to a ''.pem'' file containing {{ic|Config.CA}}<br />
|-<br />
| {{ic|EAP-''method''-ServerDomainMask}} || one of {{ic|Config.servers}}<br />
|-<br />
| {{ic|EAP-''method''-Phase2-Method}} || {{ic|Config.eap_inner}} unless it is equal to {{ic|PAP}}, in that case use instead {{ic|Tunneled-PAP}}<br />
|-<br />
| {{ic|EAP-''method''-Phase2-Identity}} || {{ic|''username''@Config.user_realm}}<br />
|}<br />
<br />
where {{ic|''method''}} is the content of {{ic|EAP-Method}} and should be either {{ic|TLS}}, {{ic|TTLS}} or {{ic|PEAP}}. Once you have extracted all necessary information and converted them to their iwd configuration equivalent you can put them in a configuration file called {{ic|''essid''.8021x}} as explained in the preceding methods.<br />
<br />
{{Note|<br />
* {{ic|EAP-Identity}} may not be required by your eduroam provider, in which case you might have to use {{ic|anonymous@''Config.user_realm''}} in this field.<br />
* If your {{ic|EAP-''method''-ServerDomainMask}} starts with {{ic|DNS:}}, use only the part after {{ic|DNS:}}.<br />
}}<br />
<br />
==== Other cases ====<br />
<br />
More example tests can be [https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests found in the test cases] of the upstream repository.<br />
<br />
== Optional configuration ==<br />
<br />
File {{ic|/etc/iwd/main.conf}} can be used for main configuration. See {{man|5|iwd.config}}.<br />
<br />
=== Disable auto-connect for a particular network ===<br />
<br />
Create / edit file {{ic|/var/lib/iwd/''network''.''type''}}. Add the following section to it:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk (for example)|2=<br />
[Settings]<br />
AutoConnect=false<br />
}}<br />
<br />
=== Disable periodic scan for available networks ===<br />
<br />
By default when {{ic|iwd}} is in disconnected state, it periodically scans for available networks. To disable periodic scan (so as to always scan manually), create / edit file {{ic|/etc/iwd/main.conf}} and add the following section to it:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Scan]<br />
DisablePeriodicScan=true<br />
}}<br />
<br />
=== Enable built-in network configuration ===<br />
<br />
Since version 0.19, iwd can assign IP address(es) and set up routes using a built-in DHCP client or with static configuration. It is a good alternative to [[Network configuration#Network managers|standalone DHCP clients]].<br />
<br />
To activate iwd's network configuration feature, create/edit {{ic|/etc/iwd/main.conf}} and add the following section to it:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
EnableNetworkConfiguration=true<br />
}}<br />
<br />
There is also ability to set route metric with {{ic|RoutePriorityOffset}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
RoutePriorityOffset=300<br />
}}<br />
<br />
==== IPv6 support ====<br />
<br />
Since version 1.10, iwd supports IPv6, but it is disabled by default in versions below 2.0.<br />
Since version [https://git.kernel.org/pub/scm/network/wireless/iwd.git/commit/?id=00baa75e963334fc3946490e554641891614c255 2.0], it is enabled by default.<br />
<br />
To disable it, add the following to the configuration file:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
EnableIPv6=false<br />
}}<br />
<br />
To enable it in version below 2.0 and higher than 1.10:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
EnableIPv6=true<br />
}}<br />
<br />
This setting is required to be enabled whether you want to use DHCPv6 or static IPv6 configuration. It can also be set on a per-network basis.<br />
<br />
==== Setting static IP address in network configuration ====<br />
<br />
Add the following section to {{ic|/var/lib/iwd/''network''.''type''}} file. For example:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[IPv4]<br />
Address=192.168.1.10<br />
Netmask=255.255.255.0<br />
Gateway=192.168.1.1<br />
Broadcast=192.168.1.255<br />
DNS=192.168.1.1<br />
}}<br />
<br />
==== Select DNS manager ====<br />
<br />
At the moment, iwd supports two DNS managers—[[systemd-resolved]] and [[resolvconf]].<br />
<br />
Add the following section to {{ic|/etc/iwd/main.conf}} for {{ic|systemd-resolved}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
NameResolvingService=systemd<br />
}}<br />
<br />
For {{ic|resolvconf}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
NameResolvingService=resolvconf<br />
}}<br />
<br />
{{Note|If not specified, [[systemd-resolved]] is used as default and recommended for [https://lore.kernel.org/iwd/2249097a-97e0-175a-6b02-e5d6be484498%40gmail.com/ systemd use].}}<br />
<br />
=== Allow any user to read status information ===<br />
<br />
If you want to allow any user to read the status information, but not modify the settings, you can create the following [[D-Bus]] configuration file:<br />
<br />
{{hc|/etc/dbus-1/system.d/iwd-allow-read.conf|<nowiki><br />
<!-- Allow any user to read iwd status information. Overrides some part<br />
of /usr/share/dbus-1/system.d/iwd-dbus.conf. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<policy context="default"><br />
<deny send_destination="net.connman.iwd"/><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="Get" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.ObjectManager" send_member="GetManagedObjects" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="RegisterSignalLevelAgent" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="UnregisterSignalLevelAgent" /><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
=== Encrypted network profiles ===<br />
{{Expansion|Encrypted network profiles may not work in certain setups.}}<br />
<br />
By default, iwd stores network credentials to the system unencrypted. Since iwd version 1.25, iwd provides experimental support for creating [https://iwd.wiki.kernel.org/profile_encryption encrypted profiles] for systems using systemd. <br />
<br />
First, create an encrypted credential. The following example uses [[systemd-creds]] and creates an encrypted credential called ''iwd-secret'' that is bound to the system's [[Trusted Platform Module]] which will be used to create encrypted profiles:<br />
<br />
# systemd-ask-password -n | systemd-creds --tpm2-device=auto --name=iwd-secret encrypt - /etc/credstore.encrypted/iwd-secret.cred<br />
<br />
Next, add the {{ic|LoadCredentialEncrypted}} option by creating a [[drop-in file]] for the iwd service.<br />
<br />
{{hc|/etc/systemd/system/iwd.service.d/use-creds.conf|2=<br />
[Service]<br />
LoadCredentialEncrypted=iwd-secret:/etc/credstore.encrypted/iwd-secret.cred<br />
}}<br />
<br />
Finally, add the {{ic|SystemdEncrypt}} option with the value being the named credential to the iwd configuration file, [[daemon-reload|reload]] the systemd manager, and [[restart]] the iwd service.<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
...<br />
SystemdEncrypt=iwd-secret<br />
}}<br />
<br />
{{Note|<br />
* Any profiles currently on the system will be encrypted automatically. At this point there is nothing else needed, and any future profiles will be encrypted automatically.<br />
* In the above example, the encrypted credential is implicitly bound to TPM PCR 7. Therefore, if the secure boot state or firmware certificates change then connecting to networks will not be possible for that booted session.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Verbose TLS debugging ===<br />
<br />
This can be useful, if you have trouble setting up MSCHAPv2 or TTLS. You can set the following [[environment variable]] via a [[drop-in snippet]]:<br />
<br />
{{hc|/etc/systemd/system/iwd.service.d/tls-debug.conf|2=<br />
[Service]<br />
Environment=IWD_TLS_DEBUG=TRUE<br />
}}<br />
<br />
Check the iwd logs afterwards by running {{ic|journalctl -u iwd.service}} as root.<br />
<br />
=== Restarting iwd.service after boot ===<br />
<br />
On some machines, it is reported that {{ic|iwd.service}} has to be restarted to work after boot. See {{Bug|63912}} and [https://bbs.archlinux.org/viewtopic.php?id=251432 thread 251432]. This probably occurs because the Linux kernel and services start too early and ''iwd'' starts before wireless network card powers on. As a workaround, [[extend the unit]] to add a delay:<br />
<br />
[Service]<br />
ExecStartPre=/usr/bin/sleep 2<br />
<br />
Then [[reload]] the ''systemd'' manager configuration.<br />
<br />
=== Connect issues after reboot ===<br />
<br />
A low entropy pool can cause connection problems in particular noticeable after reboot. See [[Random number generation]] for suggestions to increase the entropy pool.<br />
<br />
=== Wireless device is not renamed by udev ===<br />
<br />
Since version 1.0, iwd disables predictable renaming of wireless device. It installs the following systemd network link configuration file which prevents udev from renaming the interface to {{ic|wlp#s#}}:<br />
<br />
{{hc|1=/usr/lib/systemd/network/80-iwd.link|2=<br />
[Match]<br />
Type=wlan<br />
<br />
[Link]<br />
NamePolicy=keep kernel<br />
}}<br />
<br />
As a result the wireless link name {{ic|wlan#}} is kept after boot. This resolved a race condition between ''iwd'' and [[udev]] on interface renaming as explained in [https://iwd.wiki.kernel.org/interface_lifecycle#udev_interface_renaming iwd udev interface renaming].<br />
<br />
If this results in issues try masking it with:<br />
<br />
# ln -s /dev/null /etc/systemd/network/80-iwd.link<br />
<br />
=== No DHCP in AP mode ===<br />
<br />
Clients may not receive an IP address via DHCP when connecting to ''iwd'' in AP mode. It is therefore necessary to enable network configuration by ''iwd'' on managed interfaces:<br />
<br />
{{hc|1=/etc/iwd/main.conf|2=<br />
[General]<br />
EnableNetworkConfiguration=True<br />
}}<br />
<br />
The mentioned file has to be created if it does not already exist.<br />
<br />
=== WiFi keeps disconnecting due to iwd crash ===<br />
<br />
Some users experience disconnections with WiFi, re-connecting continuously but stabilizing eventually and managing to connect. <br />
<br />
Users report crashes ([https://bbs.archlinux.org/viewtopic.php?id=273965]) of {{ic|iwd.service}} in their [[journal]]. <br />
<br />
The core issue is having multiple conflicting services for managing their network connections. Check that you do not have [[enable]]d them at the same time to fix this issue.<br />
<br />
=== Error loading client private key ===<br />
<br />
To load key files ''iwd'' requires the {{ic|pkcs8_key_parser}} [[kernel module]]. While on boot it gets loaded by {{man|8|systemd-modules-load.service}} using {{ic|/usr/lib/modules-load.d/pkcs8.conf}}, that will not be the case if {{Pkg|iwd}} has just been installed.<br />
<br />
If messages such as {{ic|Error loading client private key ''/path/to/key''}} show up in the [[journal]] when trying to connect to WPA Enterprise networks, manually load the module:<br />
<br />
# modprobe pkcs8_key_parser<br />
<br />
=== iwd keeps roaming ===<br />
<br />
iwd will roam to other known APs if the connection is too bad.<br />
<br />
This will show up in the system log as {{ic|wlan0: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3{{=}}DEAUTH_LEAVING)}}<br />
<br />
You can see the connection signal strength with<br />
<br />
iwctl station wlan0 show | grep RSSI<br />
<br />
You can increase the threshold to allow a worse connection. RoamThreshold defaults to -70 and RoamThreshold5G to -76.<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
RoamThreshold=-75<br />
RoamThreshold5G=-80}}<br />
<br />
== See also ==<br />
<br />
* [https://iwd.wiki.kernel.org/gettingstarted Getting Started with iwd]<br />
* [https://iwd.wiki.kernel.org/networkconfigurationsettings Network Configuration Settings]<br />
* [https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests More Examples for WPA Enterprise]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=237074 The IWD thread on the Arch Linux Forums]<br />
* [https://www.youtube.com/watch?v=F2Q86cphKDo 2017 Update on new WiFi daemon for Linux by Marcel Holtmann - YouTube]<br />
* [https://www.youtube.com/watch?v=QIqT2obSPDk The New Wi-Fi Experience for Linux - Marcel Holtmann, Intel - YouTube]<br />
* [https://iwd.wiki.kernel.org/ap_mode How to set up a simple access point with iwd]</div>Kousuhttps://wiki.archlinux.org/index.php?title=Iwd&diff=798007Iwd2024-01-23T20:09:52Z<p>Kousu: /* WPA Enterprise */ Document EAP-TLS. Some eduroam providers are using it via https://www.securew2.com. These docs do not yet cover everything you need to know to successfully connect to eduroam via https://www.securew2.com/: they are missing the steps for converting SecureW2's output into usable .pem files. But I want to share this here because it took me two hours to figure out and I don't want others stuck like I was!</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[ja:Iwd]]<br />
[[pt:Iwd]]<br />
[[ru:Iwd]]<br />
[[zh-hans:Iwd]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|wpa_supplicant}}<br />
{{Related articles end}}<br />
[https://iwd.wiki.kernel.org/ iwd] (iNet wireless daemon) is a wireless daemon for Linux written by Intel. The core goal of the project is to optimize resource utilization by not depending on any external libraries and instead utilizing features provided by the Linux Kernel to the maximum extent possible.<br />
<br />
iwd can work in standalone mode or in combination with comprehensive network managers like [[ConnMan]], [[systemd-networkd]] and [[NetworkManager#Using iwd as the Wi-Fi backend|NetworkManager]].<br />
<br />
{{Note|Do not follow the instructions on this page when using iwd via a [[network manager]] unless it is explicitly stated otherwise in that network manager's article.}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|iwd}} package.<br />
<br />
== Usage ==<br />
<br />
The {{Pkg|iwd}} package provides the client program {{ic|iwctl}}, the daemon {{ic|iwd}} and the Wi-Fi monitoring tool {{ic|iwmon}}.<br />
<br />
{{Aur|iwgtk}} provides a GUI front-end for iwd and an indicator (tray) icon.<br />
<br />
[[Start/enable]] {{ic|iwd.service}} so it can be controlled through the {{ic|iwctl}} command or through {{ic|iwgtk}}.<br />
<br />
{{Note|Only root and members of the {{ic|netdev}} or the {{ic|wheel}} [[user group]] are allowed to interact with ''iwd''. In order to use ''iwctl'' or ''iwgtk'', you need to [[Users and groups#Group management|add your user to one of those groups]].}}<br />
<br />
=== iwctl ===<br />
<br />
To get an interactive prompt do:<br />
<br />
$ iwctl<br />
<br />
The interactive prompt is then displayed with a prefix of {{ic|[iwd]#}}.<br />
<br />
{{Tip|<br />
* In the {{ic|iwctl}} prompt you can auto-complete commands and device names by hitting {{ic|Tab}}.<br />
* To exit the interactive prompt, send [[Wikipedia:EOF character|EOF]] by pressing {{ic|Ctrl+d}}.<br />
* You can use all commands as command line arguments without entering an interactive prompt. For example: {{ic|iwctl device wlan0 show}}.<br />
}}<br />
<br />
To list all available commands:<br />
<br />
[iwd]# help<br />
<br />
==== Connect to a network ====<br />
<br />
First, if you do not know your wireless device name, list all Wi-Fi devices:<br />
<br />
[iwd]# device list<br />
<br />
If the device or its corresponding adapter is turned off, turn it on:<br />
<br />
[iwd]# device ''device'' set-property Powered on<br />
<br />
[iwd]# adapter ''adapter'' set-property Powered on<br />
<br />
Then, to initiate a scan for networks (note that this command will not output anything):<br />
<br />
[iwd]# station ''device'' scan<br />
<br />
You can then list all available networks:<br />
<br />
[iwd]# station ''device'' get-networks<br />
<br />
Finally, to connect to a network:<br />
<br />
[iwd]# station ''device'' connect ''SSID''<br />
<br />
{{Note|For automatic IP and DNS configuration via DHCP, you have to [[#Enable built-in network configuration|manually enable]] the built-in DHCP client or configure a [[Network configuration#Network managers|standalone DHCP client]].}}<br />
{{Tip|The user interface supports autocomplete, by typing {{ic|station }} and {{ic|Tab}} {{ic|Tab}}, the available devices are displayed, type the first letters of the device and {{ic|Tab}} to complete. The same way, type {{ic|connect }} and {{ic|Tab}} {{ic|Tab}} in order to have the list of available networks displayed. Then, type the first letters of the chosen network followed by {{ic|Tab}} in order to complete the command.}} <br />
<br />
If a passphrase is required (and it is not already stored in one of the profiles that iwd automatically checks), you will be prompted to enter it. Alternatively, you can supply it as a command line argument:<br />
<br />
$ iwctl --passphrase ''passphrase'' station ''device'' connect ''SSID''<br />
<br />
{{Note|<br />
* {{ic|iwd}} automatically stores network passphrases in the {{ic|/var/lib/iwd}} directory and uses them to auto-connect in the future. See [[#Network configuration]].<br />
* To connect to a network with spaces in the SSID, the network name should be double quoted when connecting.<br />
* iwd only supports PSK pass-phrases from 8 to 63 ASCII-encoded characters. The following error message will be given if the requirements are not met: {{ic|PMK generation failed. Ensure Crypto Engine is properly configured}}.<br />
}}<br />
<br />
==== Connect to a network using WPS/WSC ====<br />
<br />
If your network is configured such that you can connect to it by pressing a button ([[Wikipedia:Wi-Fi Protected Setup]]), check first that your network device is also capable of using this setup procedure.<br />
<br />
[iwd]# wsc list<br />
<br />
Then, provided that your device appeared in the above list,<br />
<br />
[iwd]# wsc ''device'' push-button<br />
<br />
and push the button on your router. The procedure works also if the button was pushed beforehand, less than 2 minutes earlier.<br />
<br />
If your network requires to validate a PIN number to connect that way, check the {{ic|help}} command output to see how to provide the right options to the {{ic|wsc}} command.<br />
<br />
==== Disconnect from a network ====<br />
<br />
To disconnect from a network:<br />
<br />
[iwd]# station ''device'' disconnect<br />
<br />
==== Show device and connection information ====<br />
<br />
To display the details of a WiFi device, like MAC address:<br />
<br />
[iwd]# device ''device'' show<br />
<br />
To display the connection state, including the connected network of a Wi-Fi device:<br />
<br />
[iwd]# station ''device'' show<br />
<br />
==== Manage known networks ====<br />
<br />
To list networks you have connected to previously:<br />
<br />
[iwd]# known-networks list<br />
<br />
To forget a known network:<br />
<br />
[iwd]# known-networks ''SSID'' forget<br />
<br />
=== iwgtk ===<br />
<br />
Alternatively, {{Aur|iwgtk}} provides a GUI front-end through which iwd can be controlled.<br />
<br />
Running {{ic|iwgtk}} without any arguments launches the application window, which can be used to toggle your adapters and devices on/off, change their operating modes, view available networks, connect to available networks, and manage known networks.<br />
<br />
==== Indicator icon ====<br />
<br />
To launch iwgtk's indicator (tray) icon daemon, run:<br />
<br />
$ iwgtk -i<br />
<br />
If the indicator icon does not appear, then your system tray most likely lacks support for the StatusNotifierItem API, in which case you need to run a compatibility layer such as {{Aur|snixembed-git}}.<br />
<br />
The following system trays support StatusNotifierItem, and therefore work out of the box:<br />
<br />
* KDE Plasma<br />
* swaybar<br />
* xfce4-panel<br />
<br />
The following trays only support XEmbed, and therefore require {{Aur|snixembed-git}}:<br />
<br />
* AwesomeWM<br />
* i3bar<br />
<br />
==== Autostart ====<br />
<br />
The most common use case for iwgtk is to start the indicator daemon every time you log into your desktop. If your desktop environment supports the [[XDG Autostart]] standard, this should happen automatically due to the {{ic|iwgtk-indicator.desktop}} file which is placed in {{ic|/etc/xdg/autostart/}} by the AUR package.<br />
<br />
Alternatively, a systemd unit file to start the indicator daemon is provided by the AUR package. If your desktop environment supports systemd's {{ic|graphical-session.target}} unit, then iwgtk can be autostarted via systemd by [[enabling]] the {{ic|iwgtk.service}} [[user unit]].<br />
<br />
== Network configuration ==<br />
<br />
By default, ''iwd'' stores the network configuration in the directory {{ic|/var/lib/iwd}}. The configuration file is named as {{ic|''network''.''type''}}, where ''network'' is the network SSID and ''.type'' is the network type, either ''.open'', ''.psk'' or ''.8021x''. The file is used to store the encrypted {{ic|PreSharedKey}} and optionally the cleartext {{ic|Passphrase}} and can also be created by the user without invoking {{ic|iwctl}}. The file can be used for other configuration pertaining to that network SSID as well. For more settings, see {{man|5|iwd.network}}.<br />
<br />
{{Note|In string values, including identities and passwords, certain characters may be backslash-escaped. Leading spaces, \n, \r, and literal backslashes must be escaped. See {{man|5|iwd.network}}.}}<br />
<br />
=== WPA-PSK ===<br />
<br />
A minimal example file to connect to a WPA-PSK or WPA2-PSK secured network with SSID "spaceship" and passphrase "test1234":<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
PreSharedKey=aafb192ce2da24d8c7805c956136f45dd612103f086034c402ed266355297295}}<br />
<br />
{{Note|The SSID of the network is used as a filename only when it contains only alphanumeric characters or one of {{ic|- _}}. If it contains any other characters, the name will instead be an {{ic|1==}}-character followed by the hex-encoded version of the SSID.}}<br />
<br />
To calculate the pre-shared key from the passphrase, one of these two methods can be used:<br />
<br />
* Enter the passphrase in cleartext in the configuration file:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
Passphrase=test1234}}<br />
<br />
:The pre-shared key will be appended to the file at the first connect:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[Security]<br />
Passphrase=test1234<br />
PreSharedKey=aafb192ce2da24d8c7805c956136f45dd612103f086034c402ed266355297295}}<br />
<br />
* Or the pre-shared key can be calculated from the SSID and the passphrase using ''wpa_passphrase'' (from {{Pkg|wpa_supplicant}}) or {{AUR|wpa-psk}}. See [[wpa_supplicant#Connecting with wpa_passphrase]] for more details.<br />
<br />
=== WPA Enterprise ===<br />
<br />
==== EAP-PWD ====<br />
<br />
For connecting to a EAP-PWD protected enterprise access point you need to create a file called: {{ic|''essid''.8021x}} in the {{ic|/var/lib/iwd}} directory with the following content:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=PWD<br />
EAP-Identity=''your_enterprise_email''<br />
EAP-Password=''your_password''<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
If you do not want autoconnect to the AP you can set the option to False and connect manually to the access point via {{ic|iwctl}}. The same applies to the password, if you do not want to store it plaintext leave the option out of the file and just connect to the enterprise AP.<br />
<br />
{{Note|There is no way to change priorities of different SSIDs, you may want to set {{ic|1=AutoConnect=false}} as a workaround.}}<br />
<br />
==== EAP-PEAP ====<br />
<br />
Like EAP-PWD, you also need to create a {{ic|''essid''.8021x}} file in the directory. Before you proceed to write the configuration file, this is also a good time to find out which CA certificate your organization uses. This is an example configuration file that uses MSCHAPv2 password authentication:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=PEAP<br />
EAP-Identity=anonymous@realm.edu<br />
EAP-PEAP-CACert=/path/to/root.crt<br />
EAP-PEAP-ServerDomainMask=radius.realm.edu<br />
EAP-PEAP-Phase2-Method=MSCHAPV2<br />
EAP-PEAP-Phase2-Identity=johndoe@realm.edu<br />
EAP-PEAP-Phase2-Password=hunter2<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
MsCHAPv2 passwords can also be stored as a encrypted hash. The correct md4 hash can be calculated with:<br />
<br />
$ iconv -t utf16le | openssl md4 -provider legacy<br />
<br />
Insert an EOF after your password by pressing {{ic|Ctrl+d}}, do not hit {{ic|Enter}}. The resulting hash needs to be stored inside the {{ic|EAP-PEAP-Phase2-Password-Hash}} key.<br />
<br />
{{Tip|If you are planning on using ''eduroam'', see also [[#eduroam]].}}<br />
<br />
==== TTLS-PAP ====<br />
<br />
Like EAP-PWD, you also need to create a {{ic|''essid''.8021x}} file in the directory. Before you proceed to write the configuration file, this is also a good time to find out which CA certificate your organization uses. This is an example configuration file that uses PAP password authentication:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
EAP-Method=TTLS<br />
EAP-Identity=anonymous@uni-test.de<br />
EAP-TTLS-CACert=cert.pem<br />
EAP-TTLS-ServerDomainMask=*.uni-test.de<br />
EAP-TTLS-Phase2-Method=Tunneled-PAP<br />
EAP-TTLS-Phase2-Identity=user<br />
EAP-TTLS-Phase2-Password=password<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
==== EAP-TLS ====<br />
<br />
EAP-TLS uses x509 ''client certificates'' to authorize you. Like ssh keys, these use public-key cryptography, so the wifi authentication server never needs to be sent a secret, and you do not need to copy and reuse a password between devices. Usually each device will use a distinct cert, one that can, in theory at least, be revoked without forcing you to change a password or disrupt your other devices.<br />
<br />
As with the other enterprise methods you need to know the CA cert your organization uses ({{ic|cacert.pem}}), which is used to prove to your device it is connecting to the right place. You also need to have the client certificate, which represents you and will be uploaded on each connection ({{ic|client-cert.pem}}), and the private key that goes with it ({{ic|client-key.pem}}), which is used to prove you own that client certificate.<br />
<br />
When you have collected the credentials, put this in your {{ic|/var/lib/iwd/''essid''.8021x}} file:<br />
<br />
{{hc|/var/lib/iwd/''essid''.8021x|2=<br />
[Security]<br />
<br />
EAP-Method=TLS<br />
EAP-TLS-CACert=/path/to/cacert.pem<br />
EAP-Identity=''your_enterprise_email''<br />
EAP-TLS-ClientCert=/path/to/client-cert.pem<br />
EAP-TLS-ClientKey=/path/to/client-key.pem<br />
#EAP-TLS-ClientKeyPassphrase=key-passphrase # if client-key.pem is encrypted, provide its passphrase<br />
<br />
[Settings]<br />
AutoConnect=true<br />
}}<br />
<br />
==== eduroam ====<br />
<br />
eduroam offers a [https://cat.eduroam.org/ configuration assistant tool (CAT)], which unfortunately does not support iwd. However, the installer, which you can download by clicking on the download button then selecting your university, is just a Python script. It is easy to extract the necessary configuration options, including the certificate and server domain mask. Also, some institutions are upgrading to EAP-TLS, and outsourcing the generation of {{ic|client-cert.pem}} to [https://www.securew2.com/ SecureW2], in which case you will need to use their tool as well to generate a client cert.<br />
<br />
The following table contains a mapping of iwd configuration options to eduroam CAT install script variables.<br />
<br />
{| class="wikitable<br />
! Iwd Configuration Option !! CAT Script Variable<br />
|-<br />
| ''essid'' || one of {{ic|Config.ssids}}<br />
|-<br />
| {{ic|EAP-Method}} || {{ic|Config.eap_outer}}<br />
|-<br />
| {{ic|EAP-Identity}} || {{ic|Config.anonymous_identity}}<br />
|-<br />
| {{ic|EAP-''method''-CACert}} || the content of {{ic|Config.CA}} or an absolute path to a ''.pem'' file containing {{ic|Config.CA}}<br />
|-<br />
| {{ic|EAP-''method''-ServerDomainMask}} || one of {{ic|Config.servers}}<br />
|-<br />
| {{ic|EAP-''method''-Phase2-Method}} || {{ic|Config.eap_inner}} unless it is equal to {{ic|PAP}}, in that case use instead {{ic|Tunneled-PAP}}<br />
|-<br />
| {{ic|EAP-''method''-Phase2-Identity}} || {{ic|''username''@Config.user_realm}}<br />
|}<br />
<br />
where {{ic|''method''}} is the content of {{ic|EAP-Method}} and should be either {{ic|TLS}}, {{ic|TTLS}} or {{ic|PEAP}}. Once you have extracted all necessary information and converted them to their iwd configuration equivalent you can put them in a configuration file called {{ic|''essid''.8021x}} as explained in the preceding methods.<br />
<br />
{{Note|<br />
* {{ic|EAP-Identity}} may not be required by your eduroam provider, in which case you might have to use {{ic|anonymous@''Config.user_realm''}} in this field.<br />
* If your {{ic|EAP-''method''-ServerDomainMask}} starts with {{ic|DNS:}}, use only the part after {{ic|DNS:}}.<br />
}}<br />
<br />
==== Other cases ====<br />
<br />
More example tests can be [https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests found in the test cases] of the upstream repository.<br />
<br />
== Optional configuration ==<br />
<br />
File {{ic|/etc/iwd/main.conf}} can be used for main configuration. See {{man|5|iwd.config}}.<br />
<br />
=== Disable auto-connect for a particular network ===<br />
<br />
Create / edit file {{ic|/var/lib/iwd/''network''.''type''}}. Add the following section to it:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk (for example)|2=<br />
[Settings]<br />
AutoConnect=false<br />
}}<br />
<br />
=== Disable periodic scan for available networks ===<br />
<br />
By default when {{ic|iwd}} is in disconnected state, it periodically scans for available networks. To disable periodic scan (so as to always scan manually), create / edit file {{ic|/etc/iwd/main.conf}} and add the following section to it:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Scan]<br />
DisablePeriodicScan=true<br />
}}<br />
<br />
=== Enable built-in network configuration ===<br />
<br />
Since version 0.19, iwd can assign IP address(es) and set up routes using a built-in DHCP client or with static configuration. It is a good alternative to [[Network configuration#Network managers|standalone DHCP clients]].<br />
<br />
To activate iwd's network configuration feature, create/edit {{ic|/etc/iwd/main.conf}} and add the following section to it:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
EnableNetworkConfiguration=true<br />
}}<br />
<br />
There is also ability to set route metric with {{ic|RoutePriorityOffset}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
RoutePriorityOffset=300<br />
}}<br />
<br />
==== IPv6 support ====<br />
<br />
Since version 1.10, iwd supports IPv6, but it is disabled by default in versions below 2.0.<br />
Since version [https://git.kernel.org/pub/scm/network/wireless/iwd.git/commit/?id=00baa75e963334fc3946490e554641891614c255 2.0], it is enabled by default.<br />
<br />
To disable it, add the following to the configuration file:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
EnableIPv6=false<br />
}}<br />
<br />
To enable it in version below 2.0 and higher than 1.10:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
EnableIPv6=true<br />
}}<br />
<br />
This setting is required to be enabled whether you want to use DHCPv6 or static IPv6 configuration. It can also be set on a per-network basis.<br />
<br />
==== Setting static IP address in network configuration ====<br />
<br />
Add the following section to {{ic|/var/lib/iwd/''network''.''type''}} file. For example:<br />
<br />
{{hc|/var/lib/iwd/spaceship.psk|2=<br />
[IPv4]<br />
Address=192.168.1.10<br />
Netmask=255.255.255.0<br />
Gateway=192.168.1.1<br />
Broadcast=192.168.1.255<br />
DNS=192.168.1.1<br />
}}<br />
<br />
==== Select DNS manager ====<br />
<br />
At the moment, iwd supports two DNS managers—[[systemd-resolved]] and [[resolvconf]].<br />
<br />
Add the following section to {{ic|/etc/iwd/main.conf}} for {{ic|systemd-resolved}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
NameResolvingService=systemd<br />
}}<br />
<br />
For {{ic|resolvconf}}:<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[Network]<br />
NameResolvingService=resolvconf<br />
}}<br />
<br />
{{Note|If not specified, [[systemd-resolved]] is used as default and recommended for [https://lore.kernel.org/iwd/2249097a-97e0-175a-6b02-e5d6be484498%40gmail.com/ systemd use].}}<br />
<br />
=== Allow any user to read status information ===<br />
<br />
If you want to allow any user to read the status information, but not modify the settings, you can create the following [[D-Bus]] configuration file:<br />
<br />
{{hc|/etc/dbus-1/system.d/iwd-allow-read.conf|<nowiki><br />
<!-- Allow any user to read iwd status information. Overrides some part<br />
of /usr/share/dbus-1/system.d/iwd-dbus.conf. --><br />
<br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<br />
<policy context="default"><br />
<deny send_destination="net.connman.iwd"/><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.Properties" send_member="Get" /><br />
<allow send_destination="net.connman.iwd" send_interface="org.freedesktop.DBus.ObjectManager" send_member="GetManagedObjects" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="RegisterSignalLevelAgent" /><br />
<allow send_destination="net.connman.iwd" send_interface="net.connman.iwd.Device" send_member="UnregisterSignalLevelAgent" /><br />
</policy><br />
<br />
</busconfig><br />
</nowiki>}}<br />
<br />
=== Encrypted network profiles ===<br />
{{Expansion|Encrypted network profiles may not work in certain setups.}}<br />
<br />
By default, iwd stores network credentials to the system unencrypted. Since iwd version 1.25, iwd provides experimental support for creating [https://iwd.wiki.kernel.org/profile_encryption encrypted profiles] for systems using systemd. <br />
<br />
First, create an encrypted credential. The following example uses [[systemd-creds]] and creates an encrypted credential called ''iwd-secret'' that is bound to the system's [[Trusted Platform Module]] which will be used to create encrypted profiles:<br />
<br />
# systemd-ask-password -n | systemd-creds --tpm2-device=auto --name=iwd-secret encrypt - /etc/credstore.encrypted/iwd-secret.cred<br />
<br />
Next, add the {{ic|LoadCredentialEncrypted}} option by creating a [[drop-in file]] for the iwd service.<br />
<br />
{{hc|/etc/systemd/system/iwd.service.d/use-creds.conf|2=<br />
[Service]<br />
LoadCredentialEncrypted=iwd-secret:/etc/credstore.encrypted/iwd-secret.cred<br />
}}<br />
<br />
Finally, add the {{ic|SystemdEncrypt}} option with the value being the named credential to the iwd configuration file, [[daemon-reload|reload]] the systemd manager, and [[restart]] the iwd service.<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
...<br />
SystemdEncrypt=iwd-secret<br />
}}<br />
<br />
{{Note|<br />
* Any profiles currently on the system will be encrypted automatically. At this point there is nothing else needed, and any future profiles will be encrypted automatically.<br />
* In the above example, the encrypted credential is implicitly bound to TPM PCR 7. Therefore, if the secure boot state or firmware certificates change then connecting to networks will not be possible for that booted session.<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Verbose TLS debugging ===<br />
<br />
This can be useful, if you have trouble setting up MSCHAPv2 or TTLS. You can set the following [[environment variable]] via a [[drop-in snippet]]:<br />
<br />
{{hc|/etc/systemd/system/iwd.service.d/tls-debug.conf|2=<br />
[Service]<br />
Environment=IWD_TLS_DEBUG=TRUE<br />
}}<br />
<br />
Check the iwd logs afterwards by running {{ic|journalctl -u iwd.service}} as root.<br />
<br />
=== Restarting iwd.service after boot ===<br />
<br />
On some machines, it is reported that {{ic|iwd.service}} has to be restarted to work after boot. See {{Bug|63912}} and [https://bbs.archlinux.org/viewtopic.php?id=251432 thread 251432]. This probably occurs because the Linux kernel and services start too early and ''iwd'' starts before wireless network card powers on. As a workaround, [[extend the unit]] to add a delay:<br />
<br />
[Service]<br />
ExecStartPre=/usr/bin/sleep 2<br />
<br />
Then [[reload]] the ''systemd'' manager configuration.<br />
<br />
=== Connect issues after reboot ===<br />
<br />
A low entropy pool can cause connection problems in particular noticeable after reboot. See [[Random number generation]] for suggestions to increase the entropy pool.<br />
<br />
=== Wireless device is not renamed by udev ===<br />
<br />
Since version 1.0, iwd disables predictable renaming of wireless device. It installs the following systemd network link configuration file which prevents udev from renaming the interface to {{ic|wlp#s#}}:<br />
<br />
{{hc|1=/usr/lib/systemd/network/80-iwd.link|2=<br />
[Match]<br />
Type=wlan<br />
<br />
[Link]<br />
NamePolicy=keep kernel<br />
}}<br />
<br />
As a result the wireless link name {{ic|wlan#}} is kept after boot. This resolved a race condition between ''iwd'' and [[udev]] on interface renaming as explained in [https://iwd.wiki.kernel.org/interface_lifecycle#udev_interface_renaming iwd udev interface renaming].<br />
<br />
If this results in issues try masking it with:<br />
<br />
# ln -s /dev/null /etc/systemd/network/80-iwd.link<br />
<br />
=== No DHCP in AP mode ===<br />
<br />
Clients may not receive an IP address via DHCP when connecting to ''iwd'' in AP mode. It is therefore necessary to enable network configuration by ''iwd'' on managed interfaces:<br />
<br />
{{hc|1=/etc/iwd/main.conf|2=<br />
[General]<br />
EnableNetworkConfiguration=True<br />
}}<br />
<br />
The mentioned file has to be created if it does not already exist.<br />
<br />
=== WiFi keeps disconnecting due to iwd crash ===<br />
<br />
Some users experience disconnections with WiFi, re-connecting continuously but stabilizing eventually and managing to connect. <br />
<br />
Users report crashes ([https://bbs.archlinux.org/viewtopic.php?id=273965]) of {{ic|iwd.service}} in their [[journal]]. <br />
<br />
The core issue is having multiple conflicting services for managing their network connections. Check that you do not have [[enable]]d them at the same time to fix this issue.<br />
<br />
=== Error loading client private key ===<br />
<br />
To load key files ''iwd'' requires the {{ic|pkcs8_key_parser}} [[kernel module]]. While on boot it gets loaded by {{man|8|systemd-modules-load.service}} using {{ic|/usr/lib/modules-load.d/pkcs8.conf}}, that will not be the case if {{Pkg|iwd}} has just been installed.<br />
<br />
If messages such as {{ic|Error loading client private key ''/path/to/key''}} show up in the [[journal]] when trying to connect to WPA Enterprise networks, manually load the module:<br />
<br />
# modprobe pkcs8_key_parser<br />
<br />
=== iwd keeps roaming ===<br />
<br />
iwd will roam to other known APs if the connection is too bad.<br />
<br />
This will show up in the system log as {{ic|wlan0: deauthenticating from xx:xx:xx:xx:xx:xx by local choice (Reason: 3{{=}}DEAUTH_LEAVING)}}<br />
<br />
You can see the connection signal strength with<br />
<br />
iwctl station wlan0 show | grep RSSI<br />
<br />
You can increase the threshold to allow a worse connection. RoamThreshold defaults to -70 and RoamThreshold5G to -76.<br />
<br />
{{hc|/etc/iwd/main.conf|2=<br />
[General]<br />
RoamThreshold=-75<br />
RoamThreshold5G=-80}}<br />
<br />
== See also ==<br />
<br />
* [https://iwd.wiki.kernel.org/gettingstarted Getting Started with iwd]<br />
* [https://iwd.wiki.kernel.org/networkconfigurationsettings Network Configuration Settings]<br />
* [https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/autotests More Examples for WPA Enterprise]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=237074 The IWD thread on the Arch Linux Forums]<br />
* [https://www.youtube.com/watch?v=F2Q86cphKDo 2017 Update on new WiFi daemon for Linux by Marcel Holtmann - YouTube]<br />
* [https://www.youtube.com/watch?v=QIqT2obSPDk The New Wi-Fi Experience for Linux - Marcel Holtmann, Intel - YouTube]<br />
* [https://iwd.wiki.kernel.org/ap_mode How to set up a simple access point with iwd]</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=704025Mac2021-12-02T05:23:19Z<p>Kousu: /* Mid 2007 13" - Version 2,1 */ explain what a 32-bit EFI/64 bit franken-computer means, and how to handle it with GRUB</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
==== Kernel Options ====<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
Specific models may need more help. You can try specifying other options according to your hardware. All possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
===== Model-Specifics =====<br />
<br />
For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
{{bc|<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
}}<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
The internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
===== Bootloader =====<br />
<br />
The macbook2,1 is an unusual system, being a x86_64 machine that runs a 32-bit pre-boot EFI OS. This means that while you should (and will, if you're using official Arch ISOs) install a 64 bit Linux, you need to make sure the bootloader you choose is compiled for 32-bits.<br />
<br />
With [[GRUB]], this is done by<br />
<br />
grub-install --target i386-efi --efi-directory=/boot/ --removable<br />
<br />
You can also use rEFInd, as explained next.<br />
<br />
===== Installation via 201212 ISO image =====<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
<br />
===== Installation via 202104 ISO image =====<br />
<br />
<br />
<br />
===== Rebooting =====<br />
<br />
The MacBook won't reboot properly by default. It [https://askubuntu.com/a/7132 needs] the kernel command line parameter {{ic|1=reboot=pci}}. To add it, if you're using [[GRUB]], [[GRUB#Additional_arguments|add the parameter]] with:<br />
<br />
(echo;<br />
echo '# Repair macbook rebooting: https://askubuntu.com/a/7132';<br />
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX reboot=pci"') >> /etc/default/grub<br />
<br />
Then make sure to [[GRUB#Generate_the_main_configuration_file|regenerate]] with<br />
<br />
grub-mkconfig -o /boot/grub/grub.cfg <br />
<br />
If you're using [[syslinux]] then [[Syslinux#Kernel_parameters|use its APPEND operation]].<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=704024Mac2021-12-02T04:55:13Z<p>Kousu: /* Mid 2007 13" - Version 2,1 */ Add macbook2,1 reboot fix</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
==== Kernel Options ====<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
Specific models may need more help. You can try specifying other options according to your hardware. All possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
===== Model-Specifics =====<br />
<br />
For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
{{bc|<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
}}<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
The internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
===== Rebooting =====<br />
<br />
The MacBook won't reboot properly by default. It [https://askubuntu.com/a/7132 needs] the kernel command line parameter {{ic|1=reboot=pci}}. To add it, if you're using [[GRUB]], [[GRUB#Additional_arguments|add the parameter]] with:<br />
<br />
(echo;<br />
echo '# Repair macbook rebooting: https://askubuntu.com/a/7132';<br />
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX reboot=pci"') >> /etc/default/grub<br />
<br />
Then make sure to [[GRUB#Generate_the_main_configuration_file|regenerate]] with<br />
<br />
grub-mkconfig -o /boot/grub/grub.cfg <br />
<br />
If you're using [[syslinux]] then [[Syslinux#Kernel_parameters|use its APPEND operation]].<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703962Mac2021-12-01T06:53:49Z<p>Kousu: /* Auto-Mute Mode */ We said "Read ALSA" at the start of this section so we can assume everything is ALSA.</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
==== Kernel Options ====<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
Specific models may need more help. You can try specifying other options according to your hardware. All possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
===== Model-Specifics =====<br />
<br />
For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
{{bc|<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
}}<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
The internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703961Mac2021-12-01T06:52:56Z<p>Kousu: /* Disabling S/PDIF */ Durp this isn't markdown</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
==== Kernel Options ====<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
Specific models may need more help. You can try specifying other options according to your hardware. All possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
===== Model-Specifics =====<br />
<br />
For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
{{bc|<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
}}<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703960Mac2021-12-01T06:52:25Z<p>Kousu: /* Sound */ Nest an extra header in the ToC for clarity</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
==== Kernel Options ====<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
Specific models may need more help. You can try specifying other options according to your hardware. All possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
===== Model-Specifics =====<br />
<br />
For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
```<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
```<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703959Mac2021-12-01T06:47:52Z<p>Kousu: /* Model-specific information */ Put my macbook2,1 microphone advice in the right subsection. I didn't notice I'd put it under the Macbook Air section.</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
<br />
Specific models may need more help. For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
```<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
```<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703958Mac2021-12-01T06:44:36Z<p>Kousu: /* Sound */ Record arcane S/PDIF advice</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
<br />
Specific models may need more help. For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
==== Disabling S/PDIF ====<br />
<br />
Some (most?) Macbook models have an optical S/PDIF audio jack in the same jack as the headphone jack. You can see it when it's active as a red light glowing out of the headphone jack. It can trick PulseAudio into preferring it and routing all your audio out it.<br />
<br />
If you are not getting any sound in or out, confirm that {{ic|pavucontrol}} > Configuration > Profile says "Analog Stereo Duplex" instead of "Digital"<br />
<br />
or just run<br />
<br />
```<br />
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo<br />
```<br />
<br />
Also check if you need to edit {{ic|/usr/share/alsa-card-profile/mixer/paths/}} to workaround faulty plug detection causing PulseAudio to failover to "Digital".<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for how to edit this to get the macbook2,1's microphone to work.<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703957Mac2021-12-01T06:26:26Z<p>Kousu: /* Sound */ Expand the Auto-Mute tip into full instructions.</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook.<br />
<br />
{{Warning|Every time you change {{ic|/etc/modprobe.d}}, test it by rebooting.}}<br />
<br />
<br />
Specific models may need more help. For example, if you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for getting its microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, available online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
<br />
==== Auto-Mute Mode ====<br />
<br />
If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-Mute Mode".<br />
<br />
You can either do this using {{ic|alsamixer}}:<br />
<br />
# Run {{ic|alsamixer}}<br />
# Press F6 and pick "default:0 HDA Intel" to get more detailed controls<br />
# Use the arrow keys to select "Auto-Mute Mode"<br />
# Press Space to enable it<br />
# (optionally) Run {{ic|sudo alsactl store}} to make the change permanent<br />
<br />
or with {{ic|amixer}}:<br />
<br />
{{bc|1=<br />
amixer -c 0 cset name='Auto-Mute Mode' 1 && sudo alsactl store<br />
}}<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=703956Mac2021-12-01T06:21:12Z<p>Kousu: /* Sound */ mac-intel-auto no longer seems to work on a macbook2,1</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:Mac]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks (intel). These are only partially supported. See [https://github.com/Dunedan/mbp-2016-linux here] for technical and [https://wiki.t2linux.org/ this] for user focused information}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
=== Video ===<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
==== NVIDIA note ====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl-dkms}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
==== iMac 2020 (with AMDGPU and 5k retina resolution) ====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel parameters]].<br />
<br />
=== Touchpad ===<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
=== Keyboard ===<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
==== Keyboard Backlight ====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
'''Ensuring the keyboard backlight is on when entering the LUKS decryption password'''<br />
<br />
This can be done via [[Mkinitcpio#HOOKS|initcpio hooks]]. First, create an executable install script in {{ic|/etc/initcpio/install/mac_kb_backlight}} with the follwing:<br />
<br />
#!/bin/bash<br />
<br />
build() {<br />
add_module applesmc<br />
add_runscript<br />
}<br />
<br />
Next, create an executable hook in {{ic|/etc/initcpio/hooks/mac_kb_backlight}} with:<br />
<br />
#!/bin/bash<br />
<br />
run_hook() {<br />
if [ -f "/sys/class/leds/smc::kbd_backlight/brightness" ]; then<br />
echo 100 > "/sys/class/leds/smc::kbd_backlight/brightness"<br />
fi<br />
}<br />
<br />
Finally, add this custom hook to the {{ic|HOOKS}} array in {{ic|/etc/mkinitcpio.conf}}, and ensure it's placed before the {{ic|encrypt}} hook:<br />
<br />
HOOKS=(... mac_kb_backlight encrypt ...)<br />
<br />
Remember to regenerate the initramfs images after these steps to include the custom script.<br />
<br />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl-dkms}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For MacBook2,1 (late 2008/early 2009)s with a [https://www.kernel.org/doc/html/v5.15/sound/hd-audio/models.html#stac9220-9221 SigmaTel STAC9221 A1] chip, use<br />
<br />
options snd_hda_intel model=macbook<br />
<br />
'''and see [[#Microphone 2,1|below]]''' for getting its microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=54 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 54 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
{{Note|Starting with kernel ''5.15'', setting {{ic|scroll_speed}} to a value between 55 and 63 will induce crashes if you scroll too quickly. If you encounter that issue, reduce the setting to 54 or lower.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
==== FaceTime HD Camera ====<br />
<br />
Recent Macbooks include the FaceTime HD Camera, which may be connected by PCIe. You can confirm this by looking for "FaceTime HD Camera" in the output of {{ic|lspci}}. The {{AUR|bcwc-pcie-git}} package installs a '''facetimehd''' module (and firmware) to support these devices. The module should be loaded automatically after installation.<br />
<br />
If the webcam shows incorrect colors, this may be due to missing sensor calibration files. Instructions for extracting the calibration files from Apple BootCamp drivers are given in this page: https://github.com/patjak/bcwc_pcie/wiki/Extracting-the-sensor-calibration-files<br />
<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
==== Yosemite and later ====<br />
This section addresses error message when mounting hfsplus partition: <br />
mount -t hfsplus dev/sdX force,ro<br />
wrong fs type, bad option, bad superblock on /dev/sdX, missing codepage or helper program, or other error.<br />
<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
=== Home Sharing ===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you will first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air ===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
<br />
===== Installing and booting =====<br />
<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
<br />
===== WiFi =====<br />
<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[wpa_supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2.<br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the ''dmesg'' log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: https://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
<br />
* '''MacBook Air'''<br />
** [https://dabase.com/blog/2014/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]{{Dead link|2021|05|17|status=404}}<br />
** [https://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
* '''MacBook Pro'''<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Talk:Mac&diff=664422Talk:Mac2021-04-26T21:20:33Z<p>Kousu: /* Older mics */ call for help</p>
<hr />
<div>== Personal feedback ==<br />
Hi. I've spent a lot of time to install Arch on a Macbook 1.1, and I've fixed several issues that can be of real interest for other people...<br />
<br />
First, my hard drive was brand new, and I wanted a pure EFI boot. Moreover, my CDROM drive is dead, so I had to boot Arch install from a live USB. To do so, I've used a rEFIt usbkey. Then, after the standard Arch install, I've made a HFS+ partition for the *.efi grub2 have generated. Finally, I've bless-ed those files with OsX from another computer, so that my new install can boot without rEFIt.<br />
<br />
My second issue was the keyboard mapping. I was forced to make a new console keymap from scratch to get all my keys working "apple-style". Not a big deal. For xorg, it was a bit more difficult. I've specified a "macbook79" keyboard in evdev xorg config file, and I've added the following lines at the end of /usr/share/X11/xkb/keycodes/evdev :<br />
<br />
xkb_keycodes "macbook79" {<br />
include "evdev(evdev)"<br />
<RALT> = 64;<br />
<LALT> = 133;<br />
};<br />
<br />
And the new following rule to /usr/share/X11/xkb/rules/evdev (just after line 118) :<br />
macbook79 = evdev(macbook79)<br />
<br />
This allows to have key combinations such as ALT+5 working, leading to a "{" symbol... without using dirty Xmodmap tricks. Since Mod1 (LALT) is used a lot, I've decided to map it to the left Option key, but you can choose another key.<br />
<br />
{{Unsigned|08:21, 31 October 2012 (UTC)|Azeiodgfjkldsfg}}<br />
<br />
== Question about primary partitions ==<br />
<br />
It's said in the article that only 4 primary partitions are authorized, including the efi's one. But isn't that only true for MBR partition tables?<br />
The macbook pro uses GPT partition tables and thus can have as many primary partition as it supports partitions no? {{Unsigned| 22:50, 3 November 2011|Geoffroy}}<br />
<br />
== EFI bootloader ==<br />
<br />
i think we should update bootloader section with latest selection of bootloaders <br />
<br />
see the link for more info: [http://www.phoronix.com/scan.php?page=news_item&px=MTEzODY]<br />
forum thread: [https://bbs.archlinux.org/viewtopic.php?pid=1130080#p1130080]<br />
<br />
--[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 15:14, 15 July 2012 (UTC)<br />
<br />
:I'm updating the Boot section of the Macbook 11,x page. Perhaps we can merge some of that onto here when I'm done. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:40, 2 July 2014 (UTC)<br />
<br />
== Linking to common articles ==<br />
<br />
I've added refereces to the common articles for some things like power management and suspending.<br />
<br />
While there are a few small details to consider on macbooks, we were duplicating huge amounts of information from those articles, without keeping them up to date. I deleted the out-of-date information, and linked the relevant articles. Please only add information here if it '''only''' applies to macbooks. Otherwise, use the general article.<br />
<br />
This all make this article shorter, and only include the really relevant information. Plus, we don't need to keep other stuff up-to-date here.<br />
<br />
Let me know if you have any comments on these changes.<br />
[[User:Hobarrera|Hobarrera]] ([[User talk:Hobarrera|talk]]) 10:47, 5 July 2014 (UTC)<br />
<br />
== Duplication with Beginners' guide ==<br />
<br />
:Moved from [[Beginners' guide]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 05:50, 20 February 2015 (UTC)<br />
<br />
Just wanted to lend my first time experience. I personally was installing on a macbook air, so perhaps this might be better suited for that discussion page. However, I can honestly say that most of it can be merged together with this page. I barely (and I mean barely.) deviated from the usual archboot install for a mac. And I did it three times to make sure it was do-able.<br />
<br />
Considering the archboot is basically the live usb wrapped in a gui (I believe?) it probably means that the two would've been quite similar for installing on a mba, and thus for macs in general. (The issues of xorg, wifi, etc, are real problems for macbooks, but I meant the general install should not require two wiki pages) [[User:Victoroux|Victoroux]] ([[User talk:Victoroux|talk]]) 14:01, 7 June 2013 (UTC)<br />
<br />
== Recommended touchpad driver ==<br />
<br />
The touchpad section explains that the driver xf86-input-multitouch-git adds functionality and that, oh by the way, there is xf86-input-mtrack-git which adds configuration capabilities. In reality most people seem to be using input-mtrack. Also input-multitouch doesn't seem to be maintained while input-mtrack received recent updates.<br />
<br />
I propose to instruct the installation input-mtrack and mention input-multitouch in passing only or removing mention to it altogether.<br />
[[User:Tburette|Tburette]] ([[User talk:Tburette|talk]]) 09:28, 10 June 2015 (UTC)<br />
<br />
== Macbook Pro 2015 models ==<br />
<br />
The 15" MBP from 2015 is actually the Macbook Pro 11,4, and was released in mid 2015, as opposed to the 13" MBP, which is the Macbook Pro 12,1 and was released in early 2015. Does anyone know if the 15" MBP is more similar to the MBP 12,1 or the 11,x models? [[User:Vijfhoek|Vijfhoek]] ([[User talk:Vijfhoek|talk]])<br />
<br />
: I think the 11,4 (and 11,5) are pretty similar to the 12,1. If it helps, I am trying to keep an updated list of issues and fixes at https://teamsammut.com/blog/2015/09/apple-macbook-pro-linux-issue-tracking.html. There are fixes for the video brightness, bluetooth and 5Ghz wireless there, for example. [[User:tsammut|tsammut]]<br />
<br />
== Macbook Pro 4,1 (Early 2008) ==<br />
<br />
In case anyone tries to install arch on a Macbook Pro 4,1:<br />
<br />
*I couldn't boot from the live CD so I used a Fedora Live CD and installed manually from there.<br />
*To get a live USB to boot, create a GPT partition table on it, not MBR.<br />
*Refind will help a lot. Super Grub Disk also if you want to BIOS boot.<br />
*Mount the EFI partition(usually /dev/sda1) to /boot.<br />
*Nvidia won't work in EFI mode. In BIOS mode nvidia-340xx will do the trick.<br />
*If nouveau is giving you trouble when loading try using a vbios file. Boot in BIOS mode and use [http://cgit.freedesktop.org/~stuart/vbtracetool/ vbtracetool] to dump it to /lib/firmware. Then load it by adding to the kernel command line the following and booting in EFI mode: <code>nouveau.config=NvBios=vbios.rom</code><br />
*Nouveau and X11 wouldn't work until I modified xorg.conf and added the following (change the busID to match yours-get it from lspci):<br />
<pre><br />
Section "Device"<br />
Identifier "n"<br />
Driver "nouveau"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
</pre><br />
<br />
For BIOS booting:<br />
*Use syslinux as a BIOS bootloader.<br />
*Use gdisk to create a hybrid partition scheme(both MBR and GPT). Add the EFI partition and your linux partition.<br />
<br />
[[User:Koassim|Koassim]] ([[User talk:Koassim|talk]]) 22:24, 16 May 2016 (UTC)<br />
<br />
== Updated bootloader section ==<br />
Hi everyone.<br />
Just to inform that I updated to bootloader installation part in order to include a method that does not require external software such as rEFInd and is perfectly compatible with single/dual/triple boot configurations, as it uses the native Apple bootloader to load GRUB inside an HFS+ boot partition.<br />
<br />
The section was written after re-elaborating the content from [https://glandium.org/blog/?p=2830 this source], with some minor addition regarding the setting of the partition type as {{ic|af00}}.<br />
I tried on two different macbook models and it works nicely.<br />
<br />
[[User:Jujstme|Jujstme]] ([[User talk:Jujstme|talk]]) 04:17, 20 Aug 2016 (UTC)<br />
<br />
== MacBook Pro 14,3 2018 ==<br />
<br />
[https://wiki.archlinux.org/index.php/User:AskApache/MacBookPro14,x MacBookPro14,3 Draft]<br />
- Got Arch installed as the primary OS dual-boot (OS-X) on a brand new 2018 MacBook Pro 14,3 model. Latest arch iso was broken so had to use an older archboot image to boot via usb drive with usb keyboard, then install basic system to disk, then upgrade in ramdisk to latest arch, install systemd-boot to efi, finally got it installed after 4 hrs. <br />
<br />
Still a ton of work to be done for it to feel like a real Arch machine and look/act the part. Working on the draft now, please feel free to let me know of any tips or tricks or anything else to help it along. Once done and tested will add to this main Mac article which is a bit outdated.<br />
<br />
--[[User:AskApache|AskApache]] ([[User talk:AskApache|talk]]) 07:32, 9 March 2018 (UTC)<br />
<br />
== Suggestion to remove useless advice for 128M 'gaps' in partition scheme ==<br />
<br />
At Option 1: EFI, the wiki suggests:<br />
<br />
OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in +128M when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read here.<br />
<br />
But the question is why? Because OS X '''likes''' to see that? Apple's own Disk Utility doesn't even partition like that, and it makes no difference whatsoever.<br />
Also the Apple article that is being linked to starts with: 'This document is no longer being updated.'.<br />
I suspect this advice can be safely considered a relic of the past that (especially!) no Linux user should be concerned with as it has no effect at all.<br />
<br />
{{Unsigned|10:49, 27 December 2018 (UTC)|Eterps}}<br />
<br />
I have a 2010 Mac Mini and the default partitions seemed to have 128mb gaps. Maybe this is still relevant for older OS versions? I'm not sure - I ran with it and it sure didn't seem to hurt.<br />
<br />
[[User:Yyyc514|Yyyc514]] ([[User talk:Yyyc514|talk]]) 17:55, 27 December 2018 (UTC)<br />
<br />
== Bootloader instructions are confusing, omits efibootmgr ==<br />
<br />
Using OS X's bless utility is nonsense, and jumping through Apple's hoops is not for the faint of heart. For a simple setup (even dual-boot where Arch is default), just install grub to the original EFI partition and do `efibootmgr -c -L Arch -d /dev/sda -l /EFI/arch/grubx64.efi`<br />
<br />
[[User:Adfjjv|Adfjjv]] ([[User talk:Adfjjv|talk]]) 19:32, 14 March 2019 (UTC)<br />
<br />
== Older macbook microphone ==<br />
<br />
The macbook2,1 seems to have a mic driver bug. I've found and explained a workaround in https://wiki.archlinux.org/index.php/Mac#Microphone_2%2C1 but I don't know enough about the kernel vs alsa vs pulse to describe why the fix works, or maybe improve it. If someone with more insight could increase the truthiness of that section that would be appreciated.<br />
<br />
https://discourse.nixos.org/t/how-to-override-pulseaudio-alsa-files/6718/3 and https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html%7C both imply there's no way to make that patch permanent (using some kind of conf.d/ directory), but I'm not sure I'm reading them right or if that's still true.<br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 21:17, 26 April 2021 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=Talk:Mac&diff=664420Talk:Mac2021-04-26T21:17:49Z<p>Kousu: /* Older mics */ new section</p>
<hr />
<div>== Personal feedback ==<br />
Hi. I've spent a lot of time to install Arch on a Macbook 1.1, and I've fixed several issues that can be of real interest for other people...<br />
<br />
First, my hard drive was brand new, and I wanted a pure EFI boot. Moreover, my CDROM drive is dead, so I had to boot Arch install from a live USB. To do so, I've used a rEFIt usbkey. Then, after the standard Arch install, I've made a HFS+ partition for the *.efi grub2 have generated. Finally, I've bless-ed those files with OsX from another computer, so that my new install can boot without rEFIt.<br />
<br />
My second issue was the keyboard mapping. I was forced to make a new console keymap from scratch to get all my keys working "apple-style". Not a big deal. For xorg, it was a bit more difficult. I've specified a "macbook79" keyboard in evdev xorg config file, and I've added the following lines at the end of /usr/share/X11/xkb/keycodes/evdev :<br />
<br />
xkb_keycodes "macbook79" {<br />
include "evdev(evdev)"<br />
<RALT> = 64;<br />
<LALT> = 133;<br />
};<br />
<br />
And the new following rule to /usr/share/X11/xkb/rules/evdev (just after line 118) :<br />
macbook79 = evdev(macbook79)<br />
<br />
This allows to have key combinations such as ALT+5 working, leading to a "{" symbol... without using dirty Xmodmap tricks. Since Mod1 (LALT) is used a lot, I've decided to map it to the left Option key, but you can choose another key.<br />
<br />
{{Unsigned|08:21, 31 October 2012 (UTC)|Azeiodgfjkldsfg}}<br />
<br />
== Question about primary partitions ==<br />
<br />
It's said in the article that only 4 primary partitions are authorized, including the efi's one. But isn't that only true for MBR partition tables?<br />
The macbook pro uses GPT partition tables and thus can have as many primary partition as it supports partitions no? {{Unsigned| 22:50, 3 November 2011|Geoffroy}}<br />
<br />
== EFI bootloader ==<br />
<br />
i think we should update bootloader section with latest selection of bootloaders <br />
<br />
see the link for more info: [http://www.phoronix.com/scan.php?page=news_item&px=MTEzODY]<br />
forum thread: [https://bbs.archlinux.org/viewtopic.php?pid=1130080#p1130080]<br />
<br />
--[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 15:14, 15 July 2012 (UTC)<br />
<br />
:I'm updating the Boot section of the Macbook 11,x page. Perhaps we can merge some of that onto here when I'm done. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:40, 2 July 2014 (UTC)<br />
<br />
== Linking to common articles ==<br />
<br />
I've added refereces to the common articles for some things like power management and suspending.<br />
<br />
While there are a few small details to consider on macbooks, we were duplicating huge amounts of information from those articles, without keeping them up to date. I deleted the out-of-date information, and linked the relevant articles. Please only add information here if it '''only''' applies to macbooks. Otherwise, use the general article.<br />
<br />
This all make this article shorter, and only include the really relevant information. Plus, we don't need to keep other stuff up-to-date here.<br />
<br />
Let me know if you have any comments on these changes.<br />
[[User:Hobarrera|Hobarrera]] ([[User talk:Hobarrera|talk]]) 10:47, 5 July 2014 (UTC)<br />
<br />
== Duplication with Beginners' guide ==<br />
<br />
:Moved from [[Beginners' guide]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 05:50, 20 February 2015 (UTC)<br />
<br />
Just wanted to lend my first time experience. I personally was installing on a macbook air, so perhaps this might be better suited for that discussion page. However, I can honestly say that most of it can be merged together with this page. I barely (and I mean barely.) deviated from the usual archboot install for a mac. And I did it three times to make sure it was do-able.<br />
<br />
Considering the archboot is basically the live usb wrapped in a gui (I believe?) it probably means that the two would've been quite similar for installing on a mba, and thus for macs in general. (The issues of xorg, wifi, etc, are real problems for macbooks, but I meant the general install should not require two wiki pages) [[User:Victoroux|Victoroux]] ([[User talk:Victoroux|talk]]) 14:01, 7 June 2013 (UTC)<br />
<br />
== Recommended touchpad driver ==<br />
<br />
The touchpad section explains that the driver xf86-input-multitouch-git adds functionality and that, oh by the way, there is xf86-input-mtrack-git which adds configuration capabilities. In reality most people seem to be using input-mtrack. Also input-multitouch doesn't seem to be maintained while input-mtrack received recent updates.<br />
<br />
I propose to instruct the installation input-mtrack and mention input-multitouch in passing only or removing mention to it altogether.<br />
[[User:Tburette|Tburette]] ([[User talk:Tburette|talk]]) 09:28, 10 June 2015 (UTC)<br />
<br />
== Macbook Pro 2015 models ==<br />
<br />
The 15" MBP from 2015 is actually the Macbook Pro 11,4, and was released in mid 2015, as opposed to the 13" MBP, which is the Macbook Pro 12,1 and was released in early 2015. Does anyone know if the 15" MBP is more similar to the MBP 12,1 or the 11,x models? [[User:Vijfhoek|Vijfhoek]] ([[User talk:Vijfhoek|talk]])<br />
<br />
: I think the 11,4 (and 11,5) are pretty similar to the 12,1. If it helps, I am trying to keep an updated list of issues and fixes at https://teamsammut.com/blog/2015/09/apple-macbook-pro-linux-issue-tracking.html. There are fixes for the video brightness, bluetooth and 5Ghz wireless there, for example. [[User:tsammut|tsammut]]<br />
<br />
== Macbook Pro 4,1 (Early 2008) ==<br />
<br />
In case anyone tries to install arch on a Macbook Pro 4,1:<br />
<br />
*I couldn't boot from the live CD so I used a Fedora Live CD and installed manually from there.<br />
*To get a live USB to boot, create a GPT partition table on it, not MBR.<br />
*Refind will help a lot. Super Grub Disk also if you want to BIOS boot.<br />
*Mount the EFI partition(usually /dev/sda1) to /boot.<br />
*Nvidia won't work in EFI mode. In BIOS mode nvidia-340xx will do the trick.<br />
*If nouveau is giving you trouble when loading try using a vbios file. Boot in BIOS mode and use [http://cgit.freedesktop.org/~stuart/vbtracetool/ vbtracetool] to dump it to /lib/firmware. Then load it by adding to the kernel command line the following and booting in EFI mode: <code>nouveau.config=NvBios=vbios.rom</code><br />
*Nouveau and X11 wouldn't work until I modified xorg.conf and added the following (change the busID to match yours-get it from lspci):<br />
<pre><br />
Section "Device"<br />
Identifier "n"<br />
Driver "nouveau"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
</pre><br />
<br />
For BIOS booting:<br />
*Use syslinux as a BIOS bootloader.<br />
*Use gdisk to create a hybrid partition scheme(both MBR and GPT). Add the EFI partition and your linux partition.<br />
<br />
[[User:Koassim|Koassim]] ([[User talk:Koassim|talk]]) 22:24, 16 May 2016 (UTC)<br />
<br />
== Updated bootloader section ==<br />
Hi everyone.<br />
Just to inform that I updated to bootloader installation part in order to include a method that does not require external software such as rEFInd and is perfectly compatible with single/dual/triple boot configurations, as it uses the native Apple bootloader to load GRUB inside an HFS+ boot partition.<br />
<br />
The section was written after re-elaborating the content from [https://glandium.org/blog/?p=2830 this source], with some minor addition regarding the setting of the partition type as {{ic|af00}}.<br />
I tried on two different macbook models and it works nicely.<br />
<br />
[[User:Jujstme|Jujstme]] ([[User talk:Jujstme|talk]]) 04:17, 20 Aug 2016 (UTC)<br />
<br />
== MacBook Pro 14,3 2018 ==<br />
<br />
[https://wiki.archlinux.org/index.php/User:AskApache/MacBookPro14,x MacBookPro14,3 Draft]<br />
- Got Arch installed as the primary OS dual-boot (OS-X) on a brand new 2018 MacBook Pro 14,3 model. Latest arch iso was broken so had to use an older archboot image to boot via usb drive with usb keyboard, then install basic system to disk, then upgrade in ramdisk to latest arch, install systemd-boot to efi, finally got it installed after 4 hrs. <br />
<br />
Still a ton of work to be done for it to feel like a real Arch machine and look/act the part. Working on the draft now, please feel free to let me know of any tips or tricks or anything else to help it along. Once done and tested will add to this main Mac article which is a bit outdated.<br />
<br />
--[[User:AskApache|AskApache]] ([[User talk:AskApache|talk]]) 07:32, 9 March 2018 (UTC)<br />
<br />
== Suggestion to remove useless advice for 128M 'gaps' in partition scheme ==<br />
<br />
At Option 1: EFI, the wiki suggests:<br />
<br />
OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in +128M when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read here.<br />
<br />
But the question is why? Because OS X '''likes''' to see that? Apple's own Disk Utility doesn't even partition like that, and it makes no difference whatsoever.<br />
Also the Apple article that is being linked to starts with: 'This document is no longer being updated.'.<br />
I suspect this advice can be safely considered a relic of the past that (especially!) no Linux user should be concerned with as it has no effect at all.<br />
<br />
{{Unsigned|10:49, 27 December 2018 (UTC)|Eterps}}<br />
<br />
I have a 2010 Mac Mini and the default partitions seemed to have 128mb gaps. Maybe this is still relevant for older OS versions? I'm not sure - I ran with it and it sure didn't seem to hurt.<br />
<br />
[[User:Yyyc514|Yyyc514]] ([[User talk:Yyyc514|talk]]) 17:55, 27 December 2018 (UTC)<br />
<br />
== Bootloader instructions are confusing, omits efibootmgr ==<br />
<br />
Using OS X's bless utility is nonsense, and jumping through Apple's hoops is not for the faint of heart. For a simple setup (even dual-boot where Arch is default), just install grub to the original EFI partition and do `efibootmgr -c -L Arch -d /dev/sda -l /EFI/arch/grubx64.efi`<br />
<br />
[[User:Adfjjv|Adfjjv]] ([[User talk:Adfjjv|talk]]) 19:32, 14 March 2019 (UTC)<br />
<br />
== Older mics ==<br />
<br />
The macbook2,1 seems to have a driver bug. I've found and explained a workaround in https://wiki.archlinux.org/index.php/Mac#Microphone_2%2C1 but I don't know enough about the kernel vs alsa vs pulse to describe why the fix works. If someone with more insight could increase the truthiness of that section that would be appreciated.<br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 21:17, 26 April 2021 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664419Mac2021-04-26T21:15:46Z<p>Kousu: /* Microphone 2,1 */ better reading guidance</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For 2009 Macs, see [[#Microphone_2,1| below]] for getting the microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html| a driver bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the pulseaudio plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664418Mac2021-04-26T21:14:59Z<p>Kousu: /* Microphone 2,1 */ reading guidance</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For 2009 Macs, see [[#Microphone_2,1| below]] for getting the microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html| this pulseaudio bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664417Mac2021-04-26T21:14:22Z<p>Kousu: /* Microphone 2,1 */ syntax typo</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For 2009 Macs, see [[#Microphone_2,1| below]] for getting the microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html| this bug] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664416Mac2021-04-26T21:13:49Z<p>Kousu: /* Sound */ syntax typo</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For 2009 Macs, see [[#Microphone_2,1| below]] for getting the microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [[https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html | this bug]] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664389Mac2021-04-26T16:56:55Z<p>Kousu: /* Sound */ working around broken mics on old macbooks</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
For 2009 Macs, see [[#Microphone_2,1 | below]] for getting the microphone to work.<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [[https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html | this bug]] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=664388Mac2021-04-26T16:54:43Z<p>Kousu: /* Mid 2009 — version 2,1 */ workaround old macbook mic problems</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See https://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}}{{Broken package link|package not found}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [https://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
https://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [https://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install https://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [https://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [https://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [https://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
===== Microphone 2,1 =====<br />
<br />
If your microphone is not working, you have probably run into [[https://www.mail-archive.com/pulseaudio-discuss@lists.freedesktop.org/msg20703.html | this bug]] which makes the macbook think the digital microphone is always plugged in, disabling the normal microphone.<br />
<br />
To work around it, disable the plug detector with this patch:<br />
<br />
--- a/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
+++ b/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf<br />
@@ -23,6 +23,8 @@<br />
<br />
[Jack Mic]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Jack Mic Phantom]<br />
required-any = any<br />
@@ -31,6 +33,8 @@<br />
<br />
[Jack Mic - Input]<br />
required-any = any<br />
+state.plugged = unknown<br />
+state.unplugged = unknown<br />
<br />
[Element Capture]<br />
switch = mute<br />
<br />
{{Warning|This needs to be reapplied manually after every pulseaudio upgrade. Pulseaudio does not seem to support any kind of system-local customization files that could make this patch permanent.}}<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
=== Mac Mini ===<br />
<br />
==== 2018 ====<br />
<br />
{{Warning|<br />
Attempting to modify UEFI boot parameters with efibootmgr is likely to crash in the kernel. Including GRUB install phase<br />
}}<br />
<br />
Luckily firmware on this model can function without it, using following adaptation of the [[#Using the native Apple bootloader with GRUB]]<br />
<br />
* Instead of creating HFS+ partition create a fat32 partition for the bootloader<br />
* Instead of using grub-install create grub image and installation manually OR boot with efi=noruntime parameter<br />
* Manual installation:<br />
# mkdir -p /boot/grub/fonts<br />
# grub-mkimage -O x86_64-efi -o /boot/System/Library/CoreServices/boot.efi \<br />
# -p /boot/grub \<br />
# part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux appleldr \<br />
# minicmd loadbios reboot halt search font gfxterm png all_video<br />
# cp -r /usr/lib/grub/x86_64-efi /boot/grub/<br />
# cp /usr/share/grub/unicode.pf2 /boot/grub/fonts/<br />
* Touching /boot/mach_kernel is not necessary anymore<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Mac&diff=655927Mac2021-03-24T10:33:34Z<p>Kousu: archive.org has iSight's firmware, under a non-commercial archiving exemption</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:Mac]]<br />
[[ja:Mac]]<br />
[[zh-hans:Mac]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|iMac (21.5-inch, Mid 2010)}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
{{Warning|This does not apply to more recent macbooks. These are very poorly supported. See [https://github.com/Dunedan/mbp-2016-linux here] for more information.}}<br />
<br />
Installing Arch Linux on a MacBook (12"/Air/Pro) or an iMac is quite similar to installing it on any other computer. However, due to the specific hardware configuration of a Mac, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Firmware updates|Firmware updates]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Firmware updates ==<br />
<br />
Before proceeding with the installation of Arch Linux, it is important to ensure that the latest firmware updates for your MacBook are installed. This procedure requires OS X.<br />
In OS X, open the App Store and check for updates. If your mac finds and installs any updates, make sure to '''reboot''' your computer, and then check again for updates to make sure that you installed everything.<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, [https://support.apple.com/en-us/HT204904 Apple] has great instructions.}}<br />
<br />
It is advisable to keep OS X installed, because MacBook firmware updates can only be installed using OS X. However, if you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
/Library/ColorSync/Profiles/Displays/*<br />
<br />
Continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
Partitioning of the storage drive is no different from any other PC or laptop. However, if you plan on keeping OS X for dual booting, you should consider that, by default, a MacBook's drive is formatted using GPT and contains at least 3 partitions:<br />
<br />
* '''EFI''': the ~200 MB [[EFI system partition]].<br />
* '''OS X''': the main partition containing your OS X installation. It is formatted using [[File_systems|HFS+]].<br />
* '''Recovery''': A recovery partition present in almost all MacBooks running OS X 10.7 or newer. It is usually hidden from OS X but can be viewed with partitioning tools.<br />
<br />
{{Note|In Macs that use the [[Apple Fusion Drive]], the partition scheme could be different.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#Arch Linux with OS X or other operating systems]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on. Please refer to the standard [[Installation guide]] for details.<br />
<br />
{{Note|It is advisable to '''disable''' the MacBook startup sound before proceeding with partitioning. Just boot in OS X, mute your system sound and reboot again to the Arch Linux Installation media. Please keep in mind that the volume of the startup sound can only be modified reliably in OS X.}}<br />
<br />
If you want to configure your system in order to have full-disk encryption, please look at the [[Dm-crypt/Encrypting an entire system]] page for details.<br />
<br />
An example for a very basic partitioning, that does not consider a separate {{ic|/home}} partition nor encryption or LVM, is the following:<br />
partition mountpoint size type label<br />
/dev/sda1 /boot 200MiB vfat EFI<br />
/dev/sda2 /swap adjust swap swap<br />
/dev/sda3 / remain ext4 root<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Arch Linux with OS X or other operating systems ===<br />
<br />
You need to partition your hard drive while keeping the partitions used for OS X/Windows. If you wish to keep OS X, the easiest way is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning| If your OS X partition is encrypted with FileVault 2, you '''must''' disable the disk encryption before proceeding. After the OS X partition has been resized, FileVault 2 can be re-enabled.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run ''Disk Utility.app'' (located in {{ic|/Applications/Utilities}})<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''Partition''' button.<br />
* Add a new partition by pressing the '''+''' button and choose how much space you want to leave for OS X, and how much for the new partition. Keep in mind the new partition will be formatted in Arch Linux, so you can choose any partition type you want. <br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
* Boot the Arch installation media or [[USB flash installation media|LiveUSB]] by holding down the {{ic|Alt}} '''during boot'''. Proceed with [[#Installation]].<br />
<br />
It is possible to resize the newly created partition from within the Arch installation media, or delete it in order to proceed with the creation of other partitions (eg. swap).<br />
<br />
{{Tip|Instead of cluttering your drive with different partition, it is possible to use a [[swapfile]] instead of a dedicated partition. Another solution can be setting up [[LVM]] in order to use the newly-created partition as a container. Please refer to the linked articles.}}<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run ''cgdisk''<br />
<br />
* Delete the partition you made in ''Disk Utility.app'' and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. More information about Apple's partitioning policy can be read [https://developer.apple.com/library/mac/technotes/tn2166/_index.html#//apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION5 here]. A simple example (no LVM, crypto):<br />
<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for {{ic|install.sh}}). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines ''"scan_all_linux_kernels"'' and ''"also_scan_dirs"'' options in {{ic|refind.conf}}. Configuration of boot options can then be done from a {{ic|refind_linux.conf}} in Arch's {{ic|/boot}} directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in ''Disk Utility.app'' afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See http://mjg59.dreamwidth.org/7468.html).,<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to Arch completely optional.<br />
}}<br />
<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 15-20GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run ''parted'' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for Arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain {{ic|/boot}}. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the ''"Manually configure block devices..."'' option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press {{ic|y}}. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [http://refit.sourceforge.net/]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]].<br />
<br />
== Setup bootloader ==<br />
<br />
=== Using the native Apple bootloader with systemd-boot (Recommended) ===<br />
<br />
Apple's native EFI bootloader reads {{ic|.efi}} files located inside the [[EFI system partition]] at {{ic|/EFI/BOOT/BOOTX64.EFI}}. Luckily, this is also the default install location for the [[systemd-boot]] binary. This means that booting linux using ''systemd-boot'' is very simple.<br />
* First, make sure you mounted the EFI System Partition at {{ic|/boot}}<br />
* Proceed with [[#Installation]] normally<br />
* Once inside the chrooted enviroment, type the following command to install ''systemd-boot'':<br />
{{bc|1=# bootctl --path=/boot install}}<br />
The above command will copy the ''systemd-boot'' binary to {{ic|/boot/EFI/BOOT/BOOTX64.EFI}} and add ''systemd-boot'' itself as the default EFI application (default boot entry) loaded by the EFI Boot Manager. <br />
* Proceed to [[systemd-boot#Configuration]] in order to correctly set up the bootloader<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux (it will be displayed as {{ic|EFI Boot}} as a possible boot option.<br />
{{Tip|If you installed Arch Linux alongside OS X, you will be able to change the default boot location from system Settings inside OS X. If Arch Linux does not show up as a possible boot option, you will have to mount the EFI System Partition inside OS X before selecting your boot option:<br />
{{bc|$ diskutil mount disk0s1}}<br />
}}<br />
<br />
=== Using the native Apple bootloader with GRUB ===<br />
<br />
{{Style|Uses [[partial upgrade]] procedure and explicitly lists many basic commands.}}<br />
<br />
Despite using UEFI, the MacBook's native EFI bootloader [http://refit.sourceforge.net/myths/ does not use the EFI partition for booting]. Instead, it looks for .efi files inside all the partitions in internal and external drives and shows them as possible boot options if certain conditions are satisfied. For example, MacBooks can detect an existing OSX installation after checking that:<br />
* there is a partition formatted as HFS+<br />
* the partition contains the partition id {{ic|af00}} <br />
* in the root of that partition, there is a file called {{ic|mach_kernel}}<br />
* inside that partition, there a {{ic|boot.efi}} file inside {{ic|/System/Library/CoreServices}}<br />
<br />
This means that configuring an Arch installation to be automatically recognized by the MacBook bootloader is possible. Moreover, it simply requires a properly-formatted HFS+ {{ic|/boot}} partition and does not require meddling with the EFI system partition. The advantage of this method is that it can coexist with OS X nicely and allows to avoid other bootloaders such as rEFInd. However, this requires manual configuration. The following steps will illustrate how to perform this configuration using GRUB.<br />
* First, while configuring a new Arch installation, create a separate {{ic|/boot}} partition. Many tools are available in the Arch ISO, for example '''cgdisk'''.<br />
* Make sure the partition is at least ~250 MB in size, since it will be used to store the kernel as well as any custom kernel you will install in the future. Moreover, make sure the partition type is set as Apple HFS/HFS+ (it will appear as {{ic|Apple HFS/HFS+}} in fdisk/cgdisk or {{ic|af00}} in gdisk)<br />
* Since the Arch installation ISO does not include the {{AUR|hfsprogs}} package, we need to install it in the installation environment before proceeding with formatting the new partition as HFS+, install {{Aur|hfsprogs}}, then:<br />
# modprobe hfsplus<br />
# mkfs.hfsplus /dev/sd'''X''' -v "Arch Linux"<br />
<br />
Note: replace /dev/sd'''X''' with the correct device as appropriate<br />
<br />
* Done, proceed with [[#Installation]]<br />
<br />
{{Warning|<br />
Once inside the chrooted enviroment, don’t forget to install the {{AUR|hfsprogs}} package on the newly installed system as well. After the installation of the package, regenerate the initramfs while chrooted<br />
# mkinitcpio -p linux<br />
}}<br />
<br />
* Once inside the chrooted enviroment, install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages.<br />
* Also, create a dummy {{ic|mach_kernel}} file<br />
# touch /boot/mach_kernel<br />
# mkdir -p /boot/EFI/arch && touch /boot/EFI/arch/mach_kernel<br />
* The following steps install the GRUB UEFI application to {{ic|/boot/EFI/arch/System/Library/CoreServices/boot.efi}} and install its modules to {{ic|/boot/grub/x86_64-efi}}.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot<br />
<br />
After that, remember to create a standard configuration file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
As you can see, the directory structure of the {{ic|boot.efi}} is not correct, as the {{ic|/System/Library/CoreServices}} directory is not supposed to be a subdirectory of the {{ic|/boot/EFI/}} folder. For this reason, we need to relocate the {{ic|boot.efi}} stub in a location the MacBook bootloader is able to recognize:<br />
# mv /boot/EFI/arch/System/ /boot/<br />
# rm -r /boot/EFI/<br />
<br />
After that, you need to create the following file <br />
<br />
{{hc|1=# nano /boot/System/Library/CoreServices/SystemVersion.plist|2=<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
At the next reboot, the Apple Boot Manager, shown when holding down the option key when booting the MacBook, should display Arch Linux as a possible boot option. Selecting that option will boot GRUB.<br />
<br />
Done! GRUB can now be selected on the standard MacBook bootloader and you can boot into your newly installed Arch Linux.<br />
<br />
{{Tip| After the installation, it is optionally possible to set a custom icon that will be displayed in the MacBook boot loader. In order to do that, you need to install the {{Pkg|wget}}, {{Pkg|librsvg}} and {{Pkg|libicns}} packages. After that, just follow the following commands:<br />
$ wget -O /tmp/archlinux.svg https://archlinux.org/logos/archlinux-icon-crystal-64.svg<br />
$ rsvg-convert -w 128 -h 128 -o /tmp/archlogo.png /tmp/archlinux.svg<br />
# png2icns /boot/.VolumeIcon.icns /tmp/archlogo.png<br />
$ rm /tmp/archlogo.png<br />
$ rm /tmp/archlinux.svg<br />
Obviously, you can replace the Arch logo with any other icon you like.<br />
}}<br />
<br />
=== Other methods ===<br />
<br />
{{Out of date | Section that describes bootloader setup for other setups should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[systemd-boot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#Option 2: BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB EFI Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#UEFI systems]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** Skip the [[Installation guide#Partition the disks|partition the disks]] stage, do only the [[Installation guide#Format the partitions|partition formatting]] and [[Installation guide#Mount_the_file_systems|mounting]] steps, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partitions]]<br />
** When at the [[Installation guide#Boot loader|install bootloader]] stage, follow [[#Setup bootloader]]<br />
** '''(for booting with BIOS-compatibility)''' Edit the menu.lst file of Grub and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz-linux root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** In the [[Installation guide#Configure the system|configure system]] stage, edit /etc/mkinitcpio.conf and ensure the '''keyboard''' hook is in the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing {{ic|Intel}}, read [[Intel graphics]].<br />
<br />
* If it returns {{ic|NVIDIA}}, read [[NVIDIA]].<br />
<br />
* If it returns two lines, with both {{ic|NVIDIA}} and {{ic|Intel}}, your mac has dual graphics. See [[MacBookPro10,x#Graphics]] for an example of one such setup that might apply in other cases. <br />
<br />
{{Warning|Despite lots of confusion in online forums, the dual graphics on MacBooks are [https://arstechnica.com/gadgets/2010/04/inside-apples-automatic-gpu-switching/ not] [[Optimus]]-based, and treating them as such will break your graphics. See instead [[MacBookPro10,x#Switching to/from GPUs with gpu-switch]] or your laptop's specific article for instructions on setting up graphics switching.}}<br />
<br />
* Otherwise if it returns {{ic|ATI}} or {{ic|AMD}}, read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|If you have installed OS in EFI mode and NVIDIA binary drivers are working only in BIOS mode (e.g. you get black screen on EFI boot), try this approach: https://askubuntu.com/a/613573 }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[blacklist]] apple_bl kernel module.<br />
* If backlight control does not work even this way, try setting module parameters. Uncommenting {{ic|1=options nvidia_bl max_level=0x1ffff shift=11}} in {{ic|/etc/modprobe.d/nvidia_bl.conf}} should do the trick.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== iMac 2020 (with AMDGPU and 5k retina resolution) =====<br />
<br />
It seems amdgpu driver has problems to set the native 5k resolution. If the display gets corrupted during boot when amdgpu driver module is loaded, try forcing a lower resolution. Add e.g. "video=2560x1440@60" to your bootloader's [[Kernel_parameters]].<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-mtrack-git}} package. Configuration options are documented in the [https://github.com/p2rkw/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably, you also need to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [https://support.apple.com/en-us/HT204895 OS X], refer to [[Touchpad Synaptics#Natural scrolling]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{AUR|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorg.conf.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed-light}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then [[enable]] and start {{ic|pommed.service}}.<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
Both {{Pkg|acpilight}} or {{AUR|kbdlight}} (stalled since 2015) allow to control keyboard backlight though scripts. With the appropriate udev rules or [[sxhkd]] they allow light-level changes without being root.<br />
<br />
As of 2017-11-12, {{Pkg|acpilight}} provides a "just-works" solution tested on a MacbookPro 8,1. <br />
<br />
Alternatively you might want to check out the [[Keyboard backlight]] wiki page.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom wireless]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* If you have the correct broadcom DKMS driver (i.e. broadcom-wl-dkms) installed and your wifi card is still not being recognised, try rebuilding the driver (See [[Dynamic Kernel Module Support]]).<br />
<br />
{{Note|<br />
* If your connection frequently drops, you may have to turn off Wi-Fi power management.<br />
* Eduroam or similar may crash your network manager. Simply delaying the connection after login should do the trick<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides about 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Disabling Thunderbolt ====<br />
<br />
Linux still has poor power management for Thunderbolt adapters on Macs. This can cause the TB adapter(s) to be always-on and prevent the CPU from going into the deepest power-saving states [https://bugzilla.kernel.org/show_bug.cgi?id=92111], drawing ca. 2W additional power even when not in use [https://github.com/Dunedan/mbp-2016-linux/issues/24#issuecomment-310952415]. An easy way to see the CPU states is using powertop. The problem arises when the CPU does not go below C3 as a package (Pkg%pc3).<br />
<br />
One workaround is to add<br />
acpi_osi=!Darwin<br />
to the kernel parameters in your bootloader, thereby telling the firmware that the system is not compatible with macOS [https://www.kernel.org/doc/html/latest/firmware-guide/acpi/osi.html]. This should disable the TB adapter (at least on older Macs), and thus reduce power consumption greatly, but will probably come with side-effects (e.g. no Thunderbolt, maybe others?).<br />
<br />
It is also possible to [[blacklist]] the thunderbolt module and then putting the controllers to sleep with<br />
echo auto > /sys/bus/pci/devices/0000:07:00.0/power/control<br />
Check the correct device number with lspci. This can also be [[systemd#systemd-tmpfiles - temporary files|automated]]. This method reduces power consumption slightly, but still consumes 0.9 W more than the previous method on a Macbook Air 2013.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by setting the option "sleep-inactive-ac-type" to "nothing" using dconf-editor, option path: org &rarr; gnome &rarr; settings-daemon &rarr; plugins &rarr; power).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you will need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this does not work, check that ARPT is disabled, and add a corresponding rule to udev, like this:<br />
<br />
SUBSYSTEM=="pci", KERNEL=="0000:03:00.0", ATTR{power/wakeup}="disabled"<br />
<br />
If this still does not work, try disabling LID0.<br />
This way suspending via lid-closing should be made impossible, so you might want to follow the instructions in [https://bbs.archlinux.org/viewtopic.php?pid=1556046#p1556046 this forum post] to make suspending via both lid-closing and systemd possible, by using systemd services.<br />
<br />
=== Wake Up After Suspend ===<br />
Occasionally the Macboook Air may wake up immediately after suspend.<br />
<br />
In {{ic|/proc/acpi/wakeup}} check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.<br />
<br />
To do this type to following command, edit {{ic|/etc/systemd/system/suspend-fix.service}}.<br />
<br />
Then add the following text and save:<br />
<br />
[Unit]<br />
Description=Fix for the suspend issue<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
And then run the following:<br />
<br />
systemctl enable suspend-fix.service<br />
systemctl start suspend-fix.service<br />
<br />
Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.<br />
<br />
=== Light sensor ===<br />
<br />
The values can be read from:<br />
<br />
/sys/devices/platform/applesmc.768/light<br />
<br />
A "cat" on this path returns two-tuples like (4,0). The below referenced lighter script ignores the second value - which always seems to be 0 - and uses the first number as measured environment lighting brightness value.<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. If you have a MacBookPro12,1, you might need<br />
<br />
options snd-hda-intel index=1,0<br />
<br />
instead. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
For Aluminium iMacs, see [[iMac Aluminium#Getting sound to work right]]<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html Advanced Linux Sound Architecture - Driver Configuration guide]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/index.html HD-Audio]<br />
* [https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html HD-Audio Codec-Specific Models]<br />
<br />
Then, reboot.<br />
<br />
==== USB audio interface ====<br />
<br />
In some cases, it can actually be easier to set up sound using a USB audio interface rather than the jack directly.<br />
<br />
For example, after plugging in a Focusrite Scarlett Solo, open {{Pkg|pavucontrol}}, go to {{ic|Configuration}}, choose {{ic|Off}} for all devices and choose {{ic|Analog Stereo Duplex}} for {{ic|Scarlett Solo USB}}. You can then use the headphone jack on the Focusrite device for speakers or headphones. This should work immediately and on startup. This does not require any Focusrite software to be installed.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Magic Mouse ===<br />
<br />
If you use a magic mouse you will find it works nicely out of the box. You might want to tweak some settings such as ''scroll-speed'' or ''acceleration''. There is no GUI for this at this time. The only way to set these settings is to instruct the kernel driver ({{ic|hid_magicmouse}}) with parameters. Create a modprobe config file for your mouse.<br />
<br />
{{hc|1=/etc/modprobe.d/magicmouse.conf|2=<br />
options hid_magicmouse scroll-speed=55 scroll-acceleration=1 emulate_3button=0<br />
}}<br />
<br />
<br />
This will instruct the driver to have a fast scroll-speed, do exponential acceleration and do not emulate a 3 button mouse. You can find an overview of all parameters and their current settings in {{ic|/sys/module/hid_magicmouse/parameters}}.<br />
<br />
To play with the settings without rebooting you can also set them through the command line, like so: <br />
<br />
# echo 55 > /sys/module/hid_magicmouse/parameters/scroll_speed<br />
<br />
{{Note|Using kernel ''4.10.10-1-macbook'' the Magic Mouse (''hid_magicmouse'') will cause a lot of system lock ups. If you experience random lock ups, try a different, wired, mouse to see if this is the case for you as well.}}<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it does not work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
There is a pre-extracted copy at https://archive.org/details/macbook-isight-webcam-linux.<br />
<br />
If you want to do it yourself you will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# mkdir /media/OSX<br />
# mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.6 (Snow Leopard) and 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it is not you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[lm_sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{Pkg|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
{{Warning|GNOME will revert the profile set by xcalib. It's preferable to set the profile using '''Color''' in settings.}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
==== Journaling ====<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, the safe way is to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information or try to do it from the command line:<br />
<br />
Find your partition:<br />
<br />
{{hc|# diskutil list|<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *750.2 GB disk0<br />
1: EFI EFI 209.7 MB disk0s1<br />
2: Apple_HFS OSX 149.5 GB disk0s2<br />
3: Apple_HFS Macintosh HD 599.2 GB disk0s3<br />
4: Apple_Boot Recovery HD 650.0 MB disk0s4<br />
}}<br />
<br />
In this example we will use ''disk0s3'' partition named as ''Macintosh HD''. To know if journaling is activate or not you could execute:<br />
<br />
{{hc|# diskutil info /dev/disk0s3 {{!}} grep -i journal|<br />
File System Personality: Journaled HFS+<br />
Name (User Visible): Mac OS Extended (Journaled)<br />
Journal: Journal size 49152 KB at offset 0x1176000<br />
}}<br />
<br />
As you can read the journaling is active. To turn off the journaling you could execute:<br />
<br />
# diskutil disableJournal disk0s3<br />
<br />
To verify it is done execute the info command again.<br />
<br />
If you get noting as output, then journaling is disabled.<br />
<br />
However, if you fail to disable journaling. You can change "auto,user,rw,exec" in {{ic|/etc/fstab}} to "auto,user,force,rw,exec" and mount it.<br />
<br />
====Yosemite and later====<br />
<br />
Since Yosemite, HFS+ partitions are now wrapped a CoreStorage volume. Verify that you have an CoreStorage volume.<br />
<br />
# fdisk -l /dev/sdX<br />
Disk /dev/sdX: 298.1 GiB, 320072933376 bytes, 625142448 sectors<br />
Units: sectors of 1* 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 4096 bytes<br />
I/O size (minimum/optimal): 4096 bytes / 4096 bytes<br />
Disklabel type: gpt<br />
Device Start End Sectors Size Type<br />
/dev/sdX1 40 409639 409600 200M EFI System<br />
/dev/sdX2 409640 623872871 623463232 297.3G Apple Core storage<br />
/dev/sdX3 623872872 625142407 1269536 916.0M Apple boot<br />
<br />
HFS+ uses two volume headers, one 1024 bytes into the device and one 1024 from the end of the device. With the HFS+ partition wrapped in the CoreStorage volume the end of the partition is not actually 1024 bytes from the end of the {{ic|/dev/sdX2}} partition.<br />
To fix this you need to specify {{ic|1=sizelimit=X}} when mounting.<br />
<br />
To determine {{ic|sizelimit}} do the following:<br />
<br />
# Run {{ic|testdisk /dev/sdX}} and select your drive<br />
# Select {{ic|EFI GPT}}<br />
# Select {{ic|Analyse}} and then {{ic|Quick Search}}<br />
<br />
Sample output:<br />
TestDisk 7.0, Data Recovery Utility, April 2015<br />
Christophe GRENIER <grenier@cgsecurity.org><br />
http://www.cgsecurity.org<br />
<br />
Disk /dev/sdX - 320 GB / 298 GiB - CHS 38913 255 63<br />
Partition Start End Size in sectors<br />
P EFI System 40 409639 409600 [EFI]<br />
P Mac HFS 409640 623147815 622738176<br />
P Mac HFS 623872872 625142407 1269536<br />
<br />
What you see now is the output of the HFS partition itself without the CoreStorage volume. Take the size in sectors (622738176 in this example) and multiply by the number of bytes in your logical sector size (512 in this example).<br />
<br />
622738176 * 512 = 318841946112<br />
<br />
Finally, mount your disk with the {{ic|1=sizelimit=X}} option.<br />
<br />
mount /dev/sdX -t hfsplus -o ro,sizelimit=318841946112<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where the booting partition is.<br />
<br />
Boot OS X, if you do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal) or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook while holding the T button, boot your MacBook while holding the Options button (alt)).<br />
<br />
Either way, once you have got a OS X terminal running on your MacBook you need to execute a different command (as root) depending on if you use EFI or not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215.<br />
<br />
=== Mute startup chime ===<br />
<br />
The startup chime volume is controlled by the EFI variable ''SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82''. So it can be muted with<br />
<br />
# printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
Bear in mind that the file may have the immutable bit set by default, which will prevent even root from overwriting the file. See [[File permissions and attributes#chattr and lsattr]]. To remove it, issue the following:<br />
<br />
# chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82<br />
<br />
After that, run the {{ic|printf}} command and it should overwrite the file properly. Verify the file's contents and then set the immutable bit again with {{ic|chattr +i}} once satisfied.<br />
<br />
Alternatively, you can use a OS X install disk to mute the chime. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
{{Note|Required formatting of the value provided for key SystemAudioVolume may differ depending on MacBook model and perhaps the version of OS X install media. If the above command fails to work, try enclosing the value in double quotes.}}<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [http://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need gptsync, install {{AUR|gptsync}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] the {{pkg|linux}} package.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== April 2016 12" - Version 9,1 ====<br />
<br />
* Booting from USB via EFI works fine, when giving the {{ic|1=intremap=nosid}} kernel option. Remember to hold the Alt key on booting to enter the boot menu. In order to allow Linux boot directly from your system disk, you'll first need to install http://www.rodsbooks.com/refind/ from within OSX recovery mode (hold cmd+r during boot, then open terminal, then run refind-install script).<br />
<br />
* The wireless card works out of the box with {{ic|brcmfmac}}.<br />
<br />
* Suspend / hibernate does not work. The problem seems to be the NVMe that does not wake up. When booting from an external drive, suspend / hibernate works out of the box.<br />
<br />
* Audio recording works out of the box. Audio playback works out of the box for headphones, not for built-in speakers. Cirrus driver patch needed for making the speakers work: https://github.com/leifliddy/macbook12-audio-driver<br />
<br />
* The keyboard and the touchpad do ''not'' work out of the box. There is a work-in-progress driver available that works well: {{AUR|macbook12-spi-driver-dkms}}. Sometimes the touchpad does not work after booting but this can be fixed by reloading the driver with {{ic|rmmod applespi && modprobe applespi}}.<br />
<br />
* The keyboard backlight does not work (no solution yet). <br />
<br />
* For Bluetooth driver, see {{AUR|macbook12-bluetooth-driver}}<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified Extensible Firmware Interface#Remove UEFI boot support from optical media]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot<br />
<br />
The bootloader in use was [http://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
mkdir /boot/EFI<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [http://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working as of 2015-11-20, with newer firmware necessary for working 5GHz support ([https://bugzilla.kernel.org/show_bug.cgi?id=100201#c65 see here.])<br />
<br />
{{<br />
Note| On the Macbook Pro 12,1 if the {{ic|brcmfmac}} driver can not be started and the following errors occur in the journal:<br />
<br />
{{bc|<nowiki><br />
brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported<br />
brcmfmac: brcmf_pcie_probe: failed 14e4:43ba<br />
</nowiki>}}<br />
<br />
then check whether [[Power_management#PCI_Runtime_Power_Management|PCI runtime power management]] is enabled on the device, and disable it if so.<br />
<br />
}}<br />
<br />
===== Bluetooth =====<br />
Bluetooth is fully supported starting from kernel-4.4.0.<br />
<br />
===== Suspend & Power Off (11,4+) =====<br />
The 11,4 and 11,5 MacBook Pros do not shutdown or suspend correctly with the default kernel. This issue is being addressed in [https://bugzilla.kernel.org/show_bug.cgi?id=103211 Bug 103211] and a temporary patch is currently available in {{AUR|linux-macbook}}. Note that [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/pci/fixup.c?h=v4.13-rc1&id=13cfc732160f7bc7e596128ce34cda361c556966 Linux 4.13.0] has this patch included, and will be released shortly.<br />
<br />
===== Keyboard & Trackpad =====<br />
Haptic feedback works out of the box due to the trackpad's built-in firmware.<br />
<br />
There are several drivers available that provide multitouch support. The following have been confirmed working with the MacBookPro12,1.<br />
<br />
For {{Pkg|xf86-input-libinput}} the following configuration emulates some features from the OS X functionality. For more options see {{man|4|libinput}}.<br />
{{hc|1=/etc/X11/xorg.conf.d/90-libinput.conf|2=<br />
Section "InputClass"<br />
Identifier "libinput touchpad catchall"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "libinput"<br />
Option "NaturalScrolling" "true"<br />
EndSection<br />
}}<br />
<br />
For {{Pkg|xf86-input-synaptics}} the following configuration is necessary to make the touchpad work fully.<br />
{{hc|1=/etc/X11/xorg.conf.d/60-magictrackpad.conf|2=<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
}}<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
{{hc|1=/etc/modprobe.d/hid_apple.conf|2=<br />
options hid_apple iso_layout=0<br />
}}<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Intel-only graphics, install the {{Pkg|xf86-video-intel}} package. For more information or OpenGL/3D support, follow instructions at [[Intel graphics]].<br />
<br />
As of {{Pkg|linux}} kernel 4.16.6 dual graphics switching does work on the 11,5 (2015) with Intel modesetting and the AMD GPU utilizing the radeon driver (amdgpu is untested). See [[MacBookPro11,x#Graphics]] to enable the integrated graphics. Once the laptop boots with integrated graphics enabled you can use VGA Switcheroo controls to power down the discrete GPU. However, if you keep it powered on you will be able to utilize HDMI connections and using {{AUR|switcheroo-control}} you can run applications on the AMD GPU.<br />
<br />
{{Note|The kernel parameters ''acpi_backlight'', ''i915.lvds_downclock'', ''i915.enable_ips'', and ''intel_iommu'' are no longer necessary as of kernel 4.2.}}<br />
{{Note|(Kernel 4.10.8, MacBook Pro 11,4+) If you experience system lock ups and/or tearing in Xorg, remove the .{{Pkg|xf86-video-intel}} completely, including any config file you made for it. Xorg will default to its modesetting DDX driver. The performance of this driver is good and the locks go away. See also: [[Intel graphics]]}}<br />
<br />
{{Note|If you are experiencing flickering issues with Xorg, you can set ''i915.enable_rc6'' to 0 parameter into the kernel parameters which will disable to power saving of [[Intel graphics]].}}<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be exactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{Pkg|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
* There is no driver for the webcam yet.<br />
* rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [http://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [http://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [[Installation guide]] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub. First, install {{Pkg|grub}} {{Pkg|efibootmgr}}, then:<br />
<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
<br />
{{Style|Section is written like a blog post}}<br />
<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk or CPU-intensive. Also had an occasion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
[https://web.archive.org/web/20140908060927/http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[https://web.archive.org/web/20140908060925/http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[https://web.archive.org/web/20140908060928/http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
{{Note | Same problem in 2017 with a Macbook Air early 2014. Updating the firmware (via migration to macOS Sierra) solved the issue.}}<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 or 256 GB drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I have not seen the issue since.<br />
<br />
There are more steps on how to resolve this issue in [https://bbs.archlinux.org/viewtopic.php?pid=1562168#p1562168 this thread on the Arch forum]<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Adding the kernel parameter "acpi_osi=!Darwin" to your bootloader fixes the problem, though may have other side effects including disabling the thunderbolt port.<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{Pkg|broadcom-wl-dkms}} to connect to a network. If booting from the official Arch Linux ISO, one needs to unload a few standard modules in order to use the included wl module. Do so as follows:<br />
# rmmod b43 ssb bcma wl<br />
<br />
Now simply load the wl module:<br />
# modprobe wl<br />
<br />
This should automatically load the onboard wifi which can be seen by issuing: {{ic|ip a}}. From here follow the [[WPA supplicant#Connecting with wpa_cli]] article to bring up the wireless network.<br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
ALSA may recognise the HDMI audio out as card 0 which will be the default card. Confirm this by checking the output of<br />
aplay -l<br />
<br />
If that is the case, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.ctl.card 1<br />
<br />
to use the HDA Intel card, ie. the built-in speakers / headphones.<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding {{ic|1=intremap=off}} fixes this. Additionally, there are problems loading the {{ic|applesmc}} module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|xf86-input-mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. <br />
<br />
==== Mid 2009 — version 2,1 ====<br />
<br />
Everything works, except the WIFI. You need to [[install]] the {{Pkg|b43-fwcutter}} and {{AUR|b43-firmware}} packages.<br />
<br />
[[Append]] {{ic|1=options b43 pio=1 qos=0}} to {{ic|/etc/modprobe.d/b43.conf}}.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need the {{Pkg|b43-fwcutter}} package (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you cannot get any result by scanning wireless network after boot, unload modules {{ic|b43}} and {{ic|ssb}} and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding {{ic|1=pio=1,qos=0}} options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [https://github.com/d4ve01f/ArchLinux-on-MacBook-Air How to install Archlinux on Macbook Air (6,2) — Davide Di Francesco]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [https://github.com/Geek-Almighty/Arch-LInux-Files/blob/master/MBArchSetup%20v01 MacBook Air (7,2) — A.N Geek]<br />
<br />
* '''MacBook Pro'''<br />
<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/</div>Kousuhttps://wiki.archlinux.org/index.php?title=User_talk:Aparthia/Stata&diff=380469User talk:Aparthia/Stata2015-06-29T18:38:19Z<p>Kousu: </p>
<hr />
<div>== Symlinking ==<br />
<br />
@Fengchao has said "symlink like this is always frowned upon. If so name is changed, it usually means not backward compatiable. So fix the package or rebuild it. Do not use this walk around.". This is true, but Stata is a closed source program and we *cannot* rebuild it. R with RStudio or Python with IPython Notebook are very serviceable substitutes for Stata. If you *must* use Stata though, you have to cow to these. There are similar workarounds needed to get Mathematica on any Linux distribution which has not been Wolfram Approved.<br />
<br />
As of Stata14, the instructions *are* out of date though, and I'm not sure why. stata (the command line interface) works exactly as advertised. But xstata flashes its splash screen and then exits, apparently gracefully. Under strace, I see the following; all the libraries it mentions exist (and none of them are libgnomeprint or libgtksourceview). [https://gist.github.com/anonymous/ceed7a3e6fa29475b8ff]<br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 01:13, 15 May 2015 (UTC)<br />
<br />
:Nevertheless, the argument still stands, especially when there is an old version of the lib available in the AUR: {{AUR|libgtksourceviewmm}}<br />
:Also, please don't dump such huge outputs into the wiki, use some pastebin service instead and only provide a link.<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:46, 15 May 2015 (UTC)<br />
<br />
::But libgtksourceviewmm doesn't build because, among other reasons, it wants gtksourceview-1.0, even after going through several layers of lying to it to try to get it to build against gtksourceview2. Don't edit the wiki without testing if it works!<br />
::<br />
::(Do you really trust github more than the archwiki for continuity?)<br />
::[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 18:38, 29 June 2015 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=User_talk:Aparthia/Stata&diff=373733User talk:Aparthia/Stata2015-05-15T01:15:12Z<p>Kousu: Effective Use Of Headers</p>
<hr />
<div>== Symlinking ==<br />
<br />
@Fengchao has said "symlink like this is always frowned upon. If so name is changed, it usually means not backward compatiable. So fix the package or rebuild it. Do not use this walk around.". This is true, but Stata is a closed source program and we *cannot* rebuild it. R with RStudio or Python with IPython Notebook are very serviceable substitutes for Stata. If you *must* use Stata though, you have to cow to these. There are similar workarounds needed to get Mathematica on any Linux distribution which has not been Wolfram Approved.<br />
<br />
As of Stata14, the instructions *are* out of date though, and I'm not sure why. stata (the command line interface) works exactly as advertised. But xstata flashes its splash screen and then exits, apparently gracefully. Under strace, I see the following; all the libraries it mentions exist (and none of them are libgnomeprint or libgtksourceview).<br />
<pre><br />
execve("/usr/local/stata/xstata", ["xstata"], [/* 45 vars */]) = 0<br />
brk(0) = 0x4fd3000<br />
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br />
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=219849, ...}) = 0<br />
mmap(NULL, 219849, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f67058c8000<br />
close(3) = 0<br />
open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \222\6\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=4452840, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c7000<br />
mmap(NULL, 6558952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670509b000<br />
mprotect(0x7f67054cf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67056cf000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x434000) = 0x7f67056cf000<br />
mmap(0x7f67056da000, 9448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67056da000<br />
close(3) = 0<br />
open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\341\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=744824, ...}) = 0<br />
mmap(NULL, 2841400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704de5000<br />
mprotect(0x7f6704e95000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6705095000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb0000) = 0x7f6705095000<br />
close(3) = 0<br />
open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\266\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155232, ...}) = 0<br />
mmap(NULL, 2251816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704bbf000<br />
mprotect(0x7f6704be2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704de1000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6704de1000<br />
close(3) = 0<br />
open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0w\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155480, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c6000<br />
mmap(NULL, 2250976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704999000<br />
mprotect(0x7f67049bd000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704bbd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f6704bbd000<br />
close(3) = 0<br />
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20U\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1067384, ...}) = 0<br />
mmap(NULL, 3162456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704694000<br />
mprotect(0x7f6704797000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704997000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x103000) = 0x7f6704997000<br />
close(3) = 0<br />
open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PI\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=52560, ...}) = 0<br />
mmap(NULL, 2147904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704487000<br />
mprotect(0x7f6704493000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704692000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f6704692000<br />
close(3) = 0<br />
open("/usr/lib/libpango-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\325\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=310672, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c5000<br />
mmap(NULL, 2406688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670423b000<br />
mprotect(0x7f6704284000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704484000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x49000) = 0x7f6704484000<br />
close(3) = 0<br />
open("/usr/lib/libcairo.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@B\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1240536, ...}) = 0<br />
mmap(NULL, 3342320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703f0b000<br />
mprotect(0x7f6704035000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704235000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12a000) = 0x7f6704235000<br />
mmap(0x7f670423a000, 4080, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670423a000<br />
close(3) = 0<br />
open("/usr/lib/libgobject-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \264\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=330848, ...}) = 0<br />
mmap(NULL, 2428872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703cba000<br />
mprotect(0x7f6703d09000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703f09000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4f000) = 0x7f6703f09000<br />
close(3) = 0<br />
open("/usr/lib/libgmodule-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\21\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14608, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c4000<br />
mmap(NULL, 2109880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703ab6000<br />
mprotect(0x7f6703ab9000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703cb8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703cb8000<br />
close(3) = 0<br />
open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14600, ...}) = 0<br />
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67038b2000<br />
mprotect(0x7f67038b4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703ab4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703ab4000<br />
close(3) = 0<br />
open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\246\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1102960, ...}) = 0<br />
mmap(NULL, 3200680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67035a4000<br />
mprotect(0x7f67036b0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67038af000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10b000) = 0x7f67038af000<br />
mmap(0x7f67038b1000, 1704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67038b1000<br />
close(3) = 0<br />
open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6096, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c3000<br />
mmap(NULL, 2101320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67033a2000<br />
mprotect(0x7f67033a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67035a2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f67035a2000<br />
close(3) = 0<br />
open("/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\271\5\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1486936, ...}) = 0<br />
mmap(NULL, 3204768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703093000<br />
mprotect(0x7f6703183000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703383000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf0000) = 0x7f6703383000<br />
mmap(0x7f670338d000, 83616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670338d000<br />
close(3) = 0<br />
open("/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260*\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=544920, ...}) = 0<br />
mmap(NULL, 2186016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702e7d000<br />
mprotect(0x7f6702e93000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703092000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f6703092000<br />
close(3) = 0<br />
open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=142912, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c2000<br />
mmap(NULL, 2213136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702c60000<br />
mprotect(0x7f6702c78000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702e77000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6702e77000<br />
mmap(0x7f6702e79000, 13584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702e79000<br />
close(3) = 0<br />
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \t\2\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1984880, ...}) = 0<br />
mmap(NULL, 3813008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67028bd000<br />
mprotect(0x7f6702a56000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702c56000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x199000) = 0x7f6702c56000<br />
mmap(0x7f6702c5c000, 16016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702c5c000<br />
close(3) = 0<br />
open("/usr/lib/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=248792, ...}) = 0<br />
mmap(NULL, 2344552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702680000<br />
mprotect(0x7f67026bb000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67028ba000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3a000) = 0x7f67028ba000<br />
close(3) = 0<br />
open("/usr/lib/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\335\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1314936, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c1000<br />
mmap(NULL, 3412192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670233e000<br />
mprotect(0x7f6702479000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702678000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a000) = 0x7f6702678000<br />
mmap(0x7f670267f000, 224, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670267f000<br />
close(3) = 0<br />
open("/usr/lib/libXfixes.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22576, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702138000<br />
mprotect(0x7f670213d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670233c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f670233c000<br />
close(3) = 0<br />
open("/usr/lib/libgio-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320K\3\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1558416, ...}) = 0<br />
mmap(NULL, 3661096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701dba000<br />
mprotect(0x7f6701f30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702130000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x176000) = 0x7f6702130000<br />
mmap(0x7f6702136000, 7464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702136000<br />
close(3) = 0<br />
open("/usr/lib/libpangoft2-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360s\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=90192, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c0000<br />
mmap(NULL, 2185760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701ba4000<br />
mprotect(0x7f6701bb8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701db8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f6701db8000<br />
close(3) = 0<br />
open("/usr/lib/libXrender.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39488, ...}) = 0<br />
mmap(NULL, 2134760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670199a000<br />
mprotect(0x7f67019a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701ba2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701ba2000<br />
close(3) = 0<br />
open("/usr/lib/libXinerama.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\v\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10392, ...}) = 0<br />
mmap(NULL, 2105672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701797000<br />
mprotect(0x7f6701799000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701998000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6701998000<br />
close(3) = 0<br />
open("/usr/lib/libXi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=68016, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bf000<br />
mmap(NULL, 2163464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701586000<br />
mprotect(0x7f6701595000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701795000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6701795000<br />
close(3) = 0<br />
open("/usr/lib/libXrandr.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39184, ...}) = 0<br />
mmap(NULL, 2134472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670137c000<br />
mprotect(0x7f6701385000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701584000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701584000<br />
close(3) = 0<br />
open("/usr/lib/libXcursor.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p+\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=43680, ...}) = 0<br />
mmap(NULL, 2138928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701171000<br />
mprotect(0x7f670117b000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670137a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7f670137a000<br />
close(3) = 0<br />
open("/usr/lib/libXcomposite.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10256, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058be000<br />
mmap(NULL, 2105512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700f6e000<br />
mprotect(0x7f6700f70000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670116f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f670116f000<br />
close(3) = 0<br />
open("/usr/lib/libXdamage.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10280, ...}) = 0<br />
mmap(NULL, 2105544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700d6b000<br />
mprotect(0x7f6700d6d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700f6c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6700f6c000<br />
close(3) = 0<br />
open("/usr/lib/libXext.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p9\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73688, ...}) = 0<br />
mmap(NULL, 2169560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700b59000<br />
mprotect(0x7f6700b6a000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700d69000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f6700d69000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bd000<br />
open("/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p^\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=220288, ...}) = 0<br />
mmap(NULL, 2315456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700923000<br />
mprotect(0x7f6700958000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700b57000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34000) = 0x7f6700b57000<br />
close(3) = 0<br />
open("/usr/lib/libharfbuzz.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@u\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=380544, ...}) = 0<br />
mmap(NULL, 2476944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67006c6000<br />
mprotect(0x7f6700720000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670091f000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x59000) = 0x7f670091f000<br />
close(3) = 0<br />
open("/usr/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\3\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=774136, ...}) = 0<br />
mmap(NULL, 2869288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700409000<br />
mprotect(0x7f67004bf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67006bf000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb6000) = 0x7f67006bf000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bc000<br />
open("/usr/lib/libpixman-1.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\246\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=707360, ...}) = 0<br />
mmap(NULL, 2802728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670015c000<br />
mprotect(0x7f6700201000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700400000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa4000) = 0x7f6700400000<br />
close(3) = 0<br />
open("/usr/lib/libEGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`d\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=169096, ...}) = 0<br />
mmap(NULL, 2265592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fff32000<br />
mprotect(0x7f66fff59000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6700159000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f6700159000<br />
mmap(0x7f670015b000, 504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670015b000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shm.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14384, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bb000<br />
mmap(NULL, 2109560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffd2e000<br />
mprotect(0x7f66ffd30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fff30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fff30000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-render.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@8\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39040, ...}) = 0<br />
mmap(NULL, 2134216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffb24000<br />
mprotect(0x7f66ffb2d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffd2c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f66ffd2c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\244\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=137968, ...}) = 0<br />
mmap(NULL, 2233352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff902000<br />
mprotect(0x7f66ff923000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffb22000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0x7f66ffb22000<br />
close(3) = 0<br />
open("/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=88592, ...}) = 0<br />
mmap(NULL, 2183688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff6ec000<br />
mprotect(0x7f66ff701000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff900000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f66ff900000<br />
close(3) = 0<br />
open("/usr/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\250\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=635496, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ba000<br />
mmap(NULL, 2733384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff450000<br />
mprotect(0x7f66ff4e8000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff6e7000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x97000) = 0x7f66ff6e7000<br />
mmap(0x7f66ff6eb000, 1352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66ff6eb000<br />
close(3) = 0<br />
open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=31688, ...}) = 0<br />
mmap(NULL, 2128856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff248000<br />
mprotect(0x7f66ff24f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff44e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66ff44e000<br />
close(3) = 0<br />
open("/usr/lib/libffi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\33\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=35216, ...}) = 0<br />
mmap(NULL, 2131688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff03f000<br />
mprotect(0x7f66ff047000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff246000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f66ff246000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b9000<br />
open("/usr/lib/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=456960, ...}) = 0<br />
mmap(NULL, 2552424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fedcf000<br />
mprotect(0x7f66fee3d000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66ff03d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6e000) = 0x7f66ff03d000<br />
close(3) = 0<br />
open("/usr/lib/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`?\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170144, ...}) = 0<br />
mmap(NULL, 2265320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66feba5000<br />
mprotect(0x7f66febcc000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fedcb000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fedcb000<br />
close(3) = 0<br />
open("/usr/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3209\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=84856, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b8000<br />
mmap(NULL, 2190152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe98e000<br />
mprotect(0x7f66fe9a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66feba1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7f66feba1000<br />
mmap(0x7f66feba3000, 6984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66feba3000<br />
close(3) = 0<br />
open("/usr/lib/libgraphite2.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260(\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=121184, ...}) = 0<br />
mmap(NULL, 2216376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe770000<br />
mprotect(0x7f66fe78c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe98b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f66fe98b000<br />
close(3) = 0<br />
open("/usr/lib/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=65760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b7000<br />
mmap(NULL, 2160936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe560000<br />
mprotect(0x7f66fe56f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe76e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x7f66fe76e000<br />
close(3) = 0<br />
open("/usr/lib/libX11-xcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6008, ...}) = 0<br />
mmap(NULL, 2101304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe35e000<br />
mprotect(0x7f66fe35f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe55e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f66fe55e000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri2.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\32\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=18480, ...}) = 0<br />
mmap(NULL, 2113656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe159000<br />
mprotect(0x7f66fe15d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe35c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f66fe35c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-xfixes.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=30768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b6000<br />
mmap(NULL, 2125944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdf51000<br />
mprotect(0x7f66fdf57000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fe157000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66fe157000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shape.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14368, ...}) = 0<br />
mmap(NULL, 2109544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdd4d000<br />
mprotect(0x7f66fdd50000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdf4f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fdf4f000<br />
close(3) = 0<br />
open("/usr/lib/libgbm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=56552, ...}) = 0<br />
mmap(NULL, 2152016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdb3f000<br />
mprotect(0x7f66fdb4c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdd4b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fdd4b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-client.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000Q\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=60760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b5000<br />
mmap(NULL, 2155944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd930000<br />
mprotect(0x7f66fd93c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdb3b000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f66fdb3b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-server.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pd\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73368, ...}) = 0<br />
mmap(NULL, 2168776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd71e000<br />
mprotect(0x7f66fd72e000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd92d000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f66fd92d000<br />
close(3) = 0<br />
open("/usr/lib/libglapi.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\233\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170352, ...}) = 0<br />
mmap(NULL, 2271752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd4f3000<br />
mprotect(0x7f66fd519000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd719000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fd719000<br />
mmap(0x7f66fd71d000, 2568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66fd71d000<br />
close(3) = 0<br />
open("/usr/lib/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P7\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b4000<br />
mmap(NULL, 2153616, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd2e5000<br />
mprotect(0x7f66fd2f1000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd4f1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fd4f1000<br />
close(3) = 0<br />
open("/usr/lib/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \17\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14512, ...}) = 0<br />
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd0e1000<br />
mprotect(0x7f66fd0e3000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd2e3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fd2e3000<br />
close(3) = 0<br />
open("/usr/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22688, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcedb000<br />
mprotect(0x7f66fcee0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd0df000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fd0df000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b3000<br />
open("/usr/lib/libxcb-glx.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\247\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=104480, ...}) = 0<br />
mmap(NULL, 2199656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fccc1000<br />
mprotect(0x7f66fccd8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fced8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f66fced8000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri3.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10288, ...}) = 0<br />
mmap(NULL, 2105464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcabe000<br />
mprotect(0x7f66fcac0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fccbf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fccbf000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-present.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10272, ...}) = 0<br />
mmap(NULL, 2105448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc8bb000<br />
mprotect(0x7f66fc8bd000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fcabc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fcabc000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-randr.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55520, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b2000<br />
mmap(NULL, 2150696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc6ad000<br />
mprotect(0x7f66fc6ba000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc8b9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fc8b9000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-sync.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=26752, ...}) = 0<br />
mmap(NULL, 2121928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc4a6000<br />
mprotect(0x7f66fc4ab000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc6ab000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f66fc6ab000<br />
close(3) = 0<br />
open("/usr/lib/libxshmfence.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\t\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10248, ...}) = 0<br />
mmap(NULL, 2105472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc2a3000<br />
mprotect(0x7f66fc2a4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc4a4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fc4a4000<br />
close(3) = 0<br />
open("/usr/lib/libXxf86vm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b1000<br />
mmap(NULL, 2118024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc09d000<br />
mprotect(0x7f66fc0a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc2a1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fc2a1000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b0000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058af000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ae000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ad000<br />
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ab000<br />
arch_prctl(ARCH_SET_FS, 0x7f67058ab8c0) = 0<br />
mprotect(0x7f6702c56000, 16384, PROT_READ) = 0<br />
mprotect(0x7f66fd2e3000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd0df000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffb22000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703ab4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702678000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6700d69000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc2a1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc4a4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc6ab000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc8b9000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fcabc000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fccbf000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fced8000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fd4f1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702e77000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd719000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704997000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff44e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff246000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd92d000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fdb3b000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fedcb000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fdd4b000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fdf4f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe157000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe35c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe55e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe98b000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66feba1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff03d000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670233c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700f6c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffd2c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff6e7000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66ff900000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fff30000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700159000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700400000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6700b57000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67038af000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67006bf000, 24576, PROT_READ) = 0<br />
mprotect(0x7f670091f000, 12288, PROT_READ) = 0<br />
mprotect(0x7f670116f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701ba2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670137a000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701584000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701795000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701998000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703f09000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703cb8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67035a2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704484000, 8192, PROT_READ) = 0<br />
mprotect(0x7f67028ba000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6701db8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702130000, 16384, PROT_READ) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058aa000<br />
mprotect(0x7f6703383000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6704235000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704692000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704bbd000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704de1000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6705095000, 16384, PROT_READ) = 0<br />
mprotect(0x7f67056cf000, 28672, PROT_READ) = 0<br />
mprotect(0x7f67058fe000, 4096, PROT_READ) = 0<br />
munmap(0x7f67058c8000, 219849) = 0<br />
set_tid_address(0x7f67058abb90) = 16265<br />
set_robust_list(0x7f67058abba0, 24) = 0<br />
rt_sigaction(SIGRTMIN, {0x7f6702c65bb0, [], SA_RESTORER|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigaction(SIGRT_1, {0x7f6702c65c40, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br />
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0<br />
brk(0) = 0x4fd3000<br />
brk(0x4ff4000) = 0x4ff4000<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb0c, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb18, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
brk(0x5015000) = 0x5015000<br />
brk(0x5036000) = 0x5036000<br />
brk(0x5057000) = 0x5057000<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/.user_prefs", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/:0.0", 0755) = 0<br />
umask(022) = 0<br />
unlink("/tmp/SQ16265.000001") = -1 ENOENT (No such file or directory)<br />
unlink("/tmp/SQ16265.000002") = -1 ENOENT (No such file or directory)<br />
open("/home/kousu/.stata14/:0.0/stata14.rc", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f67058abb90) = 16266<br />
exit_group(0) = ?<br />
+++ exited with 0 +++<br />
</pre><br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 01:13, 15 May 2015 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=User_talk:Aparthia/Stata&diff=373732User talk:Aparthia/Stata2015-05-15T01:14:33Z<p>Kousu: </p>
<hr />
<div>== Symlinking<br />
<br />
@Fengchao has said "symlink like this is always frowned upon. If so name is changed, it usually means not backward compatiable. So fix the package or rebuild it. Do not use this walk around.". This is true, but Stata is a closed source program and we *cannot* rebuild it. R with RStudio or Python with IPython Notebook are very serviceable substitutes for Stata. If you *must* use Stata though, you have to cow to these. There are similar workarounds needed to get Mathematica on any Linux distribution which has not been Wolfram Approved.<br />
<br />
As of Stata14, the instructions *are* out of date though, and I'm not sure why. stata (the command line interface) works exactly as advertised. But xstata flashes its splash screen and then exits, apparently gracefully. Under strace, I see the following; all the libraries it mentions exist (and none of them are libgnomeprint or libgtksourceview).<br />
<pre><br />
execve("/usr/local/stata/xstata", ["xstata"], [/* 45 vars */]) = 0<br />
brk(0) = 0x4fd3000<br />
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br />
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=219849, ...}) = 0<br />
mmap(NULL, 219849, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f67058c8000<br />
close(3) = 0<br />
open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \222\6\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=4452840, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c7000<br />
mmap(NULL, 6558952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670509b000<br />
mprotect(0x7f67054cf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67056cf000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x434000) = 0x7f67056cf000<br />
mmap(0x7f67056da000, 9448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67056da000<br />
close(3) = 0<br />
open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\341\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=744824, ...}) = 0<br />
mmap(NULL, 2841400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704de5000<br />
mprotect(0x7f6704e95000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6705095000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb0000) = 0x7f6705095000<br />
close(3) = 0<br />
open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\266\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155232, ...}) = 0<br />
mmap(NULL, 2251816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704bbf000<br />
mprotect(0x7f6704be2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704de1000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6704de1000<br />
close(3) = 0<br />
open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0w\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155480, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c6000<br />
mmap(NULL, 2250976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704999000<br />
mprotect(0x7f67049bd000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704bbd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f6704bbd000<br />
close(3) = 0<br />
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20U\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1067384, ...}) = 0<br />
mmap(NULL, 3162456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704694000<br />
mprotect(0x7f6704797000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704997000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x103000) = 0x7f6704997000<br />
close(3) = 0<br />
open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PI\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=52560, ...}) = 0<br />
mmap(NULL, 2147904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704487000<br />
mprotect(0x7f6704493000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704692000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f6704692000<br />
close(3) = 0<br />
open("/usr/lib/libpango-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\325\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=310672, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c5000<br />
mmap(NULL, 2406688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670423b000<br />
mprotect(0x7f6704284000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704484000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x49000) = 0x7f6704484000<br />
close(3) = 0<br />
open("/usr/lib/libcairo.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@B\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1240536, ...}) = 0<br />
mmap(NULL, 3342320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703f0b000<br />
mprotect(0x7f6704035000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704235000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12a000) = 0x7f6704235000<br />
mmap(0x7f670423a000, 4080, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670423a000<br />
close(3) = 0<br />
open("/usr/lib/libgobject-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \264\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=330848, ...}) = 0<br />
mmap(NULL, 2428872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703cba000<br />
mprotect(0x7f6703d09000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703f09000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4f000) = 0x7f6703f09000<br />
close(3) = 0<br />
open("/usr/lib/libgmodule-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\21\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14608, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c4000<br />
mmap(NULL, 2109880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703ab6000<br />
mprotect(0x7f6703ab9000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703cb8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703cb8000<br />
close(3) = 0<br />
open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14600, ...}) = 0<br />
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67038b2000<br />
mprotect(0x7f67038b4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703ab4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703ab4000<br />
close(3) = 0<br />
open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\246\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1102960, ...}) = 0<br />
mmap(NULL, 3200680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67035a4000<br />
mprotect(0x7f67036b0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67038af000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10b000) = 0x7f67038af000<br />
mmap(0x7f67038b1000, 1704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67038b1000<br />
close(3) = 0<br />
open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6096, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c3000<br />
mmap(NULL, 2101320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67033a2000<br />
mprotect(0x7f67033a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67035a2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f67035a2000<br />
close(3) = 0<br />
open("/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\271\5\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1486936, ...}) = 0<br />
mmap(NULL, 3204768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703093000<br />
mprotect(0x7f6703183000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703383000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf0000) = 0x7f6703383000<br />
mmap(0x7f670338d000, 83616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670338d000<br />
close(3) = 0<br />
open("/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260*\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=544920, ...}) = 0<br />
mmap(NULL, 2186016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702e7d000<br />
mprotect(0x7f6702e93000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703092000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f6703092000<br />
close(3) = 0<br />
open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=142912, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c2000<br />
mmap(NULL, 2213136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702c60000<br />
mprotect(0x7f6702c78000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702e77000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6702e77000<br />
mmap(0x7f6702e79000, 13584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702e79000<br />
close(3) = 0<br />
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \t\2\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1984880, ...}) = 0<br />
mmap(NULL, 3813008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67028bd000<br />
mprotect(0x7f6702a56000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702c56000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x199000) = 0x7f6702c56000<br />
mmap(0x7f6702c5c000, 16016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702c5c000<br />
close(3) = 0<br />
open("/usr/lib/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=248792, ...}) = 0<br />
mmap(NULL, 2344552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702680000<br />
mprotect(0x7f67026bb000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67028ba000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3a000) = 0x7f67028ba000<br />
close(3) = 0<br />
open("/usr/lib/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\335\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1314936, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c1000<br />
mmap(NULL, 3412192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670233e000<br />
mprotect(0x7f6702479000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702678000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a000) = 0x7f6702678000<br />
mmap(0x7f670267f000, 224, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670267f000<br />
close(3) = 0<br />
open("/usr/lib/libXfixes.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22576, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702138000<br />
mprotect(0x7f670213d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670233c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f670233c000<br />
close(3) = 0<br />
open("/usr/lib/libgio-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320K\3\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1558416, ...}) = 0<br />
mmap(NULL, 3661096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701dba000<br />
mprotect(0x7f6701f30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702130000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x176000) = 0x7f6702130000<br />
mmap(0x7f6702136000, 7464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702136000<br />
close(3) = 0<br />
open("/usr/lib/libpangoft2-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360s\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=90192, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c0000<br />
mmap(NULL, 2185760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701ba4000<br />
mprotect(0x7f6701bb8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701db8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f6701db8000<br />
close(3) = 0<br />
open("/usr/lib/libXrender.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39488, ...}) = 0<br />
mmap(NULL, 2134760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670199a000<br />
mprotect(0x7f67019a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701ba2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701ba2000<br />
close(3) = 0<br />
open("/usr/lib/libXinerama.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\v\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10392, ...}) = 0<br />
mmap(NULL, 2105672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701797000<br />
mprotect(0x7f6701799000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701998000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6701998000<br />
close(3) = 0<br />
open("/usr/lib/libXi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=68016, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bf000<br />
mmap(NULL, 2163464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701586000<br />
mprotect(0x7f6701595000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701795000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6701795000<br />
close(3) = 0<br />
open("/usr/lib/libXrandr.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39184, ...}) = 0<br />
mmap(NULL, 2134472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670137c000<br />
mprotect(0x7f6701385000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701584000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701584000<br />
close(3) = 0<br />
open("/usr/lib/libXcursor.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p+\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=43680, ...}) = 0<br />
mmap(NULL, 2138928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701171000<br />
mprotect(0x7f670117b000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670137a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7f670137a000<br />
close(3) = 0<br />
open("/usr/lib/libXcomposite.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10256, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058be000<br />
mmap(NULL, 2105512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700f6e000<br />
mprotect(0x7f6700f70000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670116f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f670116f000<br />
close(3) = 0<br />
open("/usr/lib/libXdamage.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10280, ...}) = 0<br />
mmap(NULL, 2105544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700d6b000<br />
mprotect(0x7f6700d6d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700f6c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6700f6c000<br />
close(3) = 0<br />
open("/usr/lib/libXext.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p9\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73688, ...}) = 0<br />
mmap(NULL, 2169560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700b59000<br />
mprotect(0x7f6700b6a000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700d69000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f6700d69000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bd000<br />
open("/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p^\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=220288, ...}) = 0<br />
mmap(NULL, 2315456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700923000<br />
mprotect(0x7f6700958000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700b57000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34000) = 0x7f6700b57000<br />
close(3) = 0<br />
open("/usr/lib/libharfbuzz.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@u\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=380544, ...}) = 0<br />
mmap(NULL, 2476944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67006c6000<br />
mprotect(0x7f6700720000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670091f000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x59000) = 0x7f670091f000<br />
close(3) = 0<br />
open("/usr/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\3\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=774136, ...}) = 0<br />
mmap(NULL, 2869288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700409000<br />
mprotect(0x7f67004bf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67006bf000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb6000) = 0x7f67006bf000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bc000<br />
open("/usr/lib/libpixman-1.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\246\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=707360, ...}) = 0<br />
mmap(NULL, 2802728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670015c000<br />
mprotect(0x7f6700201000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700400000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa4000) = 0x7f6700400000<br />
close(3) = 0<br />
open("/usr/lib/libEGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`d\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=169096, ...}) = 0<br />
mmap(NULL, 2265592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fff32000<br />
mprotect(0x7f66fff59000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6700159000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f6700159000<br />
mmap(0x7f670015b000, 504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670015b000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shm.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14384, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bb000<br />
mmap(NULL, 2109560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffd2e000<br />
mprotect(0x7f66ffd30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fff30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fff30000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-render.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@8\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39040, ...}) = 0<br />
mmap(NULL, 2134216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffb24000<br />
mprotect(0x7f66ffb2d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffd2c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f66ffd2c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\244\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=137968, ...}) = 0<br />
mmap(NULL, 2233352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff902000<br />
mprotect(0x7f66ff923000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffb22000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0x7f66ffb22000<br />
close(3) = 0<br />
open("/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=88592, ...}) = 0<br />
mmap(NULL, 2183688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff6ec000<br />
mprotect(0x7f66ff701000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff900000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f66ff900000<br />
close(3) = 0<br />
open("/usr/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\250\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=635496, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ba000<br />
mmap(NULL, 2733384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff450000<br />
mprotect(0x7f66ff4e8000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff6e7000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x97000) = 0x7f66ff6e7000<br />
mmap(0x7f66ff6eb000, 1352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66ff6eb000<br />
close(3) = 0<br />
open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=31688, ...}) = 0<br />
mmap(NULL, 2128856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff248000<br />
mprotect(0x7f66ff24f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff44e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66ff44e000<br />
close(3) = 0<br />
open("/usr/lib/libffi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\33\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=35216, ...}) = 0<br />
mmap(NULL, 2131688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff03f000<br />
mprotect(0x7f66ff047000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff246000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f66ff246000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b9000<br />
open("/usr/lib/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=456960, ...}) = 0<br />
mmap(NULL, 2552424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fedcf000<br />
mprotect(0x7f66fee3d000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66ff03d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6e000) = 0x7f66ff03d000<br />
close(3) = 0<br />
open("/usr/lib/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`?\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170144, ...}) = 0<br />
mmap(NULL, 2265320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66feba5000<br />
mprotect(0x7f66febcc000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fedcb000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fedcb000<br />
close(3) = 0<br />
open("/usr/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3209\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=84856, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b8000<br />
mmap(NULL, 2190152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe98e000<br />
mprotect(0x7f66fe9a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66feba1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7f66feba1000<br />
mmap(0x7f66feba3000, 6984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66feba3000<br />
close(3) = 0<br />
open("/usr/lib/libgraphite2.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260(\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=121184, ...}) = 0<br />
mmap(NULL, 2216376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe770000<br />
mprotect(0x7f66fe78c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe98b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f66fe98b000<br />
close(3) = 0<br />
open("/usr/lib/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=65760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b7000<br />
mmap(NULL, 2160936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe560000<br />
mprotect(0x7f66fe56f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe76e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x7f66fe76e000<br />
close(3) = 0<br />
open("/usr/lib/libX11-xcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6008, ...}) = 0<br />
mmap(NULL, 2101304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe35e000<br />
mprotect(0x7f66fe35f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe55e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f66fe55e000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri2.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\32\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=18480, ...}) = 0<br />
mmap(NULL, 2113656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe159000<br />
mprotect(0x7f66fe15d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe35c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f66fe35c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-xfixes.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=30768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b6000<br />
mmap(NULL, 2125944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdf51000<br />
mprotect(0x7f66fdf57000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fe157000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66fe157000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shape.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14368, ...}) = 0<br />
mmap(NULL, 2109544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdd4d000<br />
mprotect(0x7f66fdd50000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdf4f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fdf4f000<br />
close(3) = 0<br />
open("/usr/lib/libgbm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=56552, ...}) = 0<br />
mmap(NULL, 2152016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdb3f000<br />
mprotect(0x7f66fdb4c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdd4b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fdd4b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-client.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000Q\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=60760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b5000<br />
mmap(NULL, 2155944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd930000<br />
mprotect(0x7f66fd93c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdb3b000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f66fdb3b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-server.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pd\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73368, ...}) = 0<br />
mmap(NULL, 2168776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd71e000<br />
mprotect(0x7f66fd72e000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd92d000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f66fd92d000<br />
close(3) = 0<br />
open("/usr/lib/libglapi.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\233\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170352, ...}) = 0<br />
mmap(NULL, 2271752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd4f3000<br />
mprotect(0x7f66fd519000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd719000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fd719000<br />
mmap(0x7f66fd71d000, 2568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66fd71d000<br />
close(3) = 0<br />
open("/usr/lib/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P7\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b4000<br />
mmap(NULL, 2153616, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd2e5000<br />
mprotect(0x7f66fd2f1000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd4f1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fd4f1000<br />
close(3) = 0<br />
open("/usr/lib/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \17\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14512, ...}) = 0<br />
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd0e1000<br />
mprotect(0x7f66fd0e3000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd2e3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fd2e3000<br />
close(3) = 0<br />
open("/usr/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22688, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcedb000<br />
mprotect(0x7f66fcee0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd0df000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fd0df000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b3000<br />
open("/usr/lib/libxcb-glx.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\247\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=104480, ...}) = 0<br />
mmap(NULL, 2199656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fccc1000<br />
mprotect(0x7f66fccd8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fced8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f66fced8000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri3.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10288, ...}) = 0<br />
mmap(NULL, 2105464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcabe000<br />
mprotect(0x7f66fcac0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fccbf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fccbf000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-present.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10272, ...}) = 0<br />
mmap(NULL, 2105448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc8bb000<br />
mprotect(0x7f66fc8bd000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fcabc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fcabc000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-randr.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55520, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b2000<br />
mmap(NULL, 2150696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc6ad000<br />
mprotect(0x7f66fc6ba000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc8b9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fc8b9000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-sync.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=26752, ...}) = 0<br />
mmap(NULL, 2121928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc4a6000<br />
mprotect(0x7f66fc4ab000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc6ab000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f66fc6ab000<br />
close(3) = 0<br />
open("/usr/lib/libxshmfence.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\t\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10248, ...}) = 0<br />
mmap(NULL, 2105472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc2a3000<br />
mprotect(0x7f66fc2a4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc4a4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fc4a4000<br />
close(3) = 0<br />
open("/usr/lib/libXxf86vm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b1000<br />
mmap(NULL, 2118024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc09d000<br />
mprotect(0x7f66fc0a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc2a1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fc2a1000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b0000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058af000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ae000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ad000<br />
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ab000<br />
arch_prctl(ARCH_SET_FS, 0x7f67058ab8c0) = 0<br />
mprotect(0x7f6702c56000, 16384, PROT_READ) = 0<br />
mprotect(0x7f66fd2e3000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd0df000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffb22000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703ab4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702678000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6700d69000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc2a1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc4a4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc6ab000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc8b9000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fcabc000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fccbf000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fced8000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fd4f1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702e77000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd719000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704997000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff44e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff246000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd92d000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fdb3b000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fedcb000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fdd4b000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fdf4f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe157000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe35c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe55e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe98b000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66feba1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff03d000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670233c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700f6c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffd2c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff6e7000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66ff900000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fff30000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700159000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700400000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6700b57000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67038af000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67006bf000, 24576, PROT_READ) = 0<br />
mprotect(0x7f670091f000, 12288, PROT_READ) = 0<br />
mprotect(0x7f670116f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701ba2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670137a000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701584000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701795000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701998000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703f09000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703cb8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67035a2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704484000, 8192, PROT_READ) = 0<br />
mprotect(0x7f67028ba000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6701db8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702130000, 16384, PROT_READ) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058aa000<br />
mprotect(0x7f6703383000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6704235000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704692000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704bbd000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704de1000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6705095000, 16384, PROT_READ) = 0<br />
mprotect(0x7f67056cf000, 28672, PROT_READ) = 0<br />
mprotect(0x7f67058fe000, 4096, PROT_READ) = 0<br />
munmap(0x7f67058c8000, 219849) = 0<br />
set_tid_address(0x7f67058abb90) = 16265<br />
set_robust_list(0x7f67058abba0, 24) = 0<br />
rt_sigaction(SIGRTMIN, {0x7f6702c65bb0, [], SA_RESTORER|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigaction(SIGRT_1, {0x7f6702c65c40, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br />
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0<br />
brk(0) = 0x4fd3000<br />
brk(0x4ff4000) = 0x4ff4000<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb0c, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb18, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
brk(0x5015000) = 0x5015000<br />
brk(0x5036000) = 0x5036000<br />
brk(0x5057000) = 0x5057000<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/.user_prefs", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/:0.0", 0755) = 0<br />
umask(022) = 0<br />
unlink("/tmp/SQ16265.000001") = -1 ENOENT (No such file or directory)<br />
unlink("/tmp/SQ16265.000002") = -1 ENOENT (No such file or directory)<br />
open("/home/kousu/.stata14/:0.0/stata14.rc", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f67058abb90) = 16266<br />
exit_group(0) = ?<br />
+++ exited with 0 +++<br />
</pre><br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 01:13, 15 May 2015 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=User_talk:Aparthia/Stata&diff=373731User talk:Aparthia/Stata2015-05-15T01:13:23Z<p>Kousu: Clearing up some out of date information on stata compatibility</p>
<hr />
<div>== Symlinking<br />
<br />
@Fengchao has said "symlink like this is always frowned upon. If so name is changed, it usually means not backward compatiable. So fix the package or rebuild it. Do not use this walk around.". This is true, but Stata is a closed source program and we *cannot* rebuild it. R with RStudio or Python with IPython Notebook are very serviceable substitutes for Stata. If you *must* use Stata though, you have to cow to these. There are similar workarounds needed to get Mathematica on any Linux distribution which has not been Wolfram Approved.<br />
<br />
As of Stata14, the instructions *are* out of date though, and I'm not sure why. xstata flashes its splash screen and then exits, apparently gracefully. Under strace, I see the following; all the libraries it mentions exist (and none of them are libgnomeprint or libgtksourceview).<br />
<pre><br />
execve("/usr/local/stata/xstata", ["xstata"], [/* 45 vars */]) = 0<br />
brk(0) = 0x4fd3000<br />
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br />
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=219849, ...}) = 0<br />
mmap(NULL, 219849, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f67058c8000<br />
close(3) = 0<br />
open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \222\6\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=4452840, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c7000<br />
mmap(NULL, 6558952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670509b000<br />
mprotect(0x7f67054cf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67056cf000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x434000) = 0x7f67056cf000<br />
mmap(0x7f67056da000, 9448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67056da000<br />
close(3) = 0<br />
open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\341\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=744824, ...}) = 0<br />
mmap(NULL, 2841400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704de5000<br />
mprotect(0x7f6704e95000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6705095000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb0000) = 0x7f6705095000<br />
close(3) = 0<br />
open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\266\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155232, ...}) = 0<br />
mmap(NULL, 2251816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704bbf000<br />
mprotect(0x7f6704be2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704de1000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6704de1000<br />
close(3) = 0<br />
open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0w\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=155480, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c6000<br />
mmap(NULL, 2250976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704999000<br />
mprotect(0x7f67049bd000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704bbd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f6704bbd000<br />
close(3) = 0<br />
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20U\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1067384, ...}) = 0<br />
mmap(NULL, 3162456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704694000<br />
mprotect(0x7f6704797000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704997000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x103000) = 0x7f6704997000<br />
close(3) = 0<br />
open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PI\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=52560, ...}) = 0<br />
mmap(NULL, 2147904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6704487000<br />
mprotect(0x7f6704493000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6704692000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f6704692000<br />
close(3) = 0<br />
open("/usr/lib/libpango-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\325\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=310672, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c5000<br />
mmap(NULL, 2406688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670423b000<br />
mprotect(0x7f6704284000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704484000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x49000) = 0x7f6704484000<br />
close(3) = 0<br />
open("/usr/lib/libcairo.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@B\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1240536, ...}) = 0<br />
mmap(NULL, 3342320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703f0b000<br />
mprotect(0x7f6704035000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6704235000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12a000) = 0x7f6704235000<br />
mmap(0x7f670423a000, 4080, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670423a000<br />
close(3) = 0<br />
open("/usr/lib/libgobject-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \264\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=330848, ...}) = 0<br />
mmap(NULL, 2428872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703cba000<br />
mprotect(0x7f6703d09000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703f09000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4f000) = 0x7f6703f09000<br />
close(3) = 0<br />
open("/usr/lib/libgmodule-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\21\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14608, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c4000<br />
mmap(NULL, 2109880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703ab6000<br />
mprotect(0x7f6703ab9000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703cb8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703cb8000<br />
close(3) = 0<br />
open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14600, ...}) = 0<br />
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67038b2000<br />
mprotect(0x7f67038b4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703ab4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6703ab4000<br />
close(3) = 0<br />
open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\246\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1102960, ...}) = 0<br />
mmap(NULL, 3200680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67035a4000<br />
mprotect(0x7f67036b0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67038af000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10b000) = 0x7f67038af000<br />
mmap(0x7f67038b1000, 1704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f67038b1000<br />
close(3) = 0<br />
open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6096, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c3000<br />
mmap(NULL, 2101320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67033a2000<br />
mprotect(0x7f67033a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67035a2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f67035a2000<br />
close(3) = 0<br />
open("/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\271\5\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1486936, ...}) = 0<br />
mmap(NULL, 3204768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6703093000<br />
mprotect(0x7f6703183000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6703383000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf0000) = 0x7f6703383000<br />
mmap(0x7f670338d000, 83616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670338d000<br />
close(3) = 0<br />
open("/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260*\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0644, st_size=544920, ...}) = 0<br />
mmap(NULL, 2186016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702e7d000<br />
mprotect(0x7f6702e93000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6703092000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f6703092000<br />
close(3) = 0<br />
open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=142912, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c2000<br />
mmap(NULL, 2213136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702c60000<br />
mprotect(0x7f6702c78000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702e77000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6702e77000<br />
mmap(0x7f6702e79000, 13584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702e79000<br />
close(3) = 0<br />
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \t\2\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1984880, ...}) = 0<br />
mmap(NULL, 3813008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67028bd000<br />
mprotect(0x7f6702a56000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702c56000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x199000) = 0x7f6702c56000<br />
mmap(0x7f6702c5c000, 16016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702c5c000<br />
close(3) = 0<br />
open("/usr/lib/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@p\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=248792, ...}) = 0<br />
mmap(NULL, 2344552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702680000<br />
mprotect(0x7f67026bb000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f67028ba000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3a000) = 0x7f67028ba000<br />
close(3) = 0<br />
open("/usr/lib/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\335\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1314936, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c1000<br />
mmap(NULL, 3412192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670233e000<br />
mprotect(0x7f6702479000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6702678000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13a000) = 0x7f6702678000<br />
mmap(0x7f670267f000, 224, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670267f000<br />
close(3) = 0<br />
open("/usr/lib/libXfixes.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22576, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6702138000<br />
mprotect(0x7f670213d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670233c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f670233c000<br />
close(3) = 0<br />
open("/usr/lib/libgio-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320K\3\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=1558416, ...}) = 0<br />
mmap(NULL, 3661096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701dba000<br />
mprotect(0x7f6701f30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6702130000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x176000) = 0x7f6702130000<br />
mmap(0x7f6702136000, 7464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6702136000<br />
close(3) = 0<br />
open("/usr/lib/libpangoft2-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360s\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=90192, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058c0000<br />
mmap(NULL, 2185760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701ba4000<br />
mprotect(0x7f6701bb8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701db8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f6701db8000<br />
close(3) = 0<br />
open("/usr/lib/libXrender.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39488, ...}) = 0<br />
mmap(NULL, 2134760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670199a000<br />
mprotect(0x7f67019a3000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701ba2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701ba2000<br />
close(3) = 0<br />
open("/usr/lib/libXinerama.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\v\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10392, ...}) = 0<br />
mmap(NULL, 2105672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701797000<br />
mprotect(0x7f6701799000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701998000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6701998000<br />
close(3) = 0<br />
open("/usr/lib/libXi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=68016, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bf000<br />
mmap(NULL, 2163464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701586000<br />
mprotect(0x7f6701595000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6701795000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6701795000<br />
close(3) = 0<br />
open("/usr/lib/libXrandr.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\34\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39184, ...}) = 0<br />
mmap(NULL, 2134472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670137c000<br />
mprotect(0x7f6701385000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6701584000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6701584000<br />
close(3) = 0<br />
open("/usr/lib/libXcursor.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p+\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=43680, ...}) = 0<br />
mmap(NULL, 2138928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6701171000<br />
mprotect(0x7f670117b000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670137a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7f670137a000<br />
close(3) = 0<br />
open("/usr/lib/libXcomposite.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10256, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058be000<br />
mmap(NULL, 2105512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700f6e000<br />
mprotect(0x7f6700f70000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670116f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f670116f000<br />
close(3) = 0<br />
open("/usr/lib/libXdamage.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10280, ...}) = 0<br />
mmap(NULL, 2105544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700d6b000<br />
mprotect(0x7f6700d6d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700f6c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f6700f6c000<br />
close(3) = 0<br />
open("/usr/lib/libXext.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p9\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73688, ...}) = 0<br />
mmap(NULL, 2169560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700b59000<br />
mprotect(0x7f6700b6a000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700d69000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f6700d69000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bd000<br />
open("/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p^\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=220288, ...}) = 0<br />
mmap(NULL, 2315456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700923000<br />
mprotect(0x7f6700958000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700b57000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34000) = 0x7f6700b57000<br />
close(3) = 0<br />
open("/usr/lib/libharfbuzz.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@u\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=380544, ...}) = 0<br />
mmap(NULL, 2476944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f67006c6000<br />
mprotect(0x7f6700720000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f670091f000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x59000) = 0x7f670091f000<br />
close(3) = 0<br />
open("/usr/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\3\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=774136, ...}) = 0<br />
mmap(NULL, 2869288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6700409000<br />
mprotect(0x7f67004bf000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f67006bf000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb6000) = 0x7f67006bf000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bc000<br />
open("/usr/lib/libpixman-1.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\246\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=707360, ...}) = 0<br />
mmap(NULL, 2802728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f670015c000<br />
mprotect(0x7f6700201000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f6700400000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa4000) = 0x7f6700400000<br />
close(3) = 0<br />
open("/usr/lib/libEGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`d\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=169096, ...}) = 0<br />
mmap(NULL, 2265592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fff32000<br />
mprotect(0x7f66fff59000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f6700159000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f6700159000<br />
mmap(0x7f670015b000, 504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f670015b000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shm.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\16\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14384, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058bb000<br />
mmap(NULL, 2109560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffd2e000<br />
mprotect(0x7f66ffd30000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fff30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fff30000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-render.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@8\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=39040, ...}) = 0<br />
mmap(NULL, 2134216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ffb24000<br />
mprotect(0x7f66ffb2d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffd2c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f66ffd2c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\244\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=137968, ...}) = 0<br />
mmap(NULL, 2233352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff902000<br />
mprotect(0x7f66ff923000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ffb22000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0x7f66ffb22000<br />
close(3) = 0<br />
open("/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000#\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=88592, ...}) = 0<br />
mmap(NULL, 2183688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff6ec000<br />
mprotect(0x7f66ff701000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff900000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f66ff900000<br />
close(3) = 0<br />
open("/usr/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\250\1\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=635496, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ba000<br />
mmap(NULL, 2733384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff450000<br />
mprotect(0x7f66ff4e8000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff6e7000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x97000) = 0x7f66ff6e7000<br />
mmap(0x7f66ff6eb000, 1352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66ff6eb000<br />
close(3) = 0<br />
open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=31688, ...}) = 0<br />
mmap(NULL, 2128856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff248000<br />
mprotect(0x7f66ff24f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff44e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66ff44e000<br />
close(3) = 0<br />
open("/usr/lib/libffi.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\33\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=35216, ...}) = 0<br />
mmap(NULL, 2131688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66ff03f000<br />
mprotect(0x7f66ff047000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66ff246000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f66ff246000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b9000<br />
open("/usr/lib/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=456960, ...}) = 0<br />
mmap(NULL, 2552424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fedcf000<br />
mprotect(0x7f66fee3d000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66ff03d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6e000) = 0x7f66ff03d000<br />
close(3) = 0<br />
open("/usr/lib/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`?\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170144, ...}) = 0<br />
mmap(NULL, 2265320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66feba5000<br />
mprotect(0x7f66febcc000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fedcb000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fedcb000<br />
close(3) = 0<br />
open("/usr/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3209\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=84856, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b8000<br />
mmap(NULL, 2190152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe98e000<br />
mprotect(0x7f66fe9a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66feba1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7f66feba1000<br />
mmap(0x7f66feba3000, 6984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66feba3000<br />
close(3) = 0<br />
open("/usr/lib/libgraphite2.so.3", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260(\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=121184, ...}) = 0<br />
mmap(NULL, 2216376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe770000<br />
mprotect(0x7f66fe78c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe98b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f66fe98b000<br />
close(3) = 0<br />
open("/usr/lib/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\27\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=65760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b7000<br />
mmap(NULL, 2160936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe560000<br />
mprotect(0x7f66fe56f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe76e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x7f66fe76e000<br />
close(3) = 0<br />
open("/usr/lib/libX11-xcb.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \6\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=6008, ...}) = 0<br />
mmap(NULL, 2101304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe35e000<br />
mprotect(0x7f66fe35f000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe55e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f66fe55e000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri2.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\32\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=18480, ...}) = 0<br />
mmap(NULL, 2113656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fe159000<br />
mprotect(0x7f66fe15d000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fe35c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f66fe35c000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-xfixes.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=30768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b6000<br />
mmap(NULL, 2125944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdf51000<br />
mprotect(0x7f66fdf57000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fe157000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f66fe157000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-shape.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14368, ...}) = 0<br />
mmap(NULL, 2109544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdd4d000<br />
mprotect(0x7f66fdd50000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdf4f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fdf4f000<br />
close(3) = 0<br />
open("/usr/lib/libgbm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360)\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=56552, ...}) = 0<br />
mmap(NULL, 2152016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fdb3f000<br />
mprotect(0x7f66fdb4c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdd4b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fdd4b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-client.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000Q\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=60760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b5000<br />
mmap(NULL, 2155944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd930000<br />
mprotect(0x7f66fd93c000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fdb3b000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f66fdb3b000<br />
close(3) = 0<br />
open("/usr/lib/libwayland-server.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pd\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=73368, ...}) = 0<br />
mmap(NULL, 2168776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd71e000<br />
mprotect(0x7f66fd72e000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd92d000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f66fd92d000<br />
close(3) = 0<br />
open("/usr/lib/libglapi.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\233\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=170352, ...}) = 0<br />
mmap(NULL, 2271752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd4f3000<br />
mprotect(0x7f66fd519000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd719000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f66fd719000<br />
mmap(0x7f66fd71d000, 2568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f66fd71d000<br />
close(3) = 0<br />
open("/usr/lib/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P7\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55760, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b4000<br />
mmap(NULL, 2153616, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd2e5000<br />
mprotect(0x7f66fd2f1000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd4f1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fd4f1000<br />
close(3) = 0<br />
open("/usr/lib/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \17\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=14512, ...}) = 0<br />
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fd0e1000<br />
mprotect(0x7f66fd0e3000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fd2e3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f66fd2e3000<br />
close(3) = 0<br />
open("/usr/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \25\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22688, ...}) = 0<br />
mmap(NULL, 2117912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcedb000<br />
mprotect(0x7f66fcee0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fd0df000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fd0df000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b3000<br />
open("/usr/lib/libxcb-glx.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\247\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=104480, ...}) = 0<br />
mmap(NULL, 2199656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fccc1000<br />
mprotect(0x7f66fccd8000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fced8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f66fced8000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-dri3.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\r\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10288, ...}) = 0<br />
mmap(NULL, 2105464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fcabe000<br />
mprotect(0x7f66fcac0000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fccbf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fccbf000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-present.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\f\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10272, ...}) = 0<br />
mmap(NULL, 2105448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc8bb000<br />
mprotect(0x7f66fc8bd000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fcabc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fcabc000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-randr.so.0", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0`\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=55520, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b2000<br />
mmap(NULL, 2150696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc6ad000<br />
mprotect(0x7f66fc6ba000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc8b9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f66fc8b9000<br />
close(3) = 0<br />
open("/usr/lib/libxcb-sync.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300!\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=26752, ...}) = 0<br />
mmap(NULL, 2121928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc4a6000<br />
mprotect(0x7f66fc4ab000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc6ab000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f66fc6ab000<br />
close(3) = 0<br />
open("/usr/lib/libxshmfence.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\t\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=10248, ...}) = 0<br />
mmap(NULL, 2105472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc2a3000<br />
mprotect(0x7f66fc2a4000, 2097152, PROT_NONE) = 0<br />
mmap(0x7f66fc4a4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f66fc4a4000<br />
close(3) = 0<br />
open("/usr/lib/libXxf86vm.so.1", O_RDONLY|O_CLOEXEC) = 3<br />
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\20\0\0\0\0\0\0"..., 832) = 832<br />
fstat(3, {st_mode=S_IFREG|0755, st_size=22768, ...}) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b1000<br />
mmap(NULL, 2118024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f66fc09d000<br />
mprotect(0x7f66fc0a2000, 2093056, PROT_NONE) = 0<br />
mmap(0x7f66fc2a1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f66fc2a1000<br />
close(3) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058b0000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058af000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ae000<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ad000<br />
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058ab000<br />
arch_prctl(ARCH_SET_FS, 0x7f67058ab8c0) = 0<br />
mprotect(0x7f6702c56000, 16384, PROT_READ) = 0<br />
mprotect(0x7f66fd2e3000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd0df000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffb22000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703ab4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702678000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6700d69000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc2a1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc4a4000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc6ab000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fc8b9000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fcabc000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fccbf000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fced8000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fd4f1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702e77000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd719000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704997000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff44e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff246000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fd92d000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66fdb3b000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fedcb000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66fdd4b000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fdf4f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe157000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe35c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe55e000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fe98b000, 8192, PROT_READ) = 0<br />
mprotect(0x7f66feba1000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff03d000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670233c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700f6c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ffd2c000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66ff6e7000, 12288, PROT_READ) = 0<br />
mprotect(0x7f66ff900000, 4096, PROT_READ) = 0<br />
mprotect(0x7f66fff30000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700159000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6700400000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6700b57000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67038af000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67006bf000, 24576, PROT_READ) = 0<br />
mprotect(0x7f670091f000, 12288, PROT_READ) = 0<br />
mprotect(0x7f670116f000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701ba2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f670137a000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701584000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701795000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6701998000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703f09000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6703cb8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f67035a2000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704484000, 8192, PROT_READ) = 0<br />
mprotect(0x7f67028ba000, 8192, PROT_READ) = 0<br />
mprotect(0x7f6701db8000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6702130000, 16384, PROT_READ) = 0<br />
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f67058aa000<br />
mprotect(0x7f6703383000, 32768, PROT_READ) = 0<br />
mprotect(0x7f6704235000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6704692000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704bbd000, 4096, PROT_READ) = 0<br />
mprotect(0x7f6704de1000, 12288, PROT_READ) = 0<br />
mprotect(0x7f6705095000, 16384, PROT_READ) = 0<br />
mprotect(0x7f67056cf000, 28672, PROT_READ) = 0<br />
mprotect(0x7f67058fe000, 4096, PROT_READ) = 0<br />
munmap(0x7f67058c8000, 219849) = 0<br />
set_tid_address(0x7f67058abb90) = 16265<br />
set_robust_list(0x7f67058abba0, 24) = 0<br />
rt_sigaction(SIGRTMIN, {0x7f6702c65bb0, [], SA_RESTORER|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigaction(SIGRT_1, {0x7f6702c65c40, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f6702c70740}, NULL, 8) = 0<br />
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br />
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0<br />
brk(0) = 0x4fd3000<br />
brk(0x4ff4000) = 0x4ff4000<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f67038b1568, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb0c, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
futex(0x7f670339fb18, FUTEX_WAKE_PRIVATE, 2147483647) = 0<br />
brk(0x5015000) = 0x5015000<br />
brk(0x5036000) = 0x5036000<br />
brk(0x5057000) = 0x5057000<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/.user_prefs", 0755) = 0<br />
umask(022) = 0<br />
umask(0) = 022<br />
mkdir("/home/kousu/.stata14/:0.0", 0755) = 0<br />
umask(022) = 0<br />
unlink("/tmp/SQ16265.000001") = -1 ENOENT (No such file or directory)<br />
unlink("/tmp/SQ16265.000002") = -1 ENOENT (No such file or directory)<br />
open("/home/kousu/.stata14/:0.0/stata14.rc", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f67058abb90) = 16266<br />
exit_group(0) = ?<br />
+++ exited with 0 +++<br />
</pre><br />
<br />
[[User:Kousu|Kousu]] ([[User talk:Kousu|talk]]) 01:13, 15 May 2015 (UTC)</div>Kousuhttps://wiki.archlinux.org/index.php?title=Festival&diff=320797Festival2014-06-20T07:58:21Z<p>Kousu: clarify my last edit and correct a big misleading mistake; I didn't know that festival-us contained the other festvox voices.</p>
<hr />
<div>[[Category:Accessibility]]<br />
[[Category:Audio/Video]]<br />
[[ru:Festival]]<br />
[http://www.cstr.ed.ac.uk/projects/festival/ Festival] is a general multi-lingual speech synthesis system developed at CSTR ([http://www.cstr.ed.ac.uk/ Centre for Speech Technology Research]).<br />
<br />
Festival offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual (currently British English, American English, Italian, Czech and Spanish, with other languages available in prototype.) <br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|festival}} from [[official repositories]]. You need a voice package like {{Pkg|festival-english}} or {{Pkg|festival-us}}. Further languages are available in official repositories and in [[AUR]].<br />
<br />
Test festival:<br />
$ echo "This is an example. Arch is the best." | festival --tts<br />
<br />
If your hear all the example text, you sucessfully installed a TTS system.<br />
<br />
If you do not hear anything, see the [[Festival#Troubleshooting|Troubleshooting]] section. If you have a desktop system you will almost certainly get a message about /dev/dsp and need to follow those instructions.<br />
<br />
<br />
== Configuration ==<br />
<br />
There is no global /etc configuration file, but you can configure festival with your {{ic|~/.festivalrc}} file, or by directly editing {{ic|/usr/share/festival/festival.scm}}. Both of these are scheme files, using scheme syntax and rerun everytime festival is run.<br />
<br />
=== Usage with a Sound Server ===<br />
<br />
For PulseAudio, add these lines to the end of your {{ic|~/.festivalrc}} file, or to {{ic|/usr/share/festival/festival.scm}}:<br />
(Parameter.set 'Audio_Required_Format 'aiff)<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")<br />
<br />
For ALSA, use these lines instead ([http://ubuntuforums.org/showpost.php?p=4058268&postcount=16 source]):<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")<br />
<br />
=== Voices ===<br />
<br />
Arch splits the set of official voices into {{Pkg|festival-english}}, {{Pkg|festival-us}} and {{Pkg|festival-ru}}. [https://aur.archlinux.org/packages/?K=festival The AUR] has some others, in various states of maintenance which may or may not be currently working.<br />
<br />
To see what voices you currently have installed and what your default is, go into the Festival shell (which is a scheme REPL):<br />
<br />
$ festival<br />
<br />
Festival Speech Synthesis System 2.1:release November 2010<br />
Copyright (C) University of Edinburgh, 1996-2010. All rights reserved.<br />
<br />
clunits: Copyright (C) University of Edinburgh and CMU 1997-2010<br />
clustergen_engine: Copyright (C) CMU 2005-2010<br />
hts_engine: <br />
The HMM-based speech synthesis system (HTS)<br />
hts_engine API version 1.04 (http://hts-engine.sourceforge.net/)<br />
Copyright (C) 2001-2010 Nagoya Institute of Technology<br />
2001-2008 Tokyo Institute of Technology<br />
All rights reserved.<br />
For details type `(festival_warranty)'<br />
festival> voice_default <br />
voice_cmu_us_slt_arctic_hts ;;<-- THIS IS THE VOICE FESTIVAL SPEAKS WITH<br />
festival> default-voice-priority-list <br />
<br />
(kal_diphone ;;<-- THIS IS THE HARD-CODED LIST OF VOICES FESTIVAL CAME PRE-AWARE OF<br />
cmu_us_bdl_arctic_hts<br />
cmu_us_jmk_arctic_hts<br />
cmu_us_slt_arctic_hts<br />
cmu_us_awb_arctic_hts<br />
ked_diphone<br />
don_diphone<br />
rab_diphone<br />
en1_mbrola<br />
us1_mbrola<br />
us2_mbrola<br />
us3_mbrola<br />
gsw_diphone<br />
el_diphone)<br />
<br />
festival> (voice_ ;;<-- PRESS TAB HERE TO SEE WHAT VOICES FESTIVAL HAS AVAILABLE<br />
voice_cmu_us_slt_arctic_hts voice_kal_diphone voice_nitech_us_slt_arctic_hts voice_reset<br />
voice_default voice_nitech_us_clb_arctic_hts voice_rab_diphone<br />
festival> (voice_cmu_us_slt_arctic_hts) <br />
cmu_us_slt_arctic_hts<br />
festival> (SayText "Arch makes me happy")<br />
#<Utterance 0x7fb5b8c423b0><br />
festival> <br />
<br />
To permanently change the default voice you can add a line like this to the end of {{ic|~/.festivalrc}}:<br />
(set! voice_default voice_cmu_us_slt_arctic_hts)<br />
You cannot set the voice with festival.scm; to set voices globally, set order of searched voices in {{ic|/usr/share/festival/voices.scm}}.<br />
<br />
==== HTS compatibility patches ====<br />
<br />
Some say that HTS voices for Festival are the best ones freely available. Sadly they are not compatible with Festival >2.1 without patching it (and the new voice versions are not made available for downloading).<br />
<br />
You can install the patched version from [[AUR]]: [https://aur.archlinux.org/packages/festival-patched-hts/ festival-patched-hts ] and [https://aur.archlinux.org/packages/festival-hts-voices-patched/ festival-hts-voices-patched ]<br />
<br />
((IS THIS STILL TRUE? {{Pkg|festival-us}} comes with {{ic|cmu_us_slt_arctic_hts}}))<br />
<br />
==== Manual Voice Installs ====<br />
<br />
You can also get voices straight from [http://festvox.org/festival/downloads.html festvox.org]. In their downloads, the files named "festvox_*.tgz" each contain a different voice, as built by the festival team. They do work, but you will need to manually unzip and move the folder containing the voice to the appropriate place. On a recent Arch, the appropriate place is<br />
/usr/share/festival/voices/english/<br />
and the way to tell what folder contains the voice is to look for a 'festvox/' subfolder inside of it.<br />
<br />
You can then test that your new voices are found by loading up the festival prompt again.<br />
<br />
<br />
== Usage ==<br />
<br />
Read a text file:<br />
$ festival --tts /path/to/letter.txt<br />
<br />
Be obnoxious while demonstrating piping<br />
$ (echo "Get ready for some pain"; sudo cat /var/log/messages.log) | festival --tts<br />
<br />
Convert a text file to mp3:<br />
$ cat letter.txt | text2wave | lame - file.mp3 && mplayer file.mp3<br />
<br />
=== Interactive mode (testing voices etc.) ===<br />
<br />
festival has an interactive prompt you can use for testing. Some examples (with sample output):<br />
$ festival <br />
[...]<br />
festival> <br />
List available voices:<br />
festival> (voice.list)<br />
(cstr_us_awb_arctic_multisyn kal_diphone don_diphone)<br />
Set voice:<br />
festival> (voice_cstr_us_awb_arctic_multisyn)<br />
#<voice 0x1545b90><br />
Speak:<br />
festival> (SayText '"test this is a test oh no a test bla test")<br />
inserting pause after: t.<br />
Inserting pause<br />
[...]<br />
id _63 ; name t ; <br />
id _65 ; name # ; <br />
#<Utterance 0x7f7c0c144810><br />
More:<br />
festival> help <br />
"The Festival Speech Synthesizer System: Help<br />
Quit: ctrl+d or<br />
festival> (quit)<br />
<br />
=== Example script ===<br />
<br />
One classic app that can make use of this is ping. Use this script to constantly ping a host, and return ping if success, fail is not:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
while :; do<br />
ping -c 1 $1 && (echo "Ping" | festival --tts) || (echo "Fail" | festival --tts)<br />
done<br />
}}<br />
<br />
Note that this does not really work on multisynth voices, as they take a while to prepare before playing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't open /dev/dsp ===<br />
<br />
If festival returns the following error message:<br />
Linux: can't open /dev/dsp<br />
<br />
See [[#Usage with a Sound Server]] above.<br />
<br />
=== Alsa playing at wrong speed ===<br />
<br />
If the solution above gives you a squeaky voice, you might want to try changing your aplay options:<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")<br />
<br />
=== aplay Command not found ===<br />
<br />
Install {{Pkg|alsa-utils}}.<br />
<br />
== See also ==<br />
<br />
* [http://www.cstr.ed.ac.uk/projects/festival/manual/ Festival manual]</div>Kousuhttps://wiki.archlinux.org/index.php?title=Festival&diff=317795Festival2014-06-03T07:19:41Z<p>Kousu: Reorder the TOC</p>
<hr />
<div>[[Category:Accessibility]]<br />
[[Category:Audio/Video]]<br />
[[ru:Festival]]<br />
[http://www.cstr.ed.ac.uk/projects/festival/ Festival] is a general multi-lingual speech synthesis system developed at CSTR ([http://www.cstr.ed.ac.uk/ Centre for Speech Technology Research]).<br />
<br />
Festival offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual (currently British English, American English, Italian, Czech and Spanish, with other languages available in prototype.) <br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|festival}} from [[official repositories]]. You need a voice package like {{Pkg|festival-english}} or {{Pkg|festival-us}}. Further languages are available in official repositories and in [[AUR]].<br />
<br />
Test festival:<br />
$ echo "This is an example. Arch is the best." | festival --tts<br />
<br />
If your hear all the example text, you sucessfully installed a TTS system.<br />
<br />
If you do not hear anything, hear something strange, or get a message about /dev/dsp, see the [[Festival#Troubleshooting|Troubleshooting]] section.<br />
<br />
<br />
== Configuration ==<br />
<br />
<br />
There is no global /etc configuration file, but you can configure festival with your {{ic|~/.festivalrc}} file, or by directly editing {{ic|/usr/share/festival/festival.scm}}. For example, to change the default voice you can add a line like this to the end of {{ic|~/.festivalrc}}:<br />
(set! voice_default voice_cmu_us_slt_arctic_hts)<br />
You cannot set the voice with festival.scm; to set voices globally, set order of searched voices in {{ic|/usr/share/festival/voices.scm}}.<br />
<br />
=== Using with PulseAudio ===<br />
<br />
Add these lines to the end of your .festivalrc file, or to /usr/share/festival/festival.scm :<br />
(Parameter.set 'Audio_Required_Format 'aiff)<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")<br />
<br />
<br />
=== Using with ALSA ===<br />
<br />
Add these lines to the end of your .festivalrc file, or to {{ic|/usr/share/festival/festival.scm}} ([http://ubuntuforums.org/showpost.php?p=4058268&postcount=16 source]):<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")<br />
<br />
=== Getting new voices ===<br />
<br />
Arch does not currently provide all the standard festival voices as packages. [https://aur.archlinux.org/packages/?K=festival The AUR] has some, in various states of maintenance.<br />
<br />
==== HTS compatibility patches ====<br />
<br />
Some say that HTS voices for Festival are the best ones freely available. Sadly they are not compatible with Festival >2.1 without patching it (and the new voice versions are not made available for downloading).<br />
<br />
You can install the patched version from [[AUR]]: [https://aur.archlinux.org/packages/festival-patched-hts/ festival-patched-hts ] and [https://aur.archlinux.org/packages/festival-hts-voices-patched/ festival-hts-voices-patched ]<br />
<br />
==== Manual Voice Installs ====<br />
<br />
You can also get voices straight from [http://festvox.org/festival/downloads.html festvox.org]. In their downloads, the files named "festvox_*.tgz" each contain a different voice, as built by the festival team. They do work, but you will need to manually unzip and move the folder containing the voice to the appropriate place. On a recent Arch, the appropriate place is<br />
/usr/share/festival/voices/english/<br />
and the way to tell what folder contains the voice is to look for a 'festvox/' subfolder inside of it.<br />
<br />
You can test that your new voices are found by loading up the festival prompt<br />
<br />
$ festival<br />
<br />
Festival Speech Synthesis System 2.1:release November 2010<br />
Copyright (C) University of Edinburgh, 1996-2010. All rights reserved.<br />
<br />
clunits: Copyright (C) University of Edinburgh and CMU 1997-2010<br />
clustergen_engine: Copyright (C) CMU 2005-2010<br />
hts_engine: <br />
The HMM-based speech synthesis system (HTS)<br />
hts_engine API version 1.04 (http://hts-engine.sourceforge.net/)<br />
Copyright (C) 2001-2010 Nagoya Institute of Technology<br />
2001-2008 Tokyo Institute of Technology<br />
All rights reserved.<br />
For details type `(festival_warranty)'<br />
festival> (voice_ ;;<-- PRESS TAB HERE<br />
voice_cmu_us_slt_arctic_hts voice_kal_diphone voice_nitech_us_slt_arctic_hts voice_reset<br />
voice_default voice_nitech_us_clb_arctic_hts voice_rab_diphone<br />
festival> (voice_cmu_us_slt_arctic_hts) <br />
cmu_us_slt_arctic_hts<br />
festival> (SayText "Arch makes me happy")<br />
#<Utterance 0x7fb5b8c423b0><br />
festival> <br />
<br />
<br />
<br />
<br />
<br />
== Usage ==<br />
<br />
Read a text file:<br />
$ festival --tts /path/to/letter.txt<br />
<br />
Be obnoxious while demonstrating piping<br />
$ (echo "Get ready for some pain"; sudo cat /var/log/messages.log) | festival --tts<br />
<br />
Convert a text file to mp3:<br />
$ cat letter.txt | text2wave | lame - file.mp3 && mplayer file.mp3<br />
<br />
=== Interactive mode (testing voices etc.) ===<br />
<br />
festival has an interactive prompt you can use for testing. Some examples (with sample output):<br />
$ festival <br />
[...]<br />
festival> <br />
List available voices:<br />
festival> (voice.list)<br />
(cstr_us_awb_arctic_multisyn kal_diphone don_diphone)<br />
Set voice:<br />
festival> (voice_cstr_us_awb_arctic_multisyn)<br />
#<voice 0x1545b90><br />
Speak:<br />
festival> (SayText '"test this is a test oh no a test bla test")<br />
inserting pause after: t.<br />
Inserting pause<br />
[...]<br />
id _63 ; name t ; <br />
id _65 ; name # ; <br />
#<Utterance 0x7f7c0c144810><br />
More:<br />
festival> help <br />
"The Festival Speech Synthesizer System: Help<br />
Quit: ctrl+d or<br />
festival> (quit)<br />
<br />
=== Example script ===<br />
<br />
One classic app that can make use of this is ping. Use this script to constantly ping a host, and return ping if success, fail is not:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
while :; do<br />
ping -c 1 $1 && (echo "Ping" | festival --tts) || (echo "Fail" | festival --tts)<br />
done<br />
}}<br />
<br />
Note that this does not really work on multisynth voices, as they take a while to prepare before playing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't open /dev/dsp ===<br />
<br />
If festival returns the following error message:<br />
Linux: can't open /dev/dsp<br />
<br />
See [[#Using_with_PulseAudio]] above.<br />
<br />
=== Alsa playing at wrong speed ===<br />
<br />
If the solution above gives you a squeaky voice, you might want to try changing your aplay options:<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")<br />
<br />
=== aplay Command not found ===<br />
<br />
Install {{Pkg|alsa-utils}}.<br />
<br />
== See also ==<br />
<br />
* [http://www.cstr.ed.ac.uk/projects/festival/manual/ Festival manual]</div>Kousuhttps://wiki.archlinux.org/index.php?title=Festival&diff=317786Festival2014-06-03T06:53:41Z<p>Kousu: Document where from and how to install voices manually, because Google fails hard on this for Festival.</p>
<hr />
<div>[[Category:Accessibility]]<br />
[[Category:Audio/Video]]<br />
[[ru:Festival]]<br />
[http://www.cstr.ed.ac.uk/projects/festival/ Festival] is a general multi-lingual speech synthesis system developed at CSTR ([http://www.cstr.ed.ac.uk/ Centre for Speech Technology Research]).<br />
<br />
Festival offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual (currently British English, American English, Italian, Czech and Spanish, with other languages available in prototype.) <br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|festival}} from [[official repositories]]. You need a voice package like {{Pkg|festival-english}} or {{Pkg|festival-us}}. Further languages are available in official repositories and in [[AUR]].<br />
<br />
Test festival:<br />
$ echo "This is an example. Arch is the best." | festival --tts<br />
<br />
If your hear all the example text, you sucessfully installed a TTS system.<br />
<br />
If you do not hear anything, hear something strange, or get a message about /dev/dsp, see the [[Festival#Troubleshooting|Troubleshooting]] section.<br />
<br />
<br />
== Configuration ==<br />
<br />
<br />
There is no global /etc configuration file, but you can configure festival with your {{ic|~/.festivalrc}} file, or by directly editing {{ic|/usr/share/festival/festival.scm}}. For example, to change the default voice you can add a line like this to the end of {{ic|~/.festivalrc}}:<br />
(set! voice_default voice_cmu_us_slt_arctic_hts)<br />
You can also set the order of searched voices in {{ic|/usr/share/festival/voices.scm}}.<br />
<br />
=== Getting new voices ===<br />
<br />
Arch does not currently provide all the standard festival voices as packages. [https://aur.archlinux.org/packages/?K=festival The AUR] has some, in various states of maintenance.<br />
<br />
==== HTS compatibility patches ====<br />
<br />
Some say that HTS voices for Festival are the best ones freely available. Sadly they are not compatible with Festival >2.1 without patching it (and the new voice versions are not made available for downloading).<br />
<br />
You can install the patched version from [[AUR]]: [https://aur.archlinux.org/packages/festival-patched-hts/ festival-patched-hts ] and [https://aur.archlinux.org/packages/festival-hts-voices-patched/ festival-hts-voices-patched ]<br />
<br />
==== Manual Voice Installs ====<br />
<br />
You can also get voices straight from [http://festvox.org/festival/downloads.html festvox.org]. In their downloads, the files named "festvox_*.tgz" each contain a different voice, as built by the festival team. They do work, but you will need to manually unzip and move the folder containing the voice to the appropriate place. On a recent Arch, the appropriate place is<br />
/usr/share/festival/voices/english/<br />
and the way to tell what folder contains the voice is to look for a 'festvox/' subfolder inside of it.<br />
<br />
You can test that your new voices are found by loading up the festival prompt<br />
<br />
$ festival<br />
<br />
Festival Speech Synthesis System 2.1:release November 2010<br />
Copyright (C) University of Edinburgh, 1996-2010. All rights reserved.<br />
<br />
clunits: Copyright (C) University of Edinburgh and CMU 1997-2010<br />
clustergen_engine: Copyright (C) CMU 2005-2010<br />
hts_engine: <br />
The HMM-based speech synthesis system (HTS)<br />
hts_engine API version 1.04 (http://hts-engine.sourceforge.net/)<br />
Copyright (C) 2001-2010 Nagoya Institute of Technology<br />
2001-2008 Tokyo Institute of Technology<br />
All rights reserved.<br />
For details type `(festival_warranty)'<br />
festival> (voice_ ;;<-- PRESS TAB HERE<br />
voice_cmu_us_slt_arctic_hts voice_kal_diphone voice_nitech_us_slt_arctic_hts voice_reset<br />
voice_default voice_nitech_us_clb_arctic_hts voice_rab_diphone<br />
festival> (voice_cmu_us_slt_arctic_hts) <br />
cmu_us_slt_arctic_hts<br />
festival> (SayText "Arch makes me happy")<br />
#<Utterance 0x7fb5b8c423b0><br />
festival> <br />
<br />
<br />
<br />
=== Using with PulseAudio ===<br />
<br />
Add these lines to the end of your .festivalrc file, or to /usr/share/festival/festival.scm :<br />
(Parameter.set 'Audio_Required_Format 'aiff)<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")<br />
<br />
<br />
=== Using with ALSA ===<br />
<br />
Add these lines to the end of your .festivalrc file, or to {{ic|/usr/share/festival/festival.scm}} ([http://ubuntuforums.org/showpost.php?p=4058268&postcount=16 source]):<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")<br />
<br />
<br />
== Usage ==<br />
<br />
Read a text file:<br />
$ festival --tts /path/to/letter.txt<br />
<br />
Be obnoxious while demonstrating piping<br />
$ (echo "Get ready for some pain"; sudo cat /var/log/messages.log) | festival --tts<br />
<br />
Convert a text file to mp3:<br />
$ cat letter.txt | text2wave | lame - file.mp3 && mplayer file.mp3<br />
<br />
=== Interactive mode (testing voices etc.) ===<br />
<br />
festival has an interactive prompt you can use for testing. Some examples (with sample output):<br />
$ festival <br />
[...]<br />
festival> <br />
List available voices:<br />
festival> (voice.list)<br />
(cstr_us_awb_arctic_multisyn kal_diphone don_diphone)<br />
Set voice:<br />
festival> (voice_cstr_us_awb_arctic_multisyn)<br />
#<voice 0x1545b90><br />
Speak:<br />
festival> (SayText '"test this is a test oh no a test bla test")<br />
inserting pause after: t.<br />
Inserting pause<br />
[...]<br />
id _63 ; name t ; <br />
id _65 ; name # ; <br />
#<Utterance 0x7f7c0c144810><br />
More:<br />
festival> help <br />
"The Festival Speech Synthesizer System: Help<br />
Quit: ctrl+d or<br />
festival> (quit)<br />
<br />
=== Example script ===<br />
<br />
One classic app that can make use of this is ping. Use this script to constantly ping a host, and return ping if success, fail is not:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
while :; do<br />
ping -c 1 $1 && (echo "Ping" | festival --tts) || (echo "Fail" | festival --tts)<br />
done<br />
}}<br />
<br />
Note that this does not really work on multisynth voices, as they take a while to prepare before playing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Can't open /dev/dsp ===<br />
<br />
If festival returns the following error message:<br />
Linux: can't open /dev/dsp<br />
<br />
See [[#Using_with_PulseAudio]] above.<br />
<br />
=== Alsa playing at wrong speed ===<br />
<br />
If the solution above gives you a squeaky voice, you might want to try changing your aplay options:<br />
(Parameter.set 'Audio_Method 'Audio_Command)<br />
(Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")<br />
<br />
=== aplay Command not found ===<br />
<br />
Install {{Pkg|alsa-utils}}.<br />
<br />
== See also ==<br />
<br />
* [http://www.cstr.ed.ac.uk/projects/festival/manual/ Festival manual]</div>Kousuhttps://wiki.archlinux.org/index.php?title=Arduino&diff=278855Arduino2013-10-17T03:05:18Z<p>Kousu: /* Unable to upload sketch to your Arduino */</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is available on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
== Installation ==<br />
<br />
* Install {{AUR|arduino}} from the [[AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
=== Arduino Due ===<br />
<br />
You need the version 1.5beta of the arduino ide. You can download an archive with the compiled version at the [http://arduino.cc/en/Main/Software Arduino software download] page.<br />
<br />
== Configuration ==<br />
<br />
=== Accessing serial ===<br />
<br />
The arduino board communicates with the PC via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a ''user'' uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Briefly run the {{ic|arduino}} command and stop it, then modify {{ic|~/.arduino/preferences.txt}} .<br />
<br />
Change serial port from COM1 to your serial port. With your arduino board connected, you can find out what your serial port is with:<br />
<br />
ls /dev/ttyUSB* /dev/ttyACM*<br />
<br />
If in doubt, unconnect the board and look which of these disappears, and/or monitor {{ic|/var/log/everything.log}}.<br />
<br />
The line to change in {{ic|~/.arduino/preferences.txt}} should look something like this when you are done:<br />
<br />
serial.port=/dev/ttyACM3<br />
<br />
Rerun {{ic|arduino}}. If you get a message like "Arduino Uno on /dev/tty*" message in the GUI's lower right corner, connection has been established.<br />
<br />
== stty ==<br />
<br />
Preparing:<br />
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
# echo -n "Hello World" > /dev/ttyACM0<br />
{{Note| As autoreset on serial connection is activated by default on most boards, you need to disable this feature if you want to communicate directly with your board with the last command instead of a terminal emulator (arduino IDE, screen, picocom...). If you have a Leonardo board, you are not concerned by this, because it does not autoreset. If you have a Uno board, connect a 10 µF capacitor between the RESET and GND pins. If you have another board, connect a 120 ohms resistor between the RESET and 5V pins. See http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection for more details.}}<br />
<br />
Reading what your Arduino has to tell you<br />
$ cat /dev/ttyACM0<br />
<br />
== Working with Uno/Mega2560 ==<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== Running Arduino Uno ==<br />
<br />
Once Arduino is running you must ensure you have selected the correct board from the Tools->Boards menu item:<br />
Arduino Uno<br />
<br />
Secondly you must ensure you have selected the correct serial port from the Tools->Serial Port menu item as explained above.<br />
<br />
Once these are done you should be able to write and upload sketches to your Arduino Uno without any issues.<br />
<br />
== Alternatives for IDE ==<br />
<br />
=== ArduIDE ===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{AUR|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
=== gnoduino ===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
=== Scons ===<br />
<br />
Using [http://www.scons.org/ scons] together with [http://code.google.com/p/arscons/ arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install {{Pkg|python-pyserial}} and {{Pkg|scons}}.<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .pde (eg. test.pde). Get the [http://arscons.googlecode.com/git/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
=== Makefile ===<br />
<br />
Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.<br />
<br />
Instead of using the arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
=== Arduino-CMake ===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [https://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [https://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [https://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
=== Ino ===<br />
<br />
Ino ([https://github.com/amperka/ino]) is a command line toolkit for working with arduino hardware. {{AUR|ino}} is available in the [[AUR]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== delay() function does not work ===<br />
<br />
{{Out of date|the current arduino-git package is reported in the talk page as not being affected by this issue.|section=Update troubleshooting?}}<br />
There are some cases where the delay() function does not work, causing programs such as the example [http://www.arduino.cc/en/Tutorial/Blink Blink] to malfunction. <br />
It appears that the Arch compiler sometimes generates code that writes to addresses before the start of memory. RAM starts at address 0x200 on the mega, but the Blink code has the delay() timer variables located at 0x100-0x10b. This only seems to happen when the code contains no initialized global variables (.data segment in asm-speak) - the linker is told that the data segment starts at 0x200, but if there is nothing to go in it it generates an incorrect start address for the uninitialized global variables (.bss segment). Since the timer variables are uninitialized globals (or globals initialized to zero) they end up at an illegal address.<br />
<br />
There are currently two ways to bypass this issue.<br />
<br />
* Use '''Serial.begin(9600);''' in '''setup()''' function. [[http://forums.adafruit.com/viewtopic.php?f=25&t=21075 Source post]] <br />
<br />
{{bc|<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
Serial.begin(9600);<br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}<br />
}}<br />
<br />
* Use an initialized global variable. [[http://arduino.cc/forum/index.php/topic,49900.msg363688.html#msg363688 Source post]]<br />
<br />
{{bc|<nowiki><br />
char dummyvariablecuzmaintainerborkedthecompiler = 123; // force something into the .data segment with non-zero initializer<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
dummyvariablecuzmaintainerborkedthecompiler++; // stops the linker from removing the global variable<br />
<br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}</nowiki>}}<br />
<br />
Related pages:<br />
* http://arduino.cc/forum/index.php/topic,56841.0.html<br />
* http://arduino.cc/forum/index.php/topic,49900.0.html<br />
* http://arduino.cc/forum/index.php?topic=59409.0.html<br />
<br />
Fedora has the same problem with binutils 2.21 ([https://bugzilla.redhat.com/show_bug.cgi?id=688645 bug report]).<br />
Downgraded packages that work are binutils-avr 2.20.1-3 and gcc-avr 4.5.1-2. <br />
There is also an upstream bug report [http://sourceware.org/bugzilla/show_bug.cgi?id=12757 here] but no one has replied yet.<br />
<br />
=== Error when launching Arduino IDE or uploading sketch ===<br />
<br />
If you run the Arduino IDE as a normal user (you should do that of course), you may get this error message :<br />
'''check_group_uucp(): error testing lock file creation Error details:Permission denied'''<br />
<br />
You may also find that your Tools > Serial Port menu is greyed out, and you get this error message when attempting to upload a sketch:<br />
'''Serial port '/dev/ttyACM0' not found. Did you select the right one from the Tools > Serial Port menu?'''<br />
<br />
Either way, this is probably because you don't have write permissions on ''/run/lock directory''. Try this to see if this solves your problem :<br />
<br />
# chmod 777 /run/lock<br />
<br />
{{ic|/run/lock}} is created on boot by {{ic|/usr/lib/tmpfiles.d/legacy.conf}} (both on systemd and initscripts). To make the permissions permanent, copy the file /usr/lib/tmpfiles.d/legacy.conf to /etc/tmpfiles.d/ and edit it there. Find the line that sets the permissions of {{ic|/run/lock}} and change it to<br />
<br />
d /run/lock 775 root lock -<br />
<br />
Then add yourself to the lock group using<br />
<br />
# gpasswd -a username lock<br />
<br />
and log out and back in (or reboot).<br />
<br />
=== Error opening serial port ===<br />
<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Arduino Mega2560 and new gcc-avr ===<br />
<br />
If you are using gcc-avr >= 4.3.5 then there is a C++ bug in the gcc-avr toolchain which builds bad firmware for the Atmel2560 processors. gcc-avr must be rebuilt using a patch found at [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263]. You can read more about the problems at [http://andybrown.me.uk/ws/2010/10/24/the-major-global-constructor-bug-in-avr-gcc/]. This bug has been fixed in 4.7.0 and backported to 4.5.4 [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263].<br />
<br />
Here is the patch for gcc:<br />
{{bc|<br />
--- gcc-4.5.1.orig/gcc/config/avr/libgcc.S 2009-05-23 17:16:07 +1000<br />
+++ gcc-4.5.1/gcc/config/avr/libgcc.S 2010-08-12 09:38:05 +1000<br />
@@ -802,7 +802,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_ctors_start:<br />
cpi r28, lo8(__ctors_start)<br />
cpc r29, r17<br />
@@ -843,7 +845,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_dtors_start:<br />
cpi r28, lo8(__dtors_end)<br />
cpc r29, r17<br />
}}<br />
<br />
The easiest way to rebuild gcc-avr is using ABS and makepkg.<br />
<br />
=== Arduino Mega2560 and deprecated items in avr-libc ===<br />
<br />
The following error is known to occur when compiling using avr-libc versions newer than 1.8.0 with the Arduino Mega 2560.<br />
<br />
{{bc|<br />
build/core/HardwareSerial.cpp:107:41: error: attempt to use poisoned "SIG_USART0_RECV"<br />
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \<br />
^<br />
build/core/HardwareSerial.cpp:117:15: error: attempt to use poisoned "SIG_USART0_RECV"<br />
#elif defined(SIG_USART0_RECV)<br />
^<br />
build/core/HardwareSerial.cpp:161:15: error: attempt to use poisoned "SIG_USART1_RECV"<br />
#elif defined(SIG_USART1_RECV)<br />
^<br />
build/core/HardwareSerial.cpp:178:15: error: attempt to use poisoned "SIG_USART2_RECV"<br />
#elif defined(SIG_USART2_RECV)<br />
^<br />
build/core/HardwareSerial.cpp:195:15: error: attempt to use poisoned "SIG_USART3_RECV"<br />
#elif defined(SIG_USART3_RECV)<br />
}}<br />
<br />
This problem is discussed in further detail [http://arduino.cc/forum/index.php/topic,92364.0.html here]. To fix this, you need to enable deprecated avr-libc items in an Arduino header file.<br />
<br />
{{hc|/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h|<br />
#ifndef Arduino_h<br />
#define Arduino_h<br />
<br />
// start: fix the compatibility issue<br />
#define __AVR_LIBC_DEPRECATED_ENABLE__ 1<br />
// end: fix the compatibility issue<br />
<br />
#include <stdlib.h><br />
...<br />
}}<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
=== Unable to upload sketch to your Arduino ===<br />
<br />
{{Out of date|the AUR's rxtx is flagged out of date as of 2013-09-10, but java-rxtx in community works just fine|section=Update troubleshooting?}}<br />
<br />
Install the [https://aur.archlinux.org/packages.php?ID=8389 rxtx] package from the AUR. That package is the working Java library for Serial IO.<br />
<br />
=== Consistent naming of Arduino devices ===<br />
<br />
If you have more than one arduino you may have noticed that they names /dev/ttyUSB[0-9] are assigned in the order of connection. In the IDE this is not so much of a problem, but when you have programmed your own software to communicate with an arduino project in the background this can be annoying. Use the following udev rules to assign static symlinks to your arduino's:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"<br />
</nowiki>}}<br />
Your arduino's will be available under names like "/dev/sensors/ftdi_A700dzaF". If you want you can also assign more meaningfull names to several devices like this:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A700dzaF", SYMLINK+="arduino/nano"<br />
</nowiki>}}<br />
which will create a symlink in /dev/arduino/nano to the device with the specified serialnumber.<br />
You do need to unplug and replug your arduino for this to take effect or run<br />
udevadm trigger<br />
<br />
== Bugs ==<br />
<br />
This section is targeted at the package maintainers.<br />
<br />
{| border="1"<br />
! Symptom !! Cause / Upstream bug report !! Patches / Workarounds !! Patched Packages / End-User solutions<br />
|-<br />
| delay() sleeps forever || ??? || [[Arduino#delay.28.29_function_doesn.27t_work|workaround]] || none<br />
|-<br />
| progmem error || [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49764 bug in gcc-avr (fixed, but unreleased)] || [http://arduino.cc/forum/index.php/topic,66710.msg491529.html#msg491529 workaround] || [https://aur.archlinux.org/packages.php?ID=50146 aur/gcc-avr-svn] or [https://aur.archlinux.org/packages.php?ID=8388 aur/arduino]<br />
|}<br />
<br />
== See also ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* http://regomodoslinux.blogspot.com/2007/10/how-to-install-arduino-ide-in-archlinux.html<br />
* http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348<br />
* http://answers.ros.org/question/9097/how-can-i-get-a-unique-device-path-for-my-arduinoftdi-device/</div>Kousuhttps://wiki.archlinux.org/index.php?title=Lenovo_IdeaPad_Y580&diff=275810Lenovo IdeaPad Y5802013-09-16T19:06:28Z<p>Kousu: /* DISPLAY */ : original author (https://bbs.archlinux.org/viewtopic.php?pid=1127892#p1127892) didn't care to explain any of this laptop's "compatibility issues" except those CUDA-related</p>
<hr />
<div>==DISPLAY==<br />
As of the arrival of the 3.7.X series kernel, this machine boots into black screen. You will have to add acpi_backlight=vendor to kernel command line to boot into a visible display. You can alternatively increase the screen brightness during every boot also, since the screen brightness is set to 0 wrongly by the kernel acpi by default.<br />
<br />
As of September 2013, this doesn't seem to be an issue anymore, at least not on kernel 3.10.<br />
<br />
===Intel Card===<br />
<br />
This machine has two video cards, explained in detail below<br />
{{bc|<nowiki><br />
$ lspci | grep VGA<br />
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GTX 660M] (rev a1)<br />
</nowiki>}}<br />
<br />
In order to get the machine working for basic purposes, simply install xf86-video-intel and use the intel driver. You can leave the nvidia card disabled (and powered down?) just by not installing nvidia-304xx.<br />
<br />
===NVIDIA Card===<br />
<br />
The Y580 uses NVIDIA's Optimus technology, which is not officially supported on Linux yet. A possible solution is to install Bumblebee (https://wiki.archlinux.org/index.php/Bumblebee) and to access the card with optirun. However, you can still use CUDA, which is good if you use apps like Blender or if you develop CUDA C programs.<br />
<br />
===Nvidia Bumblebee support===<br />
In Linux currently [https://wiki.archlinux.org/index.php/Bumblebee bumblebee ] is the easiest option for a optimus like solution. For this laptop you will need bbswitch, Bumblebee, nvidia from official Arch repos. After installation of these packages you will need to add your user name to bumblebee group.You have to start the bumblebeed service manually. A short guide given here [https://wiki.archlinux.org/index.php/Bumblebee#Bumblebee:_Optimus_for_Linux bumblebee].<br />
<br />
===Driver===<br />
<br />
To compile and run CUDA programs, you need a NVIDIA driver and the cuda-toolkit. Any driver with version 295.59 or higher will work.<br />
{{Note|The only exception being the 302.17}}<br />
<br />
As of 10/24/2012, the newest driver is 304.60. To install it, you need a modified version of the package nvidia-utils from extra. The easiest way to do this is to install the package nvidia-utils-custom from the AUR: https://aur.archlinux.org/packages.php?ID=60991. <br />
<br />
Alternatively, you can use ABS and patch the package yourself. If you are not familiar with the process, read the wiki: https://wiki.archlinux.org/index.php/Arch_Build_System. The exact way to rebuild a package depends on your own preferences, one way is to download the source code (in this case, the driver, obtained here: ftp://download.nvidia.com/XFree86/Linux-x86_64/304.60/NVIDIA-Linux-x86_64-304.60-no-compat32.run), copy it to the build directory, edit the PKGBUILD, and then run makepkg. <br />
<br />
Edit the PKGBUILD of nvidia-utils. You may need to change the pkgver, the source item, and the md5sum. The most important thing is that nvidia-utils conflicts with libgl, but if you uninstall libgl, Gnome only starts in fallback mode (not sure about other DE). Because of this, you need to modify the PKGBUILD, so that it either does not install certain libraries (libglx.so, libGL.so) or that it installs them in another location. With the PKGBUILD below, those libraries are not installed (note the commented lines for the GLX extension module, and the empty 'conflicts' line).<br />
<br />
===nvidia-utils PKGBUILD===<br />
{{bc|<nowiki><br />
# $Id$<br />
# Maintainer: Thomas Baechler <thomas@archlinux.org><br />
# Contributor: James Rayner <iphitus@gmail.com><br />
pkgbase=nvidia-utils<br />
pkgname=('nvidia-utils' 'opencl-nvidia')<br />
pkgver=304.60<br />
pkgrel=1<br />
arch=('i686' 'x86_64')<br />
url="http://www.nvidia.com/"<br />
license=('custom')<br />
options=('!strip')<br />
<br />
if [ "$CARCH" = "i686" ]; then<br />
_arch='x86'<br />
_pkg="NVIDIA-Linux-${_arch}-${pkgver}"<br />
source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")<br />
md5sums=('42b9887076b2ebcf1af5ee13bc332ccb')<br />
elif [ "$CARCH" = "x86_64" ]; then<br />
_arch='x86_64'<br />
_pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"<br />
source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")<br />
md5sums=('7248399a125808e3bbc9c66da99a098d')<br />
fi<br />
<br />
create_links() {<br />
# create soname links<br />
while read -d '' _lib; do<br />
_soname="$(dirname "${_lib}")/$(readelf -d "${_lib}" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"<br />
[[ -e "${_soname}" ]] || ln -s "$(basename "${_lib}")" "${_soname}"<br />
[[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename "${_soname}")" "${_soname/.[0-9]*/}"<br />
done < <(find "${pkgdir}" -type f -name '*.so*' -print0)<br />
}<br />
<br />
build() {<br />
cd "${srcdir}"<br />
sh "${_pkg}.run" --extract-only<br />
}<br />
<br />
package_opencl-nvidia() {<br />
pkgdesc="OpenCL implemention for NVIDIA"<br />
depends=('libcl' 'zlib')<br />
optdepends=('opencl-headers: headers necessary for OpenCL development')<br />
cd "${srcdir}/${_pkg}"<br />
<br />
# OpenCL<br />
install -D -m644 nvidia.icd "${pkgdir}/etc/OpenCL/vendors/nvidia.icd"<br />
install -D -m755 "libnvidia-compiler.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-compiler.so.${pkgver}"<br />
install -D -m755 "libnvidia-opencl.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-opencl.so.${pkgver}"<br />
<br />
create_links<br />
}<br />
<br />
package_nvidia-utils() {<br />
pkgdesc="NVIDIA drivers utilities and libraries."<br />
depends=('xorg-server' 'libxvmc')<br />
optdepends=('gtk2: nvidia-settings' 'pkg-config: nvidia-xconfig'<br />
'opencl-nvidia: OpenCL support')<br />
conflicts=('')<br />
provides=('libgl')<br />
cd "${srcdir}/${_pkg}"<br />
<br />
# X driver<br />
install -D -m755 nvidia_drv.so "${pkgdir}/usr/lib/xorg/modules/drivers/nvidia_drv.so"<br />
# GLX extension module for X<br />
#install -D -m755 "libglx.so.${pkgver}" "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so.${pkgver}"<br />
#ln -s "libglx.so.${pkgver}" "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so" # X does not find glx otherwise<br />
# OpenGL library<br />
#install -D -m755 "libGL.so.${pkgver}" "${pkgdir}/usr/lib/libGL.so.${pkgver}"<br />
# OpenGL core library<br />
install -D -m755 "libnvidia-glcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glcore.so.${pkgver}"<br />
# XvMC<br />
install -D -m644 libXvMCNVIDIA.a "${pkgdir}/usr/lib/libXvMCNVIDIA.a"<br />
install -D -m755 "libXvMCNVIDIA.so.${pkgver}" "${pkgdir}/usr/lib/libXvMCNVIDIA.so.${pkgver}"<br />
# VDPAU<br />
install -D -m755 "libvdpau_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.${pkgver}"<br />
# nvidia-tls library<br />
install -D -m755 "tls/libnvidia-tls.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-tls.so.${pkgver}"<br />
install -D -m755 "libnvidia-cfg.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-cfg.so.${pkgver}"<br />
<br />
install -D -m755 "libnvidia-ml.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ml.so.${pkgver}"<br />
# CUDA<br />
install -D -m755 "libcuda.so.${pkgver}" "${pkgdir}/usr/lib/libcuda.so.${pkgver}"<br />
install -D -m755 "libnvcuvid.so.${pkgver}" "${pkgdir}/usr/lib/libnvcuvid.so.${pkgver}"<br />
<br />
# nvidia-xconfig<br />
install -D -m755 nvidia-xconfig "${pkgdir}/usr/bin/nvidia-xconfig"<br />
install -D -m644 nvidia-xconfig.1.gz "${pkgdir}/usr/share/man/man1/nvidia-xconfig.1.gz"<br />
# nvidia-settings<br />
install -D -m755 nvidia-settings "${pkgdir}/usr/bin/nvidia-settings"<br />
install -D -m644 nvidia-settings.1.gz "${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz"<br />
install -D -m644 nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"<br />
install -D -m644 nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"<br />
sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"<br />
# nvidia-bug-report<br />
install -D -m755 nvidia-bug-report.sh "${pkgdir}/usr/bin/nvidia-bug-report.sh"<br />
# nvidia-smi<br />
install -D -m755 nvidia-smi "${pkgdir}/usr/bin/nvidia-smi"<br />
install -D -m644 nvidia-smi.1.gz "${pkgdir}/usr/share/man/man1/nvidia-smi.1.gz"<br />
<br />
install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/nvidia/LICENSE"<br />
ln -s nvidia "${pkgdir}/usr/share/licenses/nvidia-utils"<br />
install -D -m644 README.txt "${pkgdir}/usr/share/doc/nvidia/README"<br />
install -D -m644 NVIDIA_Changelog "${pkgdir}/usr/share/doc/nvidia/NVIDIA_Changelog"<br />
ln -s nvidia "${pkgdir}/usr/share/doc/nvidia-utils"<br />
<br />
create_links<br />
}<br />
<br />
</nowiki>}}<br />
<br />
It is not necessary to patch other packages. If you want, you can also install nvidia-custom (https://aur.archlinux.org/packages.php?ID=60981) and opencl-nvidia-custom (https://aur.archlinux.org/packages.php?ID=61443) from the AUR, but they are not much different from the official ones (nvidia and opencl-nvidia from extra).<br />
<br />
If you rebuild nvidia-utils yourself, you may want to add it to the IgnorePkg line of your /etc/pacman.conf, so that the next system update does not break your system.<br />
<br />
===CUDA Toolkit===<br />
<br />
Install the package from community (https://www.archlinux.org/packages/community/x86_64/cuda/).<br />
<br />
===Configurations===<br />
<br />
Since Linux 3.9, the acpi-handle-hack module is no longer necessary for the Nvidia video adapter to get recognized. Depending on your system, just loading the nvidia module may be enough, but it may be necessary to create devices for CUDA. One way to accomplish this is to add the following to your /etc/rc.local:<br />
<br />
{{bc|<nowiki><br />
/sbin/modprobe nvidia<br />
<br />
if [ "$?" -eq 0 ]; then<br />
<br />
# Count the number of NVIDIA controllers found.<br />
<br />
N3D=`lspci | grep -i NVIDIA | grep "3D controller" | wc -l`<br />
<br />
NVGA=`lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l`<br />
<br />
N=`expr $N3D + $NVGA - 1`<br />
<br />
for i in `seq 0 $N`; do<br />
mknod -m 666 /dev/nvidia$i c 195 $i<br />
done<br />
<br />
mknod -m 666 /dev/nvidiactl c 195 255<br />
else<br />
exit 1<br />
fi<br />
</nowiki>}}<br />
<br />
If you are using systemd, you can get the /etc/rc.local loaded at boot by adding a new service. Create the following file:<br />
<br />
{{bc|1=<br />
#/etc/systemd/system/rc-local.service<br />
<br />
[Unit]<br />
Description=/etc/rc.local Compatibility<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/etc/rc.local<br />
TimeoutSec=0<br />
StandardInput=tty<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
Then make this service load at boot with:<br />
<br />
systemctl enable rc-local.service<br />
<br />
===Testing it===<br />
The cuda package includes both the cuda-toolkit and sdk. Before testing it, reboot and it should be working. To compile and run deviceQuery from the sdk:<br />
<br />
cd /opt/cuda/samples/1_Utilities/deviceQuery<br />
make<br />
./deviceQuery<br />
<br />
Alternatively, you can compile your own code and run it. To compile, say hello.cu, use:<br />
<br />
nvcc hello.cu<br />
<br />
Now you can run the executable:<br />
<br />
./a.out<br />
<br />
If this works without errors, you are all set!</div>Kousu