https://wiki.archlinux.org/api.php?action=feedcontributions&user=Aelman&feedformat=atomArchWiki - User contributions [en]2024-03-19T01:14:16ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=LightDM&diff=797189LightDM2024-01-16T01:15:53Z<p>Aelman: /* Infinite login loop */ grammar fix</p>
<hr />
<div>[[Category:Display managers]]<br />
[[Category:Canonical]]<br />
[[de:Login-Manager#LightDM]]<br />
[[ja:LightDM]]<br />
[[ru:LightDM]]<br />
[[zh-hans:LightDM]]<br />
{{Related articles start}}<br />
{{Related|Display manager}}<br />
{{Related|GDM}}<br />
{{Related|LXDM}}<br />
{{Related articles end}}<br />
<br />
[https://github.com/canonical/lightdm LightDM] is a cross-desktop [[display manager]]. Its key features are:<br />
<br />
* Cross-desktop - supports different desktop technologies.<br />
* Supports different display technologies (X, Mir, Wayland ...).<br />
* Lightweight - low memory usage and high performance.<br />
* Supports guest sessions.<br />
* Supports remote login (incoming - [[XDMCP]], [[VNC]], outgoing - XDMCP, [[PAM]]).<br />
* Comprehensive test suite.<br />
* Low code complexity.<br />
<br />
More details about LightDM's design can be found [https://www.freedesktop.org/wiki/Software/LightDM/Design here].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|lightdm}} package or {{AUR|lightdm-git}} for the development version.<br />
<br />
=== Greeter ===<br />
<br />
You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. It is possible to use LightDM without a greeter, but only if an automatic login is configured; otherwise you will need to install {{pkg|xorg-server}} and one of the greeter packages below.<br />
<br />
The official repositories contain the following greeters:<br />
<br />
* {{Pkg|lightdm-gtk-greeter}}: This is the '''default''' greeter LightDM attempts to use, unless configured otherwise.<br />
* lightdm-deepin-greeter ({{Pkg|deepin-session-shell}}): A greeter from the [[Deepin]] project.<br />
* {{Pkg|lightdm-pantheon-greeter}}: A greeter from the elementary OS project.<br />
* {{Pkg|lightdm-slick-greeter}}: A GTK based greeter focused more on appearance than {{Pkg|lightdm-gtk-greeter}}, originally forked from the Unity greeter, and default in Linux Mint.<br />
* {{Pkg|lightdm-webkit2-greeter}}: A greeter that uses Webkit2 for theming. It supersedes lightdm-webkit-greeter.<br />
* {{Pkg|lightdm-webkit-theme-litarvan}}: A modern and full-featured Webkit2 LightDM theme.<br />
<br />
Other alternative greeters are available in the [[AUR]]:<br />
<br />
* {{AUR|lightdm-mini-greeter}}: A minimal, configurable, single-user greeter.<br />
* {{AUR|web-greeter-theme-shikai}}: Aesthetic, customizable lightdm theme for the lightdm {{AUR|web-greeter}}.<br />
* {{AUR|lightdm-webkit-theme-aether}}: A sleek, straightforward Arch Linux themed login screen written on lightdm and the lightdm-webkit2-greeter.<br />
* {{AUR|lightdm-elephant-greeter-git}}: A small and simple greeter that runs in the {{Pkg|cage}} Wayland compositor per default.<br />
* {{AUR|web-greeter}}: A modern, visually appealing greeter that uses PyQtWebEngine for theming. It supersedes {{Pkg|lightdm-webkit2-greeter}}.<br />
<br />
You can set the default greeter by changing the {{ic|[Seat:*]}} section of the LightDM configuration file, like so:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
...<br />
greeter-session=lightdm-''yourgreeter''-greeter<br />
...<br />
}}<br />
<br />
{{Note|{{Pkg|lightdm-pantheon-greeter}}'s corresponding configuration file is {{ic|io.elementary.greeter.conf}}, not {{ic|lightdm-pantheon-greeter.conf}}}}<br />
<br />
One way to check which greeters are available is to list the files in the {{ic|/usr/share/xgreeters}} directory; each ''.desktop'' file represents an available greeter. In this example, the {{ic|lightdm-gtk-greeter}} and {{ic|lightdm-webkit2-greeter}} greeters are available:<br />
<br />
{{hc|$ ls -1 /usr/share/xgreeters/|<br />
lightdm-gtk-greeter.desktop<br />
lightdm-webkit2-greeter.desktop<br />
}}<br />
<br />
== Enabling LightDM ==<br />
<br />
Make sure to [[enable]] {{ic|lightdm.service}} so LightDM will be started at boot; see also [[Display manager#Loading the display manager]].<br />
<br />
== Command line tool ==<br />
<br />
LightDM offers a command line tool, {{ic|dm-tool}}, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:<br />
<br />
$ dm-tool --help<br />
<br />
=== User switching ===<br />
<br />
{{Warning|''dm-tool'' (with {{ic|dm-tool lock}} or {{ic|dm-tool switch-to-greeter}}) can easily be bypassed and will not lock your session without [[#Lock the screen using light-locker|light-locker]] or an other [[List of applications/Security#Screen lockers|loginctl compatible screen locker]]. See [[XScreenSaver#User switching from the lock screen]].}}<br />
<br />
LightDM's ''dm-tool'' command can be used to allow multiple users to be logged in on separate ttys. The following will send a signal requesting that the current session be locked and then will initiate a switch to LightDM's greeter, allowing a new user to log in to the system.<br />
<br />
$ dm-tool switch-to-greeter<br />
<br />
== Testing ==<br />
<br />
First, [[install]] {{Pkg|xorg-server-xephyr}}.<br />
<br />
Then, run LightDM as an X application:<br />
<br />
$ lightdm --test-mode --debug<br />
<br />
== Optional configuration and tweaks ==<br />
<br />
LightDM can be configured by modifying its configuration file, {{ic|/etc/lightdm/lightdm.conf}}.<br />
<br />
Some greeters have their own configuration files. For example:<br />
<br />
{{Pkg|lightdm-gtk-greeter}}: {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} (or you can use the {{Pkg|lightdm-gtk-greeter-settings}} gui).<br />
<br />
{{Pkg|lightdm-webkit2-greeter}}: {{ic|/etc/lightdm/lightdm-webkit2-greeter.conf}}<br />
<br />
=== X session wrapper ===<br />
<br />
{{Merge|Xprofile|Duplicated information}}<br />
<br />
If you are migrating from [[xinit]], you will notice that the display is not launched by your shell. This is because, as opposed to your shell starting the display (and the display inheriting the environment of your shell), LightDM starts your display and does not source your shell. LightDM launches the display by running a wrapper script and that finally exec's your graphic environment. By default, {{ic|/etc/lightdm/Xsession}} is run.<br />
<br />
==== Environment variables ====<br />
<br />
The script checks and sources {{ic|/etc/profile}}, {{ic|~/.profile}}, {{ic|/etc/xprofile}} and {{ic|~/.xprofile}}, in that order. If you are using a shell that does not source any of these files, you can create an {{ic|~/.xprofile}} to do so. (In this example, the login shell is [[zsh]])<br />
<br />
{{hc|~/.xprofile|2=<br />
#!/bin/sh<br />
<nowiki>[ -f ~/.config/zsh/.zshenv ] && . ~/.config/zsh/.zshenv</nowiki><br />
}}<br />
<br />
If you have shell variables that are important for your display (such as Gtk or QT themes, GNUPG location, configuration overrides, etc.) this will let your graphic environment have access to your environment without having to be launched by your login shell.<br />
<br />
==== Keymap ====<br />
<br />
The script runs [[Xkbmap]] with arguments provided in files {{ic|/etc/X11/Xkbmap}}, {{ic|~/.Xkbmap}}. If those files are not found, it runs [[xmodmap]] with {{ic|/etc/X11/Xmodmap}}, {{ic|~/.Xmodmap}}. If using xkbmap, the files are parsed using cat. The following example works<br />
<br />
{{hc|~/.Xmodmap|2=<br />
-model pc105 -layout us,us,tr -variant ,dvorak,f -option grp:caps_toggle<br />
}}<br />
<br />
Otherwise, the session inherits the system default mapping of X11. This mapping can be defined in the xorg configuration files, either manually or with {{ic|localectl set-x11-keymap}}. See [[Xorg/Keyboard configuration#Setting keyboard layout]].<br />
<br />
==== Multiple keyboard layouts in lightdm-gtk-greeter ====<br />
<br />
To enable users switch between pre-defined keyboard layouts on the log-in screen enable the drop-down menu and configure the layouts. Either use the {{Pkg|lightdm-gtk-greeter-settings}} gui or edit the configuration file directly:<br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
indicators = ~host;~spacer;~clock;~spacer;~layout;~language;~session;~a11y;~power<br />
}}<br />
<br />
Use [[Xorg/Keyboard configuration#Using localectl|localectl]] to set multiple layouts, e.g. de and its “variant” neo with the latter as primary:<br />
<br />
# localectl --no-convert set-x11-keymap de,de pc105 neo,<br />
<br />
Note the trailing comma which implies a blank variant for the second de.<br />
<br />
=== Changing background images/colors ===<br />
<br />
You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.<br />
<br />
==== GTK greeter ====<br />
<br />
You can use the {{Pkg|lightdm-gtk-greeter-settings}} gui.<br />
<br />
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and define the {{ic|background}} variable under the {{ic|[greeter]}} section. For example:<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg<br />
}}<br />
<br />
{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}<br />
<br />
GTK3 themes can be specified with the {{ic|theme-name}} variable in the {{ic|[greeter]}} section. The icon and cursor theme can be set in the same way, as shown in the following example: <br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
theme-name = Tela<br />
icon-theme-name = Tela<br />
cursor-theme-name = Tela<br />
cursor-theme-size = 32<br />
font-name = Cantarell 20<br />
}}<br />
<br />
==== Webkit2 greeter ====<br />
<br />
The {{Pkg|lightdm-webkit2-greeter}} allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts if you use the [https://github.com/artur9010/lightdm-webkit-material Material theme]. By default, images are sourced from {{ic|/usr/share/backgrounds}}. You can change the background images directory by editing {{ic|lightdm-webkit2-greeter.conf}}. For example:<br />
{{hc|/etc/lightdm/lightdm-webkit2-greeter.conf|2=<br />
[branding]<br />
background_images = /usr/share/backgrounds<br />
}}<br />
<br />
{{Note|The background images directory must be accessible to the LightDM user so it should not be located anywhere under {{ic|/home}}.}}<br />
<br />
==== Slick Greeter ====<br />
<br />
Use the {{AUR|lightdm-settings}} GUI<br />
<br />
=== Changing your avatar ===<br />
<br />
First, make sure the {{Pkg|accountsservice}} package is installed, then set it up as follows, replacing {{ic|''username''}} with the desired user's login name.<br />
<br />
* Create the file {{ic|/var/lib/AccountsService/icons/''username''.png}} using a 96x96 PNG image file. Different image file formats are possible too, e.g., JPEG.<br />
* Alternatively, create the image file as {{ic|/home/''username''/.face}} and skip the next step if the defaults already point to the user home directory path<br />
* Edit or create the account settings file {{ic|/var/lib/AccountsService/users/''username''}}, and add the lines<br />
<br />
[User]<br />
Icon=/var/lib/AccountsService/icons/''username''.png<br />
<br />
The filename here should point to the icon created in the first step, so adjust the filename extension if necessary.<br />
<br />
{{Note|Make sure that both created files have 644 permissions, use [[chmod]] to correct them.}}<br />
<br />
=== Sources of Arch-centric 64x64 icons ===<br />
<br />
The {{AUR|archlinux-artwork}} package contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:<br />
<br />
# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;<br />
<br />
After copying, the {{AUR|archlinux-artwork}} package can be removed.<br />
<br />
=== Enabling autologin ===<br />
<br />
Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
autologin-user=''username''<br />
}}<br />
<br />
You must be part of the {{ic|autologin}} group to be able to login automatically without entering your password:<br />
<br />
# groupadd -r autologin<br />
# gpasswd -a ''username'' autologin<br />
<br />
LightDM logs in using the session specified in the {{ic|~/.dmrc}} of the user getting logged in automatically. To override this file, specify {{ic|autologin-session}} in {{ic|lightdm.conf}}:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
autologin-user=''username''<br />
autologin-session=''session''<br />
}}<br />
<br />
The list of valid session names can be found by listing {{ic|/usr/share/xsessions/*.desktop}} for X's sessions and {{ic|/usr/share/wayland-sessions/*.desktop}} for Wayland's.<br />
<br />
{{Note|GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.}}<br />
<br />
=== Enabling interactive passwordless login ===<br />
<br />
LightDM goes through [[PAM]] so you must configure the lightdm configuration of PAM:<br />
<br />
{{hc|/etc/pam.d/lightdm|2=<br />
#%PAM-1.0<br />
'''auth sufficient pam_succeed_if.so user ingroup nopasswdlogin'''<br />
auth include system-login<br />
...<br />
}}<br />
<br />
You must then also be part of the {{ic|nopasswdlogin}} group and the {{ic|autologin}} group to be able to login interactively without entering your password:<br />
<br />
# groupadd -r nopasswdlogin<br />
# groupadd -r autologin<br />
# gpasswd -a ''username'' nopasswdlogin<br />
# gpasswd -a ''username'' autologin<br />
<br />
{{Note|GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.}}<br />
<br />
To create a new user account that logs in automatically and additionally able to login again without a password the user can be created with supplementary membership of both groups, e.g.:<br />
<br />
# useradd -mG autologin,nopasswdlogin -s /bin/bash ''username''<br />
<br />
=== Enabling guest sessions ===<br />
<br />
{{Note|A guest user has passwordless access to your system after enabling this feature.}} <br />
<br />
To enable guest sessions in LightDM (without changing your system configuration) you need at least two things:<br />
<br />
# a '''guest-account-script''': defaults to {{ic|guest-account}} and accepts two commands:<br />
#* '''add''' (to create a temporary guest system account and returns the user name of the created account)<br />
#* '''remove''' ''account name''(to delete the corresponding account)<br />
# an [[#Enabling autologin|'''autologin''']] group to which the created guest account must be added (cf. {{ic|/etc/pam.d/lightdm-autologin}})<br />
<br />
There are two AUR packages that enable guest sessions in lightdm:<br />
<br />
* {{aur|lightdm-guest}} which provides the (largely unmodified) upstream guest-session script as well as {{pkg|lightdm}} itself.<br />
* {{aur|lightdm-guest-account}} which provides only a minimal version of the script.<br />
<br />
=== Hiding system and services users ===<br />
<br />
To prevent system users from showing-up in the login, install the optional dependency {{Pkg|accountsservice}}, or add the user names to {{ic|/etc/lightdm/users.conf}} under {{ic|hidden-users}}. The first option has the advantage of not needing to update the list when more users are added or removed.<br />
<br />
=== Migrating from SLiM ===<br />
<br />
{{Merge|Display Manager|Not LightDM specific (or even SLiM specific for that matter as [[XDM]] also uses [[xinitrc]]). Perhaps this merits a one-liner somewhere on the [[Display Manager]] page?}}<br />
<br />
Move the contents of [[xinitrc]] to [[xprofile]], removing the call to start the [[window manager]] or [[desktop environment]].<br />
<br />
=== Login using ~/.xinitrc ===<br />
<br />
See [[Display manager#Run ~/.xinitrc as a session]].<br />
<br />
=== NumLock on by default ===<br />
<br />
Install the {{Pkg|numlockx}} package and then edit {{ic|/etc/lightdm/lightdm.conf}}:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
greeter-setup-script=/usr/bin/numlockx on<br />
}}<br />
<br />
=== Default session ===<br />
<br />
Lightdm, like other DMs, stores the last-selected xsession in {{ic|~/.dmrc}}. See [[Display manager#Session configuration]] for more info.<br />
<br />
=== Adjusting the login window's position ===<br />
<br />
==== GTK greeter ====<br />
<br />
Users need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and enter a value for the {{ic|position}} variable. It accepts {{ic|x}} and {{ic|y}} values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, {{ic|start}}, {{ic|center}} and {{ic|end}} separated from the value by a comma.<br />
<br />
Example:<br />
<br />
position=200,start 50%,center<br />
<br />
=== VNC Server ===<br />
<br />
Lightdm can also be used to connect to via VNC. Make sure to install {{pkg|tigervnc}} on the server side and optionally as your VNC client on the client PC.<br />
<br />
Setup an authentication password on the server as root:<br />
<br />
# vncpasswd /etc/vncpasswd<br />
<br />
Edit the LightDM configuration file as shown below. Note that {{ic|listen-address}} configures the VNC to only listen to connections from localhost. This is used to only allow connections via [[TigerVNC#On the client|SSH and port forwarding]]. On the SSH client, make sure that you use {{ic|localhost:5900}} for the tunnel destination; using {{ic|127.0.0.1:5900}} or {{ic|::1:5900}} is not reliable on dual stack network connections. If you want to allow insecure connections you can disable this setting.<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[VNCServer]<br />
enabled=true<br />
command=Xvnc -rfbauth /etc/vncpasswd<br />
port=5900<br />
listen-address=localhost<br />
width=1024<br />
height=768<br />
depth=24<br />
}}<br />
<br />
Now open an SSH tunnel and connect to localhost as described in [[TigerVNC#On the client]].<br />
<br />
{{Note|If you get a blank screen upon opening the VNC connection, try a different LightDM greeter.}}<br />
<br />
=== Lock the screen using light-locker ===<br />
<br />
{{Pkg|light-locker}} is a simple screen locker using LightDM to authenticate the user. Once installed and running, you can lock your session via:<br />
<br />
$ light-locker-command -l<br />
<br />
This requires {{ic|light-locker}} to be started at the beginning of your session. By default, this is enabled through [[XDG Autostart]]. See [[Autostarting]] for more options.<br />
<br />
=== Multiple-monitor setup ===<br />
<br />
Sometimes LightDM does not set the monitor resolution correctly on a multiple-monitor setup. The following Xorg configuration works with two monitors: a large primary screen on the left side, and a secondary smaller screen to its right. The order can be reversed and tweaked.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/52-resolution-fix.conf|2=<br />
Section "Monitor"<br />
Identifier "DP1"<br />
Option "PreferredMode" "3840x2160"<br />
Option "Primary" "1"<br />
EndSection<br />
Section "Monitor"<br />
Identifier "eDP1"<br />
Option "PreferredMode" "1920x1080"<br />
Option "RightOf" "DP1"<br />
EndSection<br />
}}<br />
<br />
This makes the {{ic|display-setup-script}} tweaks from {{ic|/etc/lightdm/lightdm.conf}} redundant.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Autologin does not work ===<br />
<br />
Ensure {{ic|1=autologin-user=}} in {{ic|/etc/lightdm/lightdm.conf}} contain the correct values. Trailing whitespace will cause errors.<br />
<br />
If autologin fails with a blank screen or if the login screen immediately returns, you may need to set {{ic|1=logind-check-graphical=true}}.<br />
<br />
You can also install {{AUR|lightdm-autologin-greeter-git}} for this special purpose.<br />
<br />
=== Viewing current configuration ===<br />
<br />
To view effective configuration, run:<br />
<br />
$ lightdm --show-config<br />
<br />
This will show current settings, with the configuration files these settings were read from.<br />
<br />
=== LightDM not starting and screen flashing ===<br />
<br />
If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's configuration file. And if you have correctly defined the GTK greeter, make sure the {{ic|xsessions-directory}} (default: {{ic|/usr/share/xsessions}}) exists and contains at least one .desktop file.<br />
<br />
The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:<br />
<br />
# dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetXSession string:xfce<br />
<br />
This example sets the session "xfce" as default for the user 1000.<br />
<br />
=== Wrong locale displayed ===<br />
<br />
In case of your locale not being displayed correctly in Lightdm add your locale to {{ic|/etc/environment}}:<br />
<br />
LANG=pt_PT.utf8<br />
<br />
Alternatively if you want LightDM and its greeters to be in a language other than your set system locale, you can use the {{ic|1=Environment=}} option in [[Systemd#Drop-in files]].<br />
<br />
=== Unresponsive for a few minutes after startup ===<br />
<br />
You may have to download more entropy. Install and enable haveged, c.f. https://github.com/canonical/lightdm/issues/17<br />
<br />
=== Missing icons with GTK greeter ===<br />
<br />
If you are using {{Pkg|lightdm-gtk-greeter}} as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:<br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
theme-name=mate # this should be the name of a directory under /usr/share/themes/<br />
icon-theme-name=mate # this should be the name of a fully featured icons set directory under /usr/share/icons/<br />
}}<br />
<br />
=== LightDM freezes on login attempt ===<br />
<br />
You may find that after entering the correct username and password and attempting to log in, LightDM freezes and you are unable to continue to the desktop. To fix the issue, reinstall the {{Pkg|gdk-pixbuf2}} package. See [https://bbs.archlinux.org/viewtopic.php?id=179031 this forum thread].<br />
<br />
=== LightDM displaying in wrong monitor ===<br />
<br />
If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit {{ic|/etc/lightdm/lightdm.conf}} and change the ''display-setup-script'' parameter like this:<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
display-setup-script=xrandr --output ''HDMI-1'' --primary<br />
}}<br />
<br />
Replace ''HDMI-1'' with your real monitor ID, which you can find from '''xrandr''' command output.<br />
<br />
Alternatively, if you are using the GTK greeter, you can edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and add the ''active-monitor'' parameter like this:<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
active-monitor=0<br />
}}<br />
<br />
Replace 0 with the desired display number.<br />
<br />
=== LightDM does not appear or monitor only displays TTY output ===<br />
<br />
It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you will want to add the following to your {{ic|lightdm.conf}} file:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[LightDM]<br />
logind-check-graphical=true<br />
}}<br />
<br />
This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them. <br />
<br />
'''With newer versions of LightDM, this is now the default setting.''' As a consequence, on some hardware, your graphics drivers may not be properly detected and LightDM may never attempt to launch a greeter--even after the system has stabilized after boot. If this occurs, setting this to false will disable the check and force LightDM to launch a greeter regardless.<br />
<br />
=== LightDM is running with low FPS on Intel Graphics ===<br />
<br />
See [[Intel graphics#AccelMethod]].<br />
<br />
=== Pulseaudio not starting automatically ===<br />
<br />
See [[PulseAudio#Running]].<br />
<br />
=== Long pause before LightDM shows up when home is encrypted ===<br />
<br />
Some LightDM themes try to access the user avatar located in HOME. If your HOME is encrypted, LightDM cannot access it and hangs. To prevent this from happening, you can either:<br />
<br />
* Set your avatar as explained in [[#Changing your avatar]]<br />
* for {{Pkg|lightdm-gtk-greeter}} only: {{Ic|<nowiki>hide-user-image = true</nowiki>}} in {{Ic|/etc/lightdm/lightdm-gtk-greeter.conf}}<br />
<br />
=== Boot hangs on "[ OK ] Reached target Graphical Interface." ===<br />
<br />
There is a possibility that user and group lookups fail if you modified {{ic|/etc/nsswitch.conf}}. That happens when {{ic|nsswitch.conf}} group: includes {{ic|ldap}} without setting {{ic|nss_initgroups_ignoreusers ALLLOCAL}} in {{ic|/etc/nslcd.conf}}<br />
<br />
=== Wayland session not working with duplicate GNOME entries in greeter ===<br />
<br />
Some greeters ({{Pkg|lightdm-webkit2-greeter}} for example) do not support two sessions with the same name [https://github.com/canonical/lightdm/issues/16]. To check for duplicate entries:<br />
<br />
$ ls -1 /usr/share/wayland-sessions /usr/share/xsessions<br />
<br />
Rename the duplicate entry in {{ic|/usr/share/xsessions}}. For example:<br />
<br />
# mv /usr/share/xsessions/gnome.desktop /usr/share/xsessions/gnome.desktop.disabled<br />
<br />
=== Login always segfaults on first attempt ===<br />
<br />
Set a hostname as described in [[Network configuration#Set the hostname|Network Page]]. See also {{Bug|47694}}.<br />
<br />
=== Infinite login loop ===<br />
<br />
If you get stuck in loop in which you type your correct username and password but the screen goes black and then you return to the login prompt after every attempt, running {{ic|rm ~/.Xauthority}} (or the stuck user's problematic {{ic|.Xauthority}}) may fix the issue.<br />
<br />
Another reason for this may be that you tried to recreate your "lightdm.conf" from scratch and your version is missing this line:<br />
<br />
session-wrapper=/etc/lightdm/Xsession<br />
<br />
In that case, lightdm tries to use "lightdm-session" as the session-wrapper which does not exist on Arch Linux.<br />
<br />
If your lightdm.conf file contains the intended session-wrapper but the lightdm logs indicate that the default session wrapper is being used instead, ensure that your lightdm.conf file is available during startup. For example, you may have created a symlink to a file in your home directory, but your home directory is not being mounted before the LightDM service started. In such cases LightDM will fall back to the default session wrapper.<br />
<br />
== See also ==<br />
<br />
* [https://wiki.ubuntu.com/LightDM Ubuntu Wiki article]<br />
* [[Gentoo:LightDM]]<br />
* [https://launchpad.net/lightdm Launchpad Page] obsolete<br />
* https://wiki.ubuntu.com/MattFischer<br />
* [https://github.com/CanonicalLtd/lightdm LightDM on GitHub]</div>Aelmanhttps://wiki.archlinux.org/index.php?title=LightDM&diff=797188LightDM2024-01-16T00:27:10Z<p>Aelman: /* Infinite login loop */ Additional troubleshooting advice</p>
<hr />
<div>[[Category:Display managers]]<br />
[[Category:Canonical]]<br />
[[de:Login-Manager#LightDM]]<br />
[[ja:LightDM]]<br />
[[ru:LightDM]]<br />
[[zh-hans:LightDM]]<br />
{{Related articles start}}<br />
{{Related|Display manager}}<br />
{{Related|GDM}}<br />
{{Related|LXDM}}<br />
{{Related articles end}}<br />
<br />
[https://github.com/canonical/lightdm LightDM] is a cross-desktop [[display manager]]. Its key features are:<br />
<br />
* Cross-desktop - supports different desktop technologies.<br />
* Supports different display technologies (X, Mir, Wayland ...).<br />
* Lightweight - low memory usage and high performance.<br />
* Supports guest sessions.<br />
* Supports remote login (incoming - [[XDMCP]], [[VNC]], outgoing - XDMCP, [[PAM]]).<br />
* Comprehensive test suite.<br />
* Low code complexity.<br />
<br />
More details about LightDM's design can be found [https://www.freedesktop.org/wiki/Software/LightDM/Design here].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|lightdm}} package or {{AUR|lightdm-git}} for the development version.<br />
<br />
=== Greeter ===<br />
<br />
You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. It is possible to use LightDM without a greeter, but only if an automatic login is configured; otherwise you will need to install {{pkg|xorg-server}} and one of the greeter packages below.<br />
<br />
The official repositories contain the following greeters:<br />
<br />
* {{Pkg|lightdm-gtk-greeter}}: This is the '''default''' greeter LightDM attempts to use, unless configured otherwise.<br />
* lightdm-deepin-greeter ({{Pkg|deepin-session-shell}}): A greeter from the [[Deepin]] project.<br />
* {{Pkg|lightdm-pantheon-greeter}}: A greeter from the elementary OS project.<br />
* {{Pkg|lightdm-slick-greeter}}: A GTK based greeter focused more on appearance than {{Pkg|lightdm-gtk-greeter}}, originally forked from the Unity greeter, and default in Linux Mint.<br />
* {{Pkg|lightdm-webkit2-greeter}}: A greeter that uses Webkit2 for theming. It supersedes lightdm-webkit-greeter.<br />
* {{Pkg|lightdm-webkit-theme-litarvan}}: A modern and full-featured Webkit2 LightDM theme.<br />
<br />
Other alternative greeters are available in the [[AUR]]:<br />
<br />
* {{AUR|lightdm-mini-greeter}}: A minimal, configurable, single-user greeter.<br />
* {{AUR|web-greeter-theme-shikai}}: Aesthetic, customizable lightdm theme for the lightdm {{AUR|web-greeter}}.<br />
* {{AUR|lightdm-webkit-theme-aether}}: A sleek, straightforward Arch Linux themed login screen written on lightdm and the lightdm-webkit2-greeter.<br />
* {{AUR|lightdm-elephant-greeter-git}}: A small and simple greeter that runs in the {{Pkg|cage}} Wayland compositor per default.<br />
* {{AUR|web-greeter}}: A modern, visually appealing greeter that uses PyQtWebEngine for theming. It supersedes {{Pkg|lightdm-webkit2-greeter}}.<br />
<br />
You can set the default greeter by changing the {{ic|[Seat:*]}} section of the LightDM configuration file, like so:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
...<br />
greeter-session=lightdm-''yourgreeter''-greeter<br />
...<br />
}}<br />
<br />
{{Note|{{Pkg|lightdm-pantheon-greeter}}'s corresponding configuration file is {{ic|io.elementary.greeter.conf}}, not {{ic|lightdm-pantheon-greeter.conf}}}}<br />
<br />
One way to check which greeters are available is to list the files in the {{ic|/usr/share/xgreeters}} directory; each ''.desktop'' file represents an available greeter. In this example, the {{ic|lightdm-gtk-greeter}} and {{ic|lightdm-webkit2-greeter}} greeters are available:<br />
<br />
{{hc|$ ls -1 /usr/share/xgreeters/|<br />
lightdm-gtk-greeter.desktop<br />
lightdm-webkit2-greeter.desktop<br />
}}<br />
<br />
== Enabling LightDM ==<br />
<br />
Make sure to [[enable]] {{ic|lightdm.service}} so LightDM will be started at boot; see also [[Display manager#Loading the display manager]].<br />
<br />
== Command line tool ==<br />
<br />
LightDM offers a command line tool, {{ic|dm-tool}}, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:<br />
<br />
$ dm-tool --help<br />
<br />
=== User switching ===<br />
<br />
{{Warning|''dm-tool'' (with {{ic|dm-tool lock}} or {{ic|dm-tool switch-to-greeter}}) can easily be bypassed and will not lock your session without [[#Lock the screen using light-locker|light-locker]] or an other [[List of applications/Security#Screen lockers|loginctl compatible screen locker]]. See [[XScreenSaver#User switching from the lock screen]].}}<br />
<br />
LightDM's ''dm-tool'' command can be used to allow multiple users to be logged in on separate ttys. The following will send a signal requesting that the current session be locked and then will initiate a switch to LightDM's greeter, allowing a new user to log in to the system.<br />
<br />
$ dm-tool switch-to-greeter<br />
<br />
== Testing ==<br />
<br />
First, [[install]] {{Pkg|xorg-server-xephyr}}.<br />
<br />
Then, run LightDM as an X application:<br />
<br />
$ lightdm --test-mode --debug<br />
<br />
== Optional configuration and tweaks ==<br />
<br />
LightDM can be configured by modifying its configuration file, {{ic|/etc/lightdm/lightdm.conf}}.<br />
<br />
Some greeters have their own configuration files. For example:<br />
<br />
{{Pkg|lightdm-gtk-greeter}}: {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} (or you can use the {{Pkg|lightdm-gtk-greeter-settings}} gui).<br />
<br />
{{Pkg|lightdm-webkit2-greeter}}: {{ic|/etc/lightdm/lightdm-webkit2-greeter.conf}}<br />
<br />
=== X session wrapper ===<br />
<br />
{{Merge|Xprofile|Duplicated information}}<br />
<br />
If you are migrating from [[xinit]], you will notice that the display is not launched by your shell. This is because, as opposed to your shell starting the display (and the display inheriting the environment of your shell), LightDM starts your display and does not source your shell. LightDM launches the display by running a wrapper script and that finally exec's your graphic environment. By default, {{ic|/etc/lightdm/Xsession}} is run.<br />
<br />
==== Environment variables ====<br />
<br />
The script checks and sources {{ic|/etc/profile}}, {{ic|~/.profile}}, {{ic|/etc/xprofile}} and {{ic|~/.xprofile}}, in that order. If you are using a shell that does not source any of these files, you can create an {{ic|~/.xprofile}} to do so. (In this example, the login shell is [[zsh]])<br />
<br />
{{hc|~/.xprofile|2=<br />
#!/bin/sh<br />
<nowiki>[ -f ~/.config/zsh/.zshenv ] && . ~/.config/zsh/.zshenv</nowiki><br />
}}<br />
<br />
If you have shell variables that are important for your display (such as Gtk or QT themes, GNUPG location, configuration overrides, etc.) this will let your graphic environment have access to your environment without having to be launched by your login shell.<br />
<br />
==== Keymap ====<br />
<br />
The script runs [[Xkbmap]] with arguments provided in files {{ic|/etc/X11/Xkbmap}}, {{ic|~/.Xkbmap}}. If those files are not found, it runs [[xmodmap]] with {{ic|/etc/X11/Xmodmap}}, {{ic|~/.Xmodmap}}. If using xkbmap, the files are parsed using cat. The following example works<br />
<br />
{{hc|~/.Xmodmap|2=<br />
-model pc105 -layout us,us,tr -variant ,dvorak,f -option grp:caps_toggle<br />
}}<br />
<br />
Otherwise, the session inherits the system default mapping of X11. This mapping can be defined in the xorg configuration files, either manually or with {{ic|localectl set-x11-keymap}}. See [[Xorg/Keyboard configuration#Setting keyboard layout]].<br />
<br />
==== Multiple keyboard layouts in lightdm-gtk-greeter ====<br />
<br />
To enable users switch between pre-defined keyboard layouts on the log-in screen enable the drop-down menu and configure the layouts. Either use the {{Pkg|lightdm-gtk-greeter-settings}} gui or edit the configuration file directly:<br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
indicators = ~host;~spacer;~clock;~spacer;~layout;~language;~session;~a11y;~power<br />
}}<br />
<br />
Use [[Xorg/Keyboard configuration#Using localectl|localectl]] to set multiple layouts, e.g. de and its “variant” neo with the latter as primary:<br />
<br />
# localectl --no-convert set-x11-keymap de,de pc105 neo,<br />
<br />
Note the trailing comma which implies a blank variant for the second de.<br />
<br />
=== Changing background images/colors ===<br />
<br />
You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.<br />
<br />
==== GTK greeter ====<br />
<br />
You can use the {{Pkg|lightdm-gtk-greeter-settings}} gui.<br />
<br />
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and define the {{ic|background}} variable under the {{ic|[greeter]}} section. For example:<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg<br />
}}<br />
<br />
{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}<br />
<br />
GTK3 themes can be specified with the {{ic|theme-name}} variable in the {{ic|[greeter]}} section. The icon and cursor theme can be set in the same way, as shown in the following example: <br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
theme-name = Tela<br />
icon-theme-name = Tela<br />
cursor-theme-name = Tela<br />
cursor-theme-size = 32<br />
font-name = Cantarell 20<br />
}}<br />
<br />
==== Webkit2 greeter ====<br />
<br />
The {{Pkg|lightdm-webkit2-greeter}} allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts if you use the [https://github.com/artur9010/lightdm-webkit-material Material theme]. By default, images are sourced from {{ic|/usr/share/backgrounds}}. You can change the background images directory by editing {{ic|lightdm-webkit2-greeter.conf}}. For example:<br />
{{hc|/etc/lightdm/lightdm-webkit2-greeter.conf|2=<br />
[branding]<br />
background_images = /usr/share/backgrounds<br />
}}<br />
<br />
{{Note|The background images directory must be accessible to the LightDM user so it should not be located anywhere under {{ic|/home}}.}}<br />
<br />
==== Slick Greeter ====<br />
<br />
Use the {{AUR|lightdm-settings}} GUI<br />
<br />
=== Changing your avatar ===<br />
<br />
First, make sure the {{Pkg|accountsservice}} package is installed, then set it up as follows, replacing {{ic|''username''}} with the desired user's login name.<br />
<br />
* Create the file {{ic|/var/lib/AccountsService/icons/''username''.png}} using a 96x96 PNG image file. Different image file formats are possible too, e.g., JPEG.<br />
* Alternatively, create the image file as {{ic|/home/''username''/.face}} and skip the next step if the defaults already point to the user home directory path<br />
* Edit or create the account settings file {{ic|/var/lib/AccountsService/users/''username''}}, and add the lines<br />
<br />
[User]<br />
Icon=/var/lib/AccountsService/icons/''username''.png<br />
<br />
The filename here should point to the icon created in the first step, so adjust the filename extension if necessary.<br />
<br />
{{Note|Make sure that both created files have 644 permissions, use [[chmod]] to correct them.}}<br />
<br />
=== Sources of Arch-centric 64x64 icons ===<br />
<br />
The {{AUR|archlinux-artwork}} package contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:<br />
<br />
# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;<br />
<br />
After copying, the {{AUR|archlinux-artwork}} package can be removed.<br />
<br />
=== Enabling autologin ===<br />
<br />
Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
autologin-user=''username''<br />
}}<br />
<br />
You must be part of the {{ic|autologin}} group to be able to login automatically without entering your password:<br />
<br />
# groupadd -r autologin<br />
# gpasswd -a ''username'' autologin<br />
<br />
LightDM logs in using the session specified in the {{ic|~/.dmrc}} of the user getting logged in automatically. To override this file, specify {{ic|autologin-session}} in {{ic|lightdm.conf}}:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
autologin-user=''username''<br />
autologin-session=''session''<br />
}}<br />
<br />
The list of valid session names can be found by listing {{ic|/usr/share/xsessions/*.desktop}} for X's sessions and {{ic|/usr/share/wayland-sessions/*.desktop}} for Wayland's.<br />
<br />
{{Note|GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.}}<br />
<br />
=== Enabling interactive passwordless login ===<br />
<br />
LightDM goes through [[PAM]] so you must configure the lightdm configuration of PAM:<br />
<br />
{{hc|/etc/pam.d/lightdm|2=<br />
#%PAM-1.0<br />
'''auth sufficient pam_succeed_if.so user ingroup nopasswdlogin'''<br />
auth include system-login<br />
...<br />
}}<br />
<br />
You must then also be part of the {{ic|nopasswdlogin}} group and the {{ic|autologin}} group to be able to login interactively without entering your password:<br />
<br />
# groupadd -r nopasswdlogin<br />
# groupadd -r autologin<br />
# gpasswd -a ''username'' nopasswdlogin<br />
# gpasswd -a ''username'' autologin<br />
<br />
{{Note|GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.}}<br />
<br />
To create a new user account that logs in automatically and additionally able to login again without a password the user can be created with supplementary membership of both groups, e.g.:<br />
<br />
# useradd -mG autologin,nopasswdlogin -s /bin/bash ''username''<br />
<br />
=== Enabling guest sessions ===<br />
<br />
{{Note|A guest user has passwordless access to your system after enabling this feature.}} <br />
<br />
To enable guest sessions in LightDM (without changing your system configuration) you need at least two things:<br />
<br />
# a '''guest-account-script''': defaults to {{ic|guest-account}} and accepts two commands:<br />
#* '''add''' (to create a temporary guest system account and returns the user name of the created account)<br />
#* '''remove''' ''account name''(to delete the corresponding account)<br />
# an [[#Enabling autologin|'''autologin''']] group to which the created guest account must be added (cf. {{ic|/etc/pam.d/lightdm-autologin}})<br />
<br />
There are two AUR packages that enable guest sessions in lightdm:<br />
<br />
* {{aur|lightdm-guest}} which provides the (largely unmodified) upstream guest-session script as well as {{pkg|lightdm}} itself.<br />
* {{aur|lightdm-guest-account}} which provides only a minimal version of the script.<br />
<br />
=== Hiding system and services users ===<br />
<br />
To prevent system users from showing-up in the login, install the optional dependency {{Pkg|accountsservice}}, or add the user names to {{ic|/etc/lightdm/users.conf}} under {{ic|hidden-users}}. The first option has the advantage of not needing to update the list when more users are added or removed.<br />
<br />
=== Migrating from SLiM ===<br />
<br />
{{Merge|Display Manager|Not LightDM specific (or even SLiM specific for that matter as [[XDM]] also uses [[xinitrc]]). Perhaps this merits a one-liner somewhere on the [[Display Manager]] page?}}<br />
<br />
Move the contents of [[xinitrc]] to [[xprofile]], removing the call to start the [[window manager]] or [[desktop environment]].<br />
<br />
=== Login using ~/.xinitrc ===<br />
<br />
See [[Display manager#Run ~/.xinitrc as a session]].<br />
<br />
=== NumLock on by default ===<br />
<br />
Install the {{Pkg|numlockx}} package and then edit {{ic|/etc/lightdm/lightdm.conf}}:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[Seat:*]<br />
greeter-setup-script=/usr/bin/numlockx on<br />
}}<br />
<br />
=== Default session ===<br />
<br />
Lightdm, like other DMs, stores the last-selected xsession in {{ic|~/.dmrc}}. See [[Display manager#Session configuration]] for more info.<br />
<br />
=== Adjusting the login window's position ===<br />
<br />
==== GTK greeter ====<br />
<br />
Users need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and enter a value for the {{ic|position}} variable. It accepts {{ic|x}} and {{ic|y}} values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, {{ic|start}}, {{ic|center}} and {{ic|end}} separated from the value by a comma.<br />
<br />
Example:<br />
<br />
position=200,start 50%,center<br />
<br />
=== VNC Server ===<br />
<br />
Lightdm can also be used to connect to via VNC. Make sure to install {{pkg|tigervnc}} on the server side and optionally as your VNC client on the client PC.<br />
<br />
Setup an authentication password on the server as root:<br />
<br />
# vncpasswd /etc/vncpasswd<br />
<br />
Edit the LightDM configuration file as shown below. Note that {{ic|listen-address}} configures the VNC to only listen to connections from localhost. This is used to only allow connections via [[TigerVNC#On the client|SSH and port forwarding]]. On the SSH client, make sure that you use {{ic|localhost:5900}} for the tunnel destination; using {{ic|127.0.0.1:5900}} or {{ic|::1:5900}} is not reliable on dual stack network connections. If you want to allow insecure connections you can disable this setting.<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[VNCServer]<br />
enabled=true<br />
command=Xvnc -rfbauth /etc/vncpasswd<br />
port=5900<br />
listen-address=localhost<br />
width=1024<br />
height=768<br />
depth=24<br />
}}<br />
<br />
Now open an SSH tunnel and connect to localhost as described in [[TigerVNC#On the client]].<br />
<br />
{{Note|If you get a blank screen upon opening the VNC connection, try a different LightDM greeter.}}<br />
<br />
=== Lock the screen using light-locker ===<br />
<br />
{{Pkg|light-locker}} is a simple screen locker using LightDM to authenticate the user. Once installed and running, you can lock your session via:<br />
<br />
$ light-locker-command -l<br />
<br />
This requires {{ic|light-locker}} to be started at the beginning of your session. By default, this is enabled through [[XDG Autostart]]. See [[Autostarting]] for more options.<br />
<br />
=== Multiple-monitor setup ===<br />
<br />
Sometimes LightDM does not set the monitor resolution correctly on a multiple-monitor setup. The following Xorg configuration works with two monitors: a large primary screen on the left side, and a secondary smaller screen to its right. The order can be reversed and tweaked.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/52-resolution-fix.conf|2=<br />
Section "Monitor"<br />
Identifier "DP1"<br />
Option "PreferredMode" "3840x2160"<br />
Option "Primary" "1"<br />
EndSection<br />
Section "Monitor"<br />
Identifier "eDP1"<br />
Option "PreferredMode" "1920x1080"<br />
Option "RightOf" "DP1"<br />
EndSection<br />
}}<br />
<br />
This makes the {{ic|display-setup-script}} tweaks from {{ic|/etc/lightdm/lightdm.conf}} redundant.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Autologin does not work ===<br />
<br />
Ensure {{ic|1=autologin-user=}} in {{ic|/etc/lightdm/lightdm.conf}} contain the correct values. Trailing whitespace will cause errors.<br />
<br />
If autologin fails with a blank screen or if the login screen immediately returns, you may need to set {{ic|1=logind-check-graphical=true}}.<br />
<br />
You can also install {{AUR|lightdm-autologin-greeter-git}} for this special purpose.<br />
<br />
=== Viewing current configuration ===<br />
<br />
To view effective configuration, run:<br />
<br />
$ lightdm --show-config<br />
<br />
This will show current settings, with the configuration files these settings were read from.<br />
<br />
=== LightDM not starting and screen flashing ===<br />
<br />
If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's configuration file. And if you have correctly defined the GTK greeter, make sure the {{ic|xsessions-directory}} (default: {{ic|/usr/share/xsessions}}) exists and contains at least one .desktop file.<br />
<br />
The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:<br />
<br />
# dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetXSession string:xfce<br />
<br />
This example sets the session "xfce" as default for the user 1000.<br />
<br />
=== Wrong locale displayed ===<br />
<br />
In case of your locale not being displayed correctly in Lightdm add your locale to {{ic|/etc/environment}}:<br />
<br />
LANG=pt_PT.utf8<br />
<br />
Alternatively if you want LightDM and its greeters to be in a language other than your set system locale, you can use the {{ic|1=Environment=}} option in [[Systemd#Drop-in files]].<br />
<br />
=== Unresponsive for a few minutes after startup ===<br />
<br />
You may have to download more entropy. Install and enable haveged, c.f. https://github.com/canonical/lightdm/issues/17<br />
<br />
=== Missing icons with GTK greeter ===<br />
<br />
If you are using {{Pkg|lightdm-gtk-greeter}} as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:<br />
<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
theme-name=mate # this should be the name of a directory under /usr/share/themes/<br />
icon-theme-name=mate # this should be the name of a fully featured icons set directory under /usr/share/icons/<br />
}}<br />
<br />
=== LightDM freezes on login attempt ===<br />
<br />
You may find that after entering the correct username and password and attempting to log in, LightDM freezes and you are unable to continue to the desktop. To fix the issue, reinstall the {{Pkg|gdk-pixbuf2}} package. See [https://bbs.archlinux.org/viewtopic.php?id=179031 this forum thread].<br />
<br />
=== LightDM displaying in wrong monitor ===<br />
<br />
If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit {{ic|/etc/lightdm/lightdm.conf}} and change the ''display-setup-script'' parameter like this:<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
display-setup-script=xrandr --output ''HDMI-1'' --primary<br />
}}<br />
<br />
Replace ''HDMI-1'' with your real monitor ID, which you can find from '''xrandr''' command output.<br />
<br />
Alternatively, if you are using the GTK greeter, you can edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and add the ''active-monitor'' parameter like this:<br />
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=<br />
[greeter]<br />
active-monitor=0<br />
}}<br />
<br />
Replace 0 with the desired display number.<br />
<br />
=== LightDM does not appear or monitor only displays TTY output ===<br />
<br />
It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you will want to add the following to your {{ic|lightdm.conf}} file:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|2=<br />
[LightDM]<br />
logind-check-graphical=true<br />
}}<br />
<br />
This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them. <br />
<br />
'''With newer versions of LightDM, this is now the default setting.''' As a consequence, on some hardware, your graphics drivers may not be properly detected and LightDM may never attempt to launch a greeter--even after the system has stabilized after boot. If this occurs, setting this to false will disable the check and force LightDM to launch a greeter regardless.<br />
<br />
=== LightDM is running with low FPS on Intel Graphics ===<br />
<br />
See [[Intel graphics#AccelMethod]].<br />
<br />
=== Pulseaudio not starting automatically ===<br />
<br />
See [[PulseAudio#Running]].<br />
<br />
=== Long pause before LightDM shows up when home is encrypted ===<br />
<br />
Some LightDM themes try to access the user avatar located in HOME. If your HOME is encrypted, LightDM cannot access it and hangs. To prevent this from happening, you can either:<br />
<br />
* Set your avatar as explained in [[#Changing your avatar]]<br />
* for {{Pkg|lightdm-gtk-greeter}} only: {{Ic|<nowiki>hide-user-image = true</nowiki>}} in {{Ic|/etc/lightdm/lightdm-gtk-greeter.conf}}<br />
<br />
=== Boot hangs on "[ OK ] Reached target Graphical Interface." ===<br />
<br />
There is a possibility that user and group lookups fail if you modified {{ic|/etc/nsswitch.conf}}. That happens when {{ic|nsswitch.conf}} group: includes {{ic|ldap}} without setting {{ic|nss_initgroups_ignoreusers ALLLOCAL}} in {{ic|/etc/nslcd.conf}}<br />
<br />
=== Wayland session not working with duplicate GNOME entries in greeter ===<br />
<br />
Some greeters ({{Pkg|lightdm-webkit2-greeter}} for example) do not support two sessions with the same name [https://github.com/canonical/lightdm/issues/16]. To check for duplicate entries:<br />
<br />
$ ls -1 /usr/share/wayland-sessions /usr/share/xsessions<br />
<br />
Rename the duplicate entry in {{ic|/usr/share/xsessions}}. For example:<br />
<br />
# mv /usr/share/xsessions/gnome.desktop /usr/share/xsessions/gnome.desktop.disabled<br />
<br />
=== Login always segfaults on first attempt ===<br />
<br />
Set a hostname as described in [[Network configuration#Set the hostname|Network Page]]. See also {{Bug|47694}}.<br />
<br />
=== Infinite login loop ===<br />
<br />
If you get stuck in loop in which you type your correct user and password but the screen goes black and the you are back in the login after every attempt, running {{ic|rm ~/.Xauthority}} (or the stuck user's problematic {{ic|.Xauthority}}) may fix the issue.<br />
<br />
Another reason for this may be that you tried to recreate your "lightdm.conf" from scratch and your version is missing this line:<br />
<br />
session-wrapper=/etc/lightdm/Xsession<br />
<br />
In that case, lightdm tries to use "lightdm-session" as the session-wrapper which does not exist on Arch Linux.<br />
<br />
If your lightdm.conf file contains the intended session-wrapper but the lightdm logs indicate that the default session wrapper is being used instead, ensure that your lightdm.conf file is available during startup. For example, you may have created a symlink to a file in your home directory, but your home directory is not being mounted before the LightDM service started. In such cases LightDM will fall back to the default session wrapper.<br />
<br />
== See also ==<br />
<br />
* [https://wiki.ubuntu.com/LightDM Ubuntu Wiki article]<br />
* [[Gentoo:LightDM]]<br />
* [https://launchpad.net/lightdm Launchpad Page] obsolete<br />
* https://wiki.ubuntu.com/MattFischer<br />
* [https://github.com/CanonicalLtd/lightdm LightDM on GitHub]</div>Aelmanhttps://wiki.archlinux.org/index.php?title=Mac&diff=283650Mac2013-11-19T08:19:11Z<p>Aelman: /* Problems with rEFIt */ fixing redundant title</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook 4,2 (late 2008)}}<br />
{{Article summary wiki|MacBook 5,2 (early-mid 2009)}}<br />
{{Article summary wiki|MacBook Pro 7,1}}<br />
{{Article summary wiki|MacBook Pro 8,1 / 8,2 / 8,3 (2011)}}<br />
{{Article summary wiki|MacBook Pro 9,2 (Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
Installing Arch Linux on a MacBook (Pro) is quite similar to installing it on any other computer. However, due to the specific hardware configuration on a MacBook, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation Guide]], [[Beginners' Guide]]. 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 />
# '''[[#Installation of Mac OS X and firmware update|Install OS X]]''': Regardless of the desired end-configuration, it helps to start from a clean install of OS X.<br />
# '''[[#Installation of Mac OS X and firmware update|Firmware update]]''': This should help reduce errors and provide newer features for the hardware.<br />
# '''[[#Partitions|Partition]]''': This step either resizes or deletes the OS X partition and creates partitions for Arch Linux.<br />
# '''[[#Installation|Install Arch Linux]]''': The actual installation procedure.<br />
# '''[[#Post-install configuration|Post-install configuration]]''': MacBook specific configuration.<br />
<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 />
== Installation of Mac OS X and firmware update ==<br />
<br />
[http://www.apple.com Apple] has excellent instructions for installing OS X. Follow their instructions. Once OS X is installed, go to ''Apple Menu > Software Update'' and update all software. Once this has run, you will need to reboot your computer. Do this, and then run '''Software Update''' again to check to make sure that all updates have been installed.<br />
<br />
If you are not going to have OS X installed, make backups of these files:<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
You will need this file later for iSight functionality.<br />
<br />
/Library/ColorSync/Profiles/Displays/<FILES HERE><br />
<br />
You will need the file(s) here for adjusting the [[#Color Profile|color profile]].<br />
<br />
== Partitions ==<br />
<br />
The next step in the installation is to re-partition the hard drive. If OS X was installed using the typical procedure, then your drive should have a GPT format and the following partitions:<br />
<br />
* '''EFI''': a 200 MB partition at the beginning of the disk.It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''.<br />
* '''Mac OS X''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
* '''Recovery''': A recovery partition (only for Mac OS X 10.7+).<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* [[#Arch Linux Only|Arch Linux only]] for single boot.<br />
* [[#Mac OS X with Arch Linux|OS X with Arch Linux]] for dual boot.<br />
<br />
If you do not know which option to pick, we recommend the dual boot so you can still return to OS X whenever you want.<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Mostly, partitioning is the same as any other hardware that Arch Linux can be installed on. The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in OS X before continuing further. The MacBook firmware relies on the value in OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machines firmware unless you use an external drive to boot OS X.<br />
You can boot in EFI mode (recommended) or bios-compatibility mode, if in doubt choose EFI.<br />
<br />
To install using EFI, follow the [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|instruction to make a EFI bootable media]]. Once done double check that your USB key actually boots in EFI mode [[Unified Extensible Firmware Interface#UEFI Variables Support|checking the EFI kernel variables]]. You will need to format the EFI partition with the {{ic|hfsplus}} filesystem ({{AUR|hfsprogs}}) instead of vfat otherwise {{AUR|mactel-boot}} will fail, and in Macbooks [[Unified Extensible Firmware Interface#Non-Mac UEFI systems|you cannot use {{ic|efibootmgr}}]].<br />
<br />
==== EFI ====<br />
<br />
*'''This requires [[GRUB]] to work'''<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''cgdisk''' ({{Pkg|gptfdisk}} package).<br />
* Create the necessary partitions.<br />
<br />
{{Note|<br />
* The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].<br />
* For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].<br />
}}<br />
Simple example (no LVM, crypto):<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 /boot 100MiB ext2 boot<br />
/dev/sda3 - adjust swap swap<br />
/dev/sda4 / 10GiB ext4 root<br />
/dev/sda5 /home remain. ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== BIOS-compatibility ====<br />
<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''parted'''. The simplest way is to change the partition table to '''msdos''' and then partition as normal. GRUB is compatible with GPT.<br />
<br />
* Create the necessary partitions.<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Mac OS X with Arch Linux ===<br />
<br />
The easiest way to partition your hard drive, so that OS X and Arch Linux will co-exist, is to use partitioning tools in OS X 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.}}<br />
<br />
{{Note|If you have any problems, try using [http://gparted.sourceforge.net/ gparted] (i.e. ''instead'' of using Disk Utility and/or cgdisk). It is capable of shrinking the OS X partition and creating Linux partitions ready for installation.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility.app''' (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, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, type the new (smaller) size for the OS X partition in the size box and click '''Apply'''. This will create a new partition out of the empty space. You will delete this partition later.<br />
<br />
{{Note|if you wish to have a shared partition between OS X and Arch Linux, then additional steps will need to happen here. Please see [[#HFS partition sharing]].}}<br />
<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 />
<br />
* Boot the Arch install CD by holding down the alt key during Boot. Follow one of the procedures below according to your choice of boot-method.<br />
<br />
==== 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 Mac OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. A simple example (no LVM, crypto):<br />
{{Note|<br />
* The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file]].<br />
* The easiest dual-boot option is to install refind from inside OSX, to its root directory (default for 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 refind.conf. Configuration of boot options can then be done from a refind_linux.conf in Arch's /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 />
* For more information on partitioning, see [[Partitioning]].<br />
* OS X's EFI partition can be shared with archlinux, making the creation of an additional EFI partition dedicated to arch completely optional<br />
}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac 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 / 10GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== 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 /boot. If you're 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 Y. Reboot.<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Mac 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 Mac OS X, use the formatter on windows XP install CP, and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of Mac 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 Mac 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 Mac OS X partition, how much fo XP, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OSX 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 OSX)<br />
:*sda2 (OSX 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 Mac 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 Mac 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 OSX install 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]] but make sure you read [[#Booting directly from GRUB]] for the stage "* (for booting with EFI) After the install boot loader stage, exit the installer and install GRUB."<br />
<br />
== Booting directly from GRUB ==<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 Mac OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#BIOS-compatibility]] and [[#Mac 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 />
'''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 Archlinux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into Mac OS X.<br />
<br />
<br />
'''Details (quoted from [https://wiki.archlinux.org/index.php/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 [https://wiki.archlinux.org/index.php/Grub#Install_to_UEFI_system_partition]:<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 Macbook 7,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 />
=== Example grub.cfg ===<br />
<br />
{{out of date|reason=kernel26}}<br />
Note that there may be a better method for loading Windows.<br />
{{bc|1=<br />
set debug=video<br />
insmod efi_gop<br />
<br />
menuentry "Arch Linux EFI" {<br />
set root=(hd0,3)<br />
#search --set -f /boot/vmlinuz26-efi-physical<br />
#loadbios /boot/vbtrace_bios.bin /boot/int10.bin<br />
linux /boot/vmlinuz26-efi-physical root=/dev/sda3 reboot=pci resume=/dev/sda3 resume_offset=151552<br />
initrd /boot/kernel26-efi-physical.img<br />
}<br />
<br />
menuentry "MacOSX" {<br />
set root=(hd0,2)<br />
# Search the root device for Mac OS X's loader.<br />
#search --set -f /usr/standalone/i386/boot.efi<br />
# Load the loader.<br />
chainloader /usr/standalone/i386/boot.efi<br />
}<br />
<br />
menuentry "Windows 7" {<br />
appleloader HD<br />
}<br />
<br />
menuentry "Boot from CD" {<br />
appleloader CD<br />
}<br />
<br />
menuentry "Boot from USB" {<br />
appleloader USB<br />
}<br />
}}<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have Mac OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-Install Configuration]].}}<br />
<br />
* Boot from the Arch Linux install CD or the latest [[Archboot]] iso (unofficial) depending on your needs. For a USB that is bootable by Apple's UEFI, you'll need to follow these steps to [[Unified_Extensible_Firmware_Interface#Create_UEFI_bootable_USB_from_ISO|create a UEFI bootable USB.]]<br />
{{Note|<br />
* On MacBook Pro 7,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 />
* Log in as '''root'''<br />
<br />
{{Note|If you want to do a netinstall rather than installing the possibly outdated packages on the iso and depend on a wireless network that is encrypted, you should change to a free tty and connect manually before proceeding, see [[Beginners_Guide#Setup wireless in the live environment (optional)|Beginners_Guide]]}}<br />
<br />
* Proceed through the installation as described in the [[Official Arch Linux Install Guide]] '''except''' in the following areas:<br />
** In the [[Official Arch Linux Install Guide#Prepare Hard Drive|prepare hard drive]] stage, do only the [[Official Arch Linux Install Guide#Manually configure block devices, filesystems and mountpoints|set filesystem mountpoints]] step, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partition]]<br />
** '''(for booting with EFI''') After the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, exit the installer and install [[GRUB]].<br />
** '''(for booting with BIOS-compatibility)''' In the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** '''(for booting with BIOS-compatibility)''' Also in the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, install GRUB on whatever partition that {{ic|/boot}} is on. {{Warning|Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Official Arch Linux Install Guide#Configure System|configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to 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 Mac 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 />
=== Additional steps for Arch Linux only install===<br />
<br />
GRUB seems to be more complicated and less straightforward than rEFInd on EFI environments, so it's usually the prefered choice. It'll also add entries for bootable devices if they're plugged in, and requires no rebuild/redeployments when the configuration is updated.<br />
<br />
==== GRUB ====<br />
<br />
{{Note|Do this after you tested that your setup is working. This procedure has been tested on a MacBook 4,1 with an msdos partition table. It may not work on newer versions. Please update if it works for you.}}<br />
* In order for Linux to boot up straight away, you will have to tell the firmware that your /boot partition is bootable, or you will always have to hold down the option (alt) key whenever you want to start up your computer.<br />
* In order to do this you will need the original Mac OS X install disk<br />
* Boot into it (you may need to hold the option (alt) key during boot again to access it)<br />
** Open Terminal.app (found under the Utilities menu in the menu bar), and type:<br />
# diskutil list<br />
** Find the device name of your /boot partition (this is your root (/) partition, if you don't have it separate). The format should be /dev/disk0sX, where X is a number from 1 to infinity<br />
** If using EFI type (replace X with the appropriate number):<br />
# bless --folder=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
# bless --mount=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
** If using BIOS-compatibility type (replace X with the appropriate number):<br />
# bless --device /dev/disk0sX --setBoot --legacy --verbose<br />
* Remove the installation disk and restart your computer<br />
* After a few seconds of grey screen, your boot loader screen should appear automatically.<br />
<br />
==== rEFInd ====<br />
<br />
{{Note|This has been tested on a 2013 MBA. There's no reason for it not to work on older models.}}<br />
<br />
* Install [https://www.archlinux.org/packages/extra/x86_64/refind-efi/ rEFInd] from [extra].<br />
* Install rEFInd into the EFI partition:<br />
# refind-install<br />
* Create configuration files for the linux images in /boot:<br />
# refind-mkrlconf<br />
* Edit /boot/refind_linux.conf if you need to add any additional kernel parameters.<br />
<br />
== Post-install configuration ==<br />
<br />
=== Xorg ===<br />
<br />
Install and configure Xorg by following the [[Xorg]] article.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the {{Pkg|xf86-video-intel}} driver. Intel-based MacBooks work out-of-the-box.<br />
<br />
* If it returns '''nVidia''', read [[NVIDIA]].<br />
<br />
* Otherwise if it returns '''ATI''' or '''AMD''', read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|MBP 6.2 - With the proprietary [[NVIDIA]] drivers, support for [[NVIDIA#Enabling Pure Video HD (VDPAU/VAAPI)|PureVideo HD]] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}} package found in the [[AUR]].<br />
<br />
{{Tip|<br />
* If backlight control doesn't work after installing nvidia-bl, you should [[Kernel modules#Blacklisting|blacklist]] apple_bl kernel module.<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 />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [https://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
===== MacbookPro 5.5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install {{AUR|nvidia-275xx}} and {{AUR|nvidia-utils-275xx}}, and possibly {{AUR|lib32-nvidia-utils-275xx}} if you are on x86_64 system and want 32-bits support.<br />
<br />
MacbookPro 5.5 has an NVIDIA 9400m graphics card. This problem might apply to other devices as well.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OSX can be installed from the AUR: {{AUR|xf86-input-multitouch-git}}. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as {{AUR|xf86-input-mtrack-git}}. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a Macbook 7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [http://www.apple.com/au/osx/what-is/gestures.html#gallery-gestures-scroll Mac OSX], refer to [[Touchpad Synaptics#Natural scrolling]]. If you are using GNOME, it will override these settings - in this case refer to [[GNOME#Natural_scrolling_touchpad]].<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook 2,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 Macbook Pro(5,5):''' I found it is much simpler to use the xf86-input-synaptics[https://www.archlinux.org/packages/extra/x86_64/xf86-input-synaptics/] in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. Gsynaptics[https://www.archlinux.org/packages/community/i686/gsynaptics/] also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.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 />
'''OS X like MultiTouch Gestures''' 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 pearl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [https://wiki.archlinux.org/index.php/Autostarting start up item].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboard works 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 {{AUR|pommed}} from the [[AUR]].<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building<br />
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 pommed [[Systemd]] service and reboot.<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 />
You may also use [https://aur.archlinux.org/packages/kbdlight/ kbdlight] to control keyboard backlight though scripts or by running it via sxhkd or xbindkeys. It has the advantage of allowing keyboard light-level changes without being root.<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 macbook pro 5,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 BCM4312]] 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 />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [http://wireless.kernel.org/en/users/Download compat-wireless]<br />
<br />
{{Note|If your connection frequently drops, you may have to turn off Wi-Fi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file {{ic|/etc/pm/wireless}} with the lines:<br />
#!/bin/sh<br />
iwconfig wlp2s0 power off<br />
}}<br />
<br />
=== Power management ===<br />
<br />
==== Laptop-mode-tools ====<br />
<br />
Because the MacBook is obviously a laptop, you may wish to control its power management features using something like [[Laptop Mode Tools]].<br />
<br />
However, Laptop Mode Tools is known to disable the keyboard in console mode after being idle for a few seconds (does not happen when using X). If this happens to you set <br />
<br />
CONTROL_USB_AUTOSUSPEND=0<br />
<br />
in {{ic|/etc/laptop-mode/conf.d/usb-autosuspend.conf}}. See this [https://bbs.archlinux.org/viewtopic.php?pid=984831 forum thread] for the original workaround.<br />
<br />
==== Suspend to RAM (kernel suspend) ====<br />
<br />
Suspend (the kernel suspend) should work out of the box (I had a problem in which the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
For a macbook2,1 (bought in 2007) s2ram works using <br />
s2ram -f -a 3 <br />
To make it work with kde4 you have to create a file named "config" into /etc/pm/config.d containing<br />
SLEEP_MODULE="uswsusp"<br />
S2RAM_OPTS="-f -a 3"<br />
<br />
For a MacBook Pro 3,1 (bought in 2008), the following command should work, both in X and in a console:<br />
s2ram -f -a 1<br />
<br />
Note: If you use pm-utils suspending lead (at least for me) disk freeze. Try changing /etc/pm/config.d/module to<br />
SLEEP_MODULE=tuxonice<br />
<br />
For a macbook5.5, s2ram may work using (be sure to run it in X)<br />
s2ram -f -p -m<br />
<br />
==== Suspend to disk (hibernate) ====<br />
<br />
{{Merge|Swap#Swap file|These part is duplication of Swap file section in Swap. Should check and merge it to Swap.}}<br />
Hibernate should work if you have a swap partition. If you opted for a swap file because of the MBR limitation to 4 primary partitions, you can still get hibernate functionality by following these instructions (this is mostly taken from http://ubuntuforums.org/showthread.php?t=1042946):<br />
<br />
* Create a swapfile (here 2G = bs*count):<br />
# dd if=/dev/zero of=/swapfile bs=1024 count=2M<br />
It is recommended, but not necessary, to create the swapfile on a newly created partition, so that fragmentation is minimum.<br />
# chmod 600 swapfile <br />
# mkswap swapfile <br />
mkswap: swapfile: warning: don't erase bootbits sectors<br />
on whole disk. Use -f to force.<br />
Setting up swapspace version 1, size = 2097148 KiB<br />
no label, UUID=6bf46166-4f9e-433a-aac1-91cb3f5cf8ba<br />
# <br />
Note that we will not use this UUID later.<br />
* Add the swapfile in {{ic|/etc/fstab}}:<br />
/swapfile none swap sw 0 0<br />
* Determine the UUID of partition on which the swapfile is (/usr/bin/blkid is provided by util-linux-ng)<br />
# blkid -g<br />
# blkid<br />
/dev/sda4: UUID="388014d3-1d18-4ca0-980e-ef2f9fdebde4" TYPE="ext3" <br />
388014d3-1d18-4ca0-980e-ef2f9fdebde4 is the number we are looking for.<br />
* Determine the physical offset of the swapfile:<br />
# filefrag -v /swapfile | head<br />
Filesystem type is: ef53<br />
Filesystem cylinder groups is approximately 132<br />
File size of /swapfile is 2147483648 (524288 blocks, blocksize 4096)<br />
ext logical physical expected length flags<br />
0 0 24576 12 merged<br />
1 12 24589 24587 1024 merged<br />
2 1036 25615 25612 1024 merged<br />
3 2060 26640 26638 1024 merged<br />
4 3084 27665 27663 1024 merged<br />
5 4108 28690 28688 1024 merged<br />
$ <br />
Here, 24576 is the number we want.<br />
* Edit {{ic|/boot/grub/grub.cfg}} and add:<br />
resume=/dev/disk/by-uuid/388014d3-1d18-4ca0-980e-ef2f9fdebde4 resume_offset=24576<br />
to your kernel stanza options (or use the kopt method as in the post). Note that the "resume=UUID=" actually did not work for me. I had to use the {{ic|/dev/disk/by-uuid}} syntax.<br />
<br />
Note: "ro" has to be at the end of the line, like this:<br />
kernel /boot/vmlinuz-linux root=/dev/sda4 '''resume=/dev/sda4 resume_offset=24576''' ro<br />
* Nothing to do with update-grub nor mkinitcpio.<br />
* Reboot once<br />
* Try to hibernate<br />
<br />
=== Light sensor ===<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|MBP 5.5: since kernel 2.6.32 this works out of the box - just unmute the front speakers and store the sound level }}<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. 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 />
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 />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
{{Note|Bluetooth should work out-of-the box. The hid2hci utility is used by default since bluez 4.91}}<br />
<br />
See the article on [[Bluetooth]] to install and configure all software needed.<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.}}<br />
<br />
You can use many applications to test the camera:<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 shot\d\d\d\d.png and are reported in the standard output.<br />
<br />
==== Facetime HD ====<br />
The Facetime HD webcam (included on 2013 MBAs onwards) [http://mactaris.blogspot.co.uk/2013/07/webcam-settings-20-will-support.html is no longer UVC device], and therefore, does not work out of the box.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install and configure '''lm_sensors'''.<br />
See [[Lm sensors]] page.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from Mac OS.<br />
<br />
First, install {{AUR|xcalib}} from the [[AUR]].<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on Mac OS 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 (not Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also Mac OS 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 />
=== 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, we need {{AUR|hfsprogs}} package from AUR. <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 />
HFS+ partitions, now the default in Mac OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using Mac OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<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 Mac OS'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 is the booting partition.<br />
<br />
Boot Mac OS X, if do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal), or another MacBook with Mac OS X (connect the two computers via firewire or thunderbolt, start the other Macbook keeping pressed T, boot your MacBook keeping pressed Options).<br />
<br />
Either way, once you got a Mac OS X terminal running on your MacBook you need to execute, as root, a different command if the boot partition is EFI or it is 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 and https://support.apple.com/kb/HT1533 .<br />
<br />
=== Mute startup chime ===<br />
<br />
If you forgot to mute before installing, you can still mute again if you have a Mac OS X install disk. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/bin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<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 a copy of gptsync you can wget it from here:<br />
http://packages.debian.org/sid/gptsync<br />
or try these, for 64 bit:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
<br />
and for i386:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
<br />
since they are .deb packages you will need the program {{AUR|deb2targz}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OSX Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Archlinux 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 [[Change Root|chroot]] to your broken Archlinux 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 />
Reinstall linux.<br />
# pacman -S linux<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 Archlinux in rEFInd and it should boot to your Archlinux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
{{Warning|Current linux-3.8.x packages do not work with their EFI stub and refind-efi. Either use an older package ({{Pkg|linux}} 3.7.10-1 works with {{Pkg|refind-efi}} 0.6.8-1) or you may use a bootloader which does not rely on EFI stub. Similiar issues are reported with {{Pkg|gummiboot}}.}}<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_ISO]]) 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/efi<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. The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You can't therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}} from the [[AUR]]. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling e.g.:<br />
<br />
hfs-bless /boot/efi/EFI/refind/refind.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seemed 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 />
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/efi/...' directory and assumes an efi kernel even without the extension '.efi'. If you don't 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 />
==== 10,1 ====<br />
<br />
* [[MacBookPro Retina]].<br />
<br />
=== MacBook Air===<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 couldn't 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 />
===== Stability problems =====<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 occassion when I couldn't 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 />
<br />
[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 />
[http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
<br />
<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{AUR|broadcom-wl-dkms}} to connect to a network. <br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfect with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
As of Linux 3.12, sound works out-of-the box.<br />
<br />
==== Mid 2012 13" - Version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding 'intremap=off' fixes this. Additionally, there are problems loading the '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 xf86-input-synaptics and install mtrack-git from aur. 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 />
===== Installing using the Archboot 2012.06 image =====<br />
<br />
Several people have reported problems installing Arch Linux on the MBA version 5,2 (See [https://bbs.archlinux.org/viewtopic.php?id=144089 problems booting archlinux on a MacBook Air Mid 2012]). A common problem is that the screen is not detected and therefore goes black when the installer boots. To fix this problem one has to select the normal install (Not the LTS) during boot and press tab to edit the boot flags. Then add noapic flag to the boot line. This should fix the screen going black. Install the system as you normally would. It may help later in the configuration process if the support packages are installed already at this stage.<br />
<br />
When the install has finished again add the noapic flag to the GRUB boot line (if you use GRUB) and also add i915.diescreaming=1 (or perhaps i915.die). This should keep the screen from going black when booting the new system. After you enter the system the wireless driver should be loaded. If you installed the support packages during installation you should have the wifi-menu command. Run it and select the network you want to use. One could also use wpa_supplicant but wifi-menu is quite fast to use at this stage. Now you are ready to upgrade the system. As of writing there have been a lot of changes to Archlinux since the 2012.06 image of Archboot was released ([https://www.archlinux.org/news/filesystem-upgrade-manual-intervention-required-1/ filesystem] and [https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ glibc]). Therefore the upgrade process can be a bit difficult. The current solution has sucessfully upgraded a standart archboot version to a up-to-date version as of October 2012 and this step should be obsolete in future releases of archboot.<br />
<br />
First ignore the new "big" changes to Arch Linux,<br />
<br />
pacman -Suy --ignore glibc,libarchive,curl,filesystem <br />
<br />
If this only upgrades pacman then run the command again. Remember to make sure that pacman is ignoring the packages you don't want upgraded now. Otherwise you may break the system and have to reinstall! Now upgrade to the new filesystem,<br />
<br />
pacman -S filesystem --force<br />
<br />
As described in [[DeveloperWiki:usrlib|Glibc upgrade guide]] there may be conflicts with installed packages that require the /lib directory. Follow the guide and remove any packages that use /lib. The stock 3.4.2 kernel from Archboot should be on this list so first upgrade this,<br />
<br />
pacman -S linux<br />
<br />
This may give some errors saying that the system may not boot because of missing modules. Ignore this warning for now. The stock install may also contain gcc in the /lib directory so also remove this if needed and any other packages that have conflicts. Now Glibc should be the only package in /lib so run the system upgrade and accept all changes, <br />
<br />
pacman -Su<br />
<br />
Finally reinstall the kernel so that it can find the correct modules.<br />
<br />
Now this command shouldn't give any errors like last time. You can also reinstall gcc at this point. After a rebooted the system should startup and the new kernel should have fixed the problem with the screen going black. If want to boot Xorg then you may need to remove the i915.diescreaming=1 line from GRUB. If not then attach a external screen and try to fix the problem that way. Some people have reported commands that may help on the [https://bbs.archlinux.org/viewtopic.php?id=144089 forum].<br />
<br />
==== Mid 2011 - Version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. It is recommended to use [[Archboot]], install [[GRUB]] and use EFI.<br />
<br />
==== Early 2008 - Version 1,1 ====<br />
<br />
Everything works out of the box though you'll need [https://www.archlinux.org/packages/core/x86_64/b43-fwcutter/ b43-fwcutter] (or simply [https://aur.archlinux.org/packages/b43-firmware/ 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 found that you can not get any result by scaning wireless network after boot until unload module b43 and ssb and reload them again as following:<br />
<br />
rmmod ssb<br />
<br />
rmmod b43<br />
<br />
modprobe b43<br />
<br />
There is a good chance you will found something wrong with DMA from the dmesg log.<br />
<br />
And even if you can scan wireless access point after reloading the modules. You will still probably found that you can connect some access points, but can not connect to other routers.<br />
<br />
According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, add pio=1, qos=0 options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBook Air 1,1 with a BCM4321 chipset, and it works.<br />
<br />
(I think above information is useful because it cost me several days to figure out his problem, however, I'm not a native English speaker, so please help me improvement this text by correcting any grammer and expression errors and delete this comment after that.)<br />
<br />
== See also ==<br />
<br />
* http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-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/<br />
* http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html</div>Aelmanhttps://wiki.archlinux.org/index.php?title=Mac&diff=283649Mac2013-11-19T08:17:32Z<p>Aelman: /* Problems with rEFIt */</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook 4,2 (late 2008)}}<br />
{{Article summary wiki|MacBook 5,2 (early-mid 2009)}}<br />
{{Article summary wiki|MacBook Pro 7,1}}<br />
{{Article summary wiki|MacBook Pro 8,1 / 8,2 / 8,3 (2011)}}<br />
{{Article summary wiki|MacBook Pro 9,2 (Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
Installing Arch Linux on a MacBook (Pro) is quite similar to installing it on any other computer. However, due to the specific hardware configuration on a MacBook, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation Guide]], [[Beginners' Guide]]. 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 />
# '''[[#Installation of Mac OS X and firmware update|Install OS X]]''': Regardless of the desired end-configuration, it helps to start from a clean install of OS X.<br />
# '''[[#Installation of Mac OS X and firmware update|Firmware update]]''': This should help reduce errors and provide newer features for the hardware.<br />
# '''[[#Partitions|Partition]]''': This step either resizes or deletes the OS X partition and creates partitions for Arch Linux.<br />
# '''[[#Installation|Install Arch Linux]]''': The actual installation procedure.<br />
# '''[[#Post-install configuration|Post-install configuration]]''': MacBook specific configuration.<br />
<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 />
== Installation of Mac OS X and firmware update ==<br />
<br />
[http://www.apple.com Apple] has excellent instructions for installing OS X. Follow their instructions. Once OS X is installed, go to ''Apple Menu > Software Update'' and update all software. Once this has run, you will need to reboot your computer. Do this, and then run '''Software Update''' again to check to make sure that all updates have been installed.<br />
<br />
If you are not going to have OS X installed, make backups of these files:<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
You will need this file later for iSight functionality.<br />
<br />
/Library/ColorSync/Profiles/Displays/<FILES HERE><br />
<br />
You will need the file(s) here for adjusting the [[#Color Profile|color profile]].<br />
<br />
== Partitions ==<br />
<br />
The next step in the installation is to re-partition the hard drive. If OS X was installed using the typical procedure, then your drive should have a GPT format and the following partitions:<br />
<br />
* '''EFI''': a 200 MB partition at the beginning of the disk.It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''.<br />
* '''Mac OS X''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
* '''Recovery''': A recovery partition (only for Mac OS X 10.7+).<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* [[#Arch Linux Only|Arch Linux only]] for single boot.<br />
* [[#Mac OS X with Arch Linux|OS X with Arch Linux]] for dual boot.<br />
<br />
If you do not know which option to pick, we recommend the dual boot so you can still return to OS X whenever you want.<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Mostly, partitioning is the same as any other hardware that Arch Linux can be installed on. The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in OS X before continuing further. The MacBook firmware relies on the value in OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machines firmware unless you use an external drive to boot OS X.<br />
You can boot in EFI mode (recommended) or bios-compatibility mode, if in doubt choose EFI.<br />
<br />
To install using EFI, follow the [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|instruction to make a EFI bootable media]]. Once done double check that your USB key actually boots in EFI mode [[Unified Extensible Firmware Interface#UEFI Variables Support|checking the EFI kernel variables]]. You will need to format the EFI partition with the {{ic|hfsplus}} filesystem ({{AUR|hfsprogs}}) instead of vfat otherwise {{AUR|mactel-boot}} will fail, and in Macbooks [[Unified Extensible Firmware Interface#Non-Mac UEFI systems|you cannot use {{ic|efibootmgr}}]].<br />
<br />
==== EFI ====<br />
<br />
*'''This requires [[GRUB]] to work'''<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''cgdisk''' ({{Pkg|gptfdisk}} package).<br />
* Create the necessary partitions.<br />
<br />
{{Note|<br />
* The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].<br />
* For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].<br />
}}<br />
Simple example (no LVM, crypto):<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 /boot 100MiB ext2 boot<br />
/dev/sda3 - adjust swap swap<br />
/dev/sda4 / 10GiB ext4 root<br />
/dev/sda5 /home remain. ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== BIOS-compatibility ====<br />
<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''parted'''. The simplest way is to change the partition table to '''msdos''' and then partition as normal. GRUB is compatible with GPT.<br />
<br />
* Create the necessary partitions.<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Mac OS X with Arch Linux ===<br />
<br />
The easiest way to partition your hard drive, so that OS X and Arch Linux will co-exist, is to use partitioning tools in OS X 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.}}<br />
<br />
{{Note|If you have any problems, try using [http://gparted.sourceforge.net/ gparted] (i.e. ''instead'' of using Disk Utility and/or cgdisk). It is capable of shrinking the OS X partition and creating Linux partitions ready for installation.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility.app''' (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, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, type the new (smaller) size for the OS X partition in the size box and click '''Apply'''. This will create a new partition out of the empty space. You will delete this partition later.<br />
<br />
{{Note|if you wish to have a shared partition between OS X and Arch Linux, then additional steps will need to happen here. Please see [[#HFS partition sharing]].}}<br />
<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 />
<br />
* Boot the Arch install CD by holding down the alt key during Boot. Follow one of the procedures below according to your choice of boot-method.<br />
<br />
==== 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 Mac OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. A simple example (no LVM, crypto):<br />
{{Note|<br />
* The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file]].<br />
* The easiest dual-boot option is to install refind from inside OSX, to its root directory (default for 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 refind.conf. Configuration of boot options can then be done from a refind_linux.conf in Arch's /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 />
* For more information on partitioning, see [[Partitioning]].<br />
* OS X's EFI partition can be shared with archlinux, making the creation of an additional EFI partition dedicated to arch completely optional<br />
}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac 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 / 10GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== 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 /boot. If you're 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 Y. Reboot.<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== Mac 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 Mac OS X, use the formatter on windows XP install CP, and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of Mac 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 Mac 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 Mac OS X partition, how much fo XP, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OSX 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 OSX)<br />
:*sda2 (OSX 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 Mac 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 Mac 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 OSX install 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]] but make sure you read [[#Booting directly from GRUB]] for the stage "* (for booting with EFI) After the install boot loader stage, exit the installer and install GRUB."<br />
<br />
== Booting directly from GRUB ==<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 Mac OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#BIOS-compatibility]] and [[#Mac 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 />
'''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 Archlinux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into Mac OS X.<br />
<br />
<br />
'''Details (quoted from [https://wiki.archlinux.org/index.php/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 [https://wiki.archlinux.org/index.php/Grub#Install_to_UEFI_system_partition]:<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 Macbook 7,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 />
=== Example grub.cfg ===<br />
<br />
{{out of date|reason=kernel26}}<br />
Note that there may be a better method for loading Windows.<br />
{{bc|1=<br />
set debug=video<br />
insmod efi_gop<br />
<br />
menuentry "Arch Linux EFI" {<br />
set root=(hd0,3)<br />
#search --set -f /boot/vmlinuz26-efi-physical<br />
#loadbios /boot/vbtrace_bios.bin /boot/int10.bin<br />
linux /boot/vmlinuz26-efi-physical root=/dev/sda3 reboot=pci resume=/dev/sda3 resume_offset=151552<br />
initrd /boot/kernel26-efi-physical.img<br />
}<br />
<br />
menuentry "MacOSX" {<br />
set root=(hd0,2)<br />
# Search the root device for Mac OS X's loader.<br />
#search --set -f /usr/standalone/i386/boot.efi<br />
# Load the loader.<br />
chainloader /usr/standalone/i386/boot.efi<br />
}<br />
<br />
menuentry "Windows 7" {<br />
appleloader HD<br />
}<br />
<br />
menuentry "Boot from CD" {<br />
appleloader CD<br />
}<br />
<br />
menuentry "Boot from USB" {<br />
appleloader USB<br />
}<br />
}}<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have Mac OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-Install Configuration]].}}<br />
<br />
* Boot from the Arch Linux install CD or the latest [[Archboot]] iso (unofficial) depending on your needs. For a USB that is bootable by Apple's UEFI, you'll need to follow these steps to [[Unified_Extensible_Firmware_Interface#Create_UEFI_bootable_USB_from_ISO|create a UEFI bootable USB.]]<br />
{{Note|<br />
* On MacBook Pro 7,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 />
* Log in as '''root'''<br />
<br />
{{Note|If you want to do a netinstall rather than installing the possibly outdated packages on the iso and depend on a wireless network that is encrypted, you should change to a free tty and connect manually before proceeding, see [[Beginners_Guide#Setup wireless in the live environment (optional)|Beginners_Guide]]}}<br />
<br />
* Proceed through the installation as described in the [[Official Arch Linux Install Guide]] '''except''' in the following areas:<br />
** In the [[Official Arch Linux Install Guide#Prepare Hard Drive|prepare hard drive]] stage, do only the [[Official Arch Linux Install Guide#Manually configure block devices, filesystems and mountpoints|set filesystem mountpoints]] step, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partition]]<br />
** '''(for booting with EFI''') After the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, exit the installer and install [[GRUB]].<br />
** '''(for booting with BIOS-compatibility)''' In the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** '''(for booting with BIOS-compatibility)''' Also in the [[Official Arch Linux Install Guide#Install Bootloader|install boot loader]] stage, install GRUB on whatever partition that {{ic|/boot}} is on. {{Warning|Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Official Arch Linux Install Guide#Configure System|configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to 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 Mac 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 />
=== Additional steps for Arch Linux only install===<br />
<br />
GRUB seems to be more complicated and less straightforward than rEFInd on EFI environments, so it's usually the prefered choice. It'll also add entries for bootable devices if they're plugged in, and requires no rebuild/redeployments when the configuration is updated.<br />
<br />
==== GRUB ====<br />
<br />
{{Note|Do this after you tested that your setup is working. This procedure has been tested on a MacBook 4,1 with an msdos partition table. It may not work on newer versions. Please update if it works for you.}}<br />
* In order for Linux to boot up straight away, you will have to tell the firmware that your /boot partition is bootable, or you will always have to hold down the option (alt) key whenever you want to start up your computer.<br />
* In order to do this you will need the original Mac OS X install disk<br />
* Boot into it (you may need to hold the option (alt) key during boot again to access it)<br />
** Open Terminal.app (found under the Utilities menu in the menu bar), and type:<br />
# diskutil list<br />
** Find the device name of your /boot partition (this is your root (/) partition, if you don't have it separate). The format should be /dev/disk0sX, where X is a number from 1 to infinity<br />
** If using EFI type (replace X with the appropriate number):<br />
# bless --folder=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
# bless --mount=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
** If using BIOS-compatibility type (replace X with the appropriate number):<br />
# bless --device /dev/disk0sX --setBoot --legacy --verbose<br />
* Remove the installation disk and restart your computer<br />
* After a few seconds of grey screen, your boot loader screen should appear automatically.<br />
<br />
==== rEFInd ====<br />
<br />
{{Note|This has been tested on a 2013 MBA. There's no reason for it not to work on older models.}}<br />
<br />
* Install [https://www.archlinux.org/packages/extra/x86_64/refind-efi/ rEFInd] from [extra].<br />
* Install rEFInd into the EFI partition:<br />
# refind-install<br />
* Create configuration files for the linux images in /boot:<br />
# refind-mkrlconf<br />
* Edit /boot/refind_linux.conf if you need to add any additional kernel parameters.<br />
<br />
== Post-install configuration ==<br />
<br />
=== Xorg ===<br />
<br />
Install and configure Xorg by following the [[Xorg]] article.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the {{Pkg|xf86-video-intel}} driver. Intel-based MacBooks work out-of-the-box.<br />
<br />
* If it returns '''nVidia''', read [[NVIDIA]].<br />
<br />
* Otherwise if it returns '''ATI''' or '''AMD''', read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|MBP 6.2 - With the proprietary [[NVIDIA]] drivers, support for [[NVIDIA#Enabling Pure Video HD (VDPAU/VAAPI)|PureVideo HD]] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}} package found in the [[AUR]].<br />
<br />
{{Tip|<br />
* If backlight control doesn't work after installing nvidia-bl, you should [[Kernel modules#Blacklisting|blacklist]] apple_bl kernel module.<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 />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [https://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
===== MacbookPro 5.5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install {{AUR|nvidia-275xx}} and {{AUR|nvidia-utils-275xx}}, and possibly {{AUR|lib32-nvidia-utils-275xx}} if you are on x86_64 system and want 32-bits support.<br />
<br />
MacbookPro 5.5 has an NVIDIA 9400m graphics card. This problem might apply to other devices as well.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OSX can be installed from the AUR: {{AUR|xf86-input-multitouch-git}}. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as {{AUR|xf86-input-mtrack-git}}. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a Macbook 7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [http://www.apple.com/au/osx/what-is/gestures.html#gallery-gestures-scroll Mac OSX], refer to [[Touchpad Synaptics#Natural scrolling]]. If you are using GNOME, it will override these settings - in this case refer to [[GNOME#Natural_scrolling_touchpad]].<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook 2,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 Macbook Pro(5,5):''' I found it is much simpler to use the xf86-input-synaptics[https://www.archlinux.org/packages/extra/x86_64/xf86-input-synaptics/] in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. Gsynaptics[https://www.archlinux.org/packages/community/i686/gsynaptics/] also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.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 />
'''OS X like MultiTouch Gestures''' 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 pearl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [https://wiki.archlinux.org/index.php/Autostarting start up item].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboard works 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 {{AUR|pommed}} from the [[AUR]].<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building<br />
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 pommed [[Systemd]] service and reboot.<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 />
You may also use [https://aur.archlinux.org/packages/kbdlight/ kbdlight] to control keyboard backlight though scripts or by running it via sxhkd or xbindkeys. It has the advantage of allowing keyboard light-level changes without being root.<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 macbook pro 5,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 BCM4312]] 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 />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [http://wireless.kernel.org/en/users/Download compat-wireless]<br />
<br />
{{Note|If your connection frequently drops, you may have to turn off Wi-Fi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file {{ic|/etc/pm/wireless}} with the lines:<br />
#!/bin/sh<br />
iwconfig wlp2s0 power off<br />
}}<br />
<br />
=== Power management ===<br />
<br />
==== Laptop-mode-tools ====<br />
<br />
Because the MacBook is obviously a laptop, you may wish to control its power management features using something like [[Laptop Mode Tools]].<br />
<br />
However, Laptop Mode Tools is known to disable the keyboard in console mode after being idle for a few seconds (does not happen when using X). If this happens to you set <br />
<br />
CONTROL_USB_AUTOSUSPEND=0<br />
<br />
in {{ic|/etc/laptop-mode/conf.d/usb-autosuspend.conf}}. See this [https://bbs.archlinux.org/viewtopic.php?pid=984831 forum thread] for the original workaround.<br />
<br />
==== Suspend to RAM (kernel suspend) ====<br />
<br />
Suspend (the kernel suspend) should work out of the box (I had a problem in which the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
For a macbook2,1 (bought in 2007) s2ram works using <br />
s2ram -f -a 3 <br />
To make it work with kde4 you have to create a file named "config" into /etc/pm/config.d containing<br />
SLEEP_MODULE="uswsusp"<br />
S2RAM_OPTS="-f -a 3"<br />
<br />
For a MacBook Pro 3,1 (bought in 2008), the following command should work, both in X and in a console:<br />
s2ram -f -a 1<br />
<br />
Note: If you use pm-utils suspending lead (at least for me) disk freeze. Try changing /etc/pm/config.d/module to<br />
SLEEP_MODULE=tuxonice<br />
<br />
For a macbook5.5, s2ram may work using (be sure to run it in X)<br />
s2ram -f -p -m<br />
<br />
==== Suspend to disk (hibernate) ====<br />
<br />
{{Merge|Swap#Swap file|These part is duplication of Swap file section in Swap. Should check and merge it to Swap.}}<br />
Hibernate should work if you have a swap partition. If you opted for a swap file because of the MBR limitation to 4 primary partitions, you can still get hibernate functionality by following these instructions (this is mostly taken from http://ubuntuforums.org/showthread.php?t=1042946):<br />
<br />
* Create a swapfile (here 2G = bs*count):<br />
# dd if=/dev/zero of=/swapfile bs=1024 count=2M<br />
It is recommended, but not necessary, to create the swapfile on a newly created partition, so that fragmentation is minimum.<br />
# chmod 600 swapfile <br />
# mkswap swapfile <br />
mkswap: swapfile: warning: don't erase bootbits sectors<br />
on whole disk. Use -f to force.<br />
Setting up swapspace version 1, size = 2097148 KiB<br />
no label, UUID=6bf46166-4f9e-433a-aac1-91cb3f5cf8ba<br />
# <br />
Note that we will not use this UUID later.<br />
* Add the swapfile in {{ic|/etc/fstab}}:<br />
/swapfile none swap sw 0 0<br />
* Determine the UUID of partition on which the swapfile is (/usr/bin/blkid is provided by util-linux-ng)<br />
# blkid -g<br />
# blkid<br />
/dev/sda4: UUID="388014d3-1d18-4ca0-980e-ef2f9fdebde4" TYPE="ext3" <br />
388014d3-1d18-4ca0-980e-ef2f9fdebde4 is the number we are looking for.<br />
* Determine the physical offset of the swapfile:<br />
# filefrag -v /swapfile | head<br />
Filesystem type is: ef53<br />
Filesystem cylinder groups is approximately 132<br />
File size of /swapfile is 2147483648 (524288 blocks, blocksize 4096)<br />
ext logical physical expected length flags<br />
0 0 24576 12 merged<br />
1 12 24589 24587 1024 merged<br />
2 1036 25615 25612 1024 merged<br />
3 2060 26640 26638 1024 merged<br />
4 3084 27665 27663 1024 merged<br />
5 4108 28690 28688 1024 merged<br />
$ <br />
Here, 24576 is the number we want.<br />
* Edit {{ic|/boot/grub/grub.cfg}} and add:<br />
resume=/dev/disk/by-uuid/388014d3-1d18-4ca0-980e-ef2f9fdebde4 resume_offset=24576<br />
to your kernel stanza options (or use the kopt method as in the post). Note that the "resume=UUID=" actually did not work for me. I had to use the {{ic|/dev/disk/by-uuid}} syntax.<br />
<br />
Note: "ro" has to be at the end of the line, like this:<br />
kernel /boot/vmlinuz-linux root=/dev/sda4 '''resume=/dev/sda4 resume_offset=24576''' ro<br />
* Nothing to do with update-grub nor mkinitcpio.<br />
* Reboot once<br />
* Try to hibernate<br />
<br />
=== Light sensor ===<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|MBP 5.5: since kernel 2.6.32 this works out of the box - just unmute the front speakers and store the sound level }}<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. 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 />
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 />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
{{Note|Bluetooth should work out-of-the box. The hid2hci utility is used by default since bluez 4.91}}<br />
<br />
See the article on [[Bluetooth]] to install and configure all software needed.<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.}}<br />
<br />
You can use many applications to test the camera:<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 shot\d\d\d\d.png and are reported in the standard output.<br />
<br />
==== Facetime HD ====<br />
The Facetime HD webcam (included on 2013 MBAs onwards) [http://mactaris.blogspot.co.uk/2013/07/webcam-settings-20-will-support.html is no longer UVC device], and therefore, does not work out of the box.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install and configure '''lm_sensors'''.<br />
See [[Lm sensors]] page.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from Mac OS.<br />
<br />
First, install {{AUR|xcalib}} from the [[AUR]].<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on Mac OS 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 (not Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also Mac OS 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 />
=== 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, we need {{AUR|hfsprogs}} package from AUR. <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 />
HFS+ partitions, now the default in Mac OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using Mac OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<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 Mac OS'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 is the booting partition.<br />
<br />
Boot Mac OS X, if do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal), or another MacBook with Mac OS X (connect the two computers via firewire or thunderbolt, start the other Macbook keeping pressed T, boot your MacBook keeping pressed Options).<br />
<br />
Either way, once you got a Mac OS X terminal running on your MacBook you need to execute, as root, a different command if the boot partition is EFI or it is 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 and https://support.apple.com/kb/HT1533 .<br />
<br />
=== Mute startup chime ===<br />
<br />
If you forgot to mute before installing, you can still mute again if you have a Mac OS X install disk. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/bin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<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 a copy of gptsync you can wget it from here:<br />
http://packages.debian.org/sid/gptsync<br />
or try these, for 64 bit:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
<br />
and for i386:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
<br />
since they are .deb packages you will need the program {{AUR|deb2targz}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot with rEFIt/rEFInd ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OSX Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Archlinux 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 [[Change Root|chroot]] to your broken Archlinux 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 />
Reinstall linux.<br />
# pacman -S linux<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 Archlinux in rEFInd and it should boot to your Archlinux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
{{Warning|Current linux-3.8.x packages do not work with their EFI stub and refind-efi. Either use an older package ({{Pkg|linux}} 3.7.10-1 works with {{Pkg|refind-efi}} 0.6.8-1) or you may use a bootloader which does not rely on EFI stub. Similiar issues are reported with {{Pkg|gummiboot}}.}}<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_ISO]]) 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/efi<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. The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You can't therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}} from the [[AUR]]. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling e.g.:<br />
<br />
hfs-bless /boot/efi/EFI/refind/refind.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seemed 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 />
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/efi/...' directory and assumes an efi kernel even without the extension '.efi'. If you don't 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 />
==== 10,1 ====<br />
<br />
* [[MacBookPro Retina]].<br />
<br />
=== MacBook Air===<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 couldn't 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 />
===== Stability problems =====<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 occassion when I couldn't 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 />
<br />
[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 />
[http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
<br />
<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{AUR|broadcom-wl-dkms}} to connect to a network. <br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfect with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
As of Linux 3.12, sound works out-of-the box.<br />
<br />
==== Mid 2012 13" - Version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding 'intremap=off' fixes this. Additionally, there are problems loading the '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 xf86-input-synaptics and install mtrack-git from aur. 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 />
===== Installing using the Archboot 2012.06 image =====<br />
<br />
Several people have reported problems installing Arch Linux on the MBA version 5,2 (See [https://bbs.archlinux.org/viewtopic.php?id=144089 problems booting archlinux on a MacBook Air Mid 2012]). A common problem is that the screen is not detected and therefore goes black when the installer boots. To fix this problem one has to select the normal install (Not the LTS) during boot and press tab to edit the boot flags. Then add noapic flag to the boot line. This should fix the screen going black. Install the system as you normally would. It may help later in the configuration process if the support packages are installed already at this stage.<br />
<br />
When the install has finished again add the noapic flag to the GRUB boot line (if you use GRUB) and also add i915.diescreaming=1 (or perhaps i915.die). This should keep the screen from going black when booting the new system. After you enter the system the wireless driver should be loaded. If you installed the support packages during installation you should have the wifi-menu command. Run it and select the network you want to use. One could also use wpa_supplicant but wifi-menu is quite fast to use at this stage. Now you are ready to upgrade the system. As of writing there have been a lot of changes to Archlinux since the 2012.06 image of Archboot was released ([https://www.archlinux.org/news/filesystem-upgrade-manual-intervention-required-1/ filesystem] and [https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ glibc]). Therefore the upgrade process can be a bit difficult. The current solution has sucessfully upgraded a standart archboot version to a up-to-date version as of October 2012 and this step should be obsolete in future releases of archboot.<br />
<br />
First ignore the new "big" changes to Arch Linux,<br />
<br />
pacman -Suy --ignore glibc,libarchive,curl,filesystem <br />
<br />
If this only upgrades pacman then run the command again. Remember to make sure that pacman is ignoring the packages you don't want upgraded now. Otherwise you may break the system and have to reinstall! Now upgrade to the new filesystem,<br />
<br />
pacman -S filesystem --force<br />
<br />
As described in [[DeveloperWiki:usrlib|Glibc upgrade guide]] there may be conflicts with installed packages that require the /lib directory. Follow the guide and remove any packages that use /lib. The stock 3.4.2 kernel from Archboot should be on this list so first upgrade this,<br />
<br />
pacman -S linux<br />
<br />
This may give some errors saying that the system may not boot because of missing modules. Ignore this warning for now. The stock install may also contain gcc in the /lib directory so also remove this if needed and any other packages that have conflicts. Now Glibc should be the only package in /lib so run the system upgrade and accept all changes, <br />
<br />
pacman -Su<br />
<br />
Finally reinstall the kernel so that it can find the correct modules.<br />
<br />
Now this command shouldn't give any errors like last time. You can also reinstall gcc at this point. After a rebooted the system should startup and the new kernel should have fixed the problem with the screen going black. If want to boot Xorg then you may need to remove the i915.diescreaming=1 line from GRUB. If not then attach a external screen and try to fix the problem that way. Some people have reported commands that may help on the [https://bbs.archlinux.org/viewtopic.php?id=144089 forum].<br />
<br />
==== Mid 2011 - Version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. It is recommended to use [[Archboot]], install [[GRUB]] and use EFI.<br />
<br />
==== Early 2008 - Version 1,1 ====<br />
<br />
Everything works out of the box though you'll need [https://www.archlinux.org/packages/core/x86_64/b43-fwcutter/ b43-fwcutter] (or simply [https://aur.archlinux.org/packages/b43-firmware/ 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 found that you can not get any result by scaning wireless network after boot until unload module b43 and ssb and reload them again as following:<br />
<br />
rmmod ssb<br />
<br />
rmmod b43<br />
<br />
modprobe b43<br />
<br />
There is a good chance you will found something wrong with DMA from the dmesg log.<br />
<br />
And even if you can scan wireless access point after reloading the modules. You will still probably found that you can connect some access points, but can not connect to other routers.<br />
<br />
According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, add pio=1, qos=0 options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBook Air 1,1 with a BCM4321 chipset, and it works.<br />
<br />
(I think above information is useful because it cost me several days to figure out his problem, however, I'm not a native English speaker, so please help me improvement this text by correcting any grammer and expression errors and delete this comment after that.)<br />
<br />
== See also ==<br />
<br />
* http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-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/<br />
* http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html</div>Aelmanhttps://wiki.archlinux.org/index.php?title=Mobile_broadband_modem&diff=256258Mobile broadband modem2013-05-06T22:17:52Z<p>Aelman: /* Network Manager */</p>
<hr />
<div>[[ru:USB 3G Modem]]<br />
[[Category:Modems]]<br />
A number of mobile telephone networks around the world offer mobile internet connections over UMTS (or EDGE or GSM) using a portable USB modem device.<br />
<br />
==Remove the PIN==<br />
First of all use your SIM card in a normal phone and disable the PIN request if present. If the SIM card asks the PIN wvdial won't work.<br />
<br />
==Device identification==<br />
Install usbutils<br />
pacman -S usbutils<br />
and then examine the output of<br />
$ lsusb<br />
which will show the vendor and product IDs of the device. Note that some devices will show ''two'' different product IDs at different times as explained below.<br />
<br />
==Mode switching==<br />
<br />
Often these devices will have two modes (1) USB flash memory storage (2) USB Modem. The first mode, sometimes known as ZeroCD, is often used to deliver an internet communications program for another operating system and is generally of no interest to Linux users. Additionally some have a slot into which the user can insert an additional flash memory card.<br />
<br />
A useful utility for switching these devices into modem mode is [https://www.archlinux.org/packages/?q=usb_modeswitch usb_modeswitch], available in <code>[community]</code>:<br />
<br />
pacman -S usb_modeswitch<br />
<br />
Udev rules are supplied with the package in {{ic|/lib/udev/rules.d/40-usb_modeswitch.rules}}. This contains entries for many devices, which it will switch to modem mode upon insertion.<br />
<br />
When a device is switched, its product ID may change to a different value. The vendor ID will remain unchanged. This can be seen in the output of <code>lsusb</code>.<br />
<br />
Some devices are supported in the USB serial kernel module called "option" (after the Option devices, but not limited to just those) and may be used without usb_modeswitch.<br />
<br />
Udev itself included a utility called {{ic|/lib/udev/modem-modeswitch}}. In udev 157 this was renamed to {{ic|/lib/udev/mobile-action-modeswitch}} and morphed into a tool that only switches Mobile Action cables. For other devices use <code>usb_modeswitch</code>.<br />
<br />
{{Note|You can find an alternative way to do this base on eject command [[ZTE_MF110/MF190#Switch_from_CD_mode_to_modem_mode_on_the_device|here]].}}<br />
<br />
==Connection==<br />
<br />
=== Network Manager ===<br />
<br />
After installing usbutils and usb_modeswitch you just need to install modemmanager to make the modem work with NetworkManager:<br />
# pacman -S modemmanager<br />
Make sure both NetworkManager and ModemManager services are running. A system restart might be necessary for ModemManager to detect the USB modem. After you restart the NetworkManager-applet and plug the modem in again NetworkManager should recognize the modem in the menu without further configuration. Setting up the modem in NetworkManager is self-explanatory, you should only need the login-information provided by your network provider.<br />
<br />
=== wvdial ===<br />
:''See main article: [[wvdial]]''<br />
<br />
The general procedure is to switch the device into modem mode, make sure the ttyUSB device(s) are recognized by the usbserial kernel module, and then to run wvdial to dial, connect and start pppd.<br />
<br />
Install wvdial<br />
# pacman -S wvdial<br />
The configuration file /etc/wvdial.conf will in general depend on (a) which device you have (b) which mobile network you are connecting to. A single wvdial.conf file can be defined with named sections to be usable with several USB modems and networks, should you need them.<br />
<br />
Run (as root)<br />
# wvdialconf<br />
which will attempt to write /etc/wvdial.conf correctly. You will need to add the user, password and Access Point Name (APN). You can obtain these (i) from your network provider,<br />
(ii) from other users via published wvdial.confs, or (iii) by logging the USB tty traffic under another operating system (Sysinternals' Portmon).<br />
<br />
A typical /etc/wvdial.conf looks like this:<br />
<br />
<pre><br />
[Dialer Defaults]<br />
Init1 = ATZ<br />
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0<br />
Modem Type = Analog Modem<br />
ISDN = 0<br />
Modem = /dev/ttyUSB2<br />
Baud = 9600<br />
<br />
[Dialer thenet]<br />
Phone = *99***1#<br />
Username = thenetuser<br />
Password = thenetpw<br />
; Username = 9180****** (If your provider use without Username)<br />
; Password = 9180****** (If your provider use without Password)<br />
Stupid Mode = 1<br />
Baud = 460800<br />
Init3 = AT+CGDCONT=1,"IP","apn.thenet.net"<br />
<br />
[Dialer mypin]<br />
Init4 = AT+CPIN=1234<br />
</pre><br />
<br />
<br />
<br />
Often there will be several devices (at /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2 for example). If in doubt about which to use, try each of them in turn or use /dev/gsmmodem (a link set up by usb_modeswitch) which should point to the correct one. Once the configuration files are prepared, the internet connection is established by running<br />
<br />
$ wvdial <section><br />
<br />
If necessary additional setup commands can be placed in a simple script like this:<br />
<br />
usb_modeswitch<br />
sleep 2<br />
modprobe usbserial vendor=0xVVVV product=0xMMMM maxSize=4096<br />
sleep 2<br />
wvdial thenet<br />
<br />
where VVVV is the hexadecimal vendor ID from lsusb, MMMM is the hexadecimal product ID ''when in modem mode'', and "thenet" is the name of the section in wvdial.conf which you wish to use. The maxSize option may or may not be necessary. It simplifies matters if you disable the SIM PIN, but if you require it, run "wvdial mypin" before "wvdial thenet".<br />
<br />
The final wvdial command should start pppd and the obained IP address should be visible in the terminal output. At that point the internet connection should be live, which can be easily checked with a web browser or by pinging an external IP address.<br />
<br />
=== sakis3g ===<br />
There may be the chance that the modem stick is supported by [http://www.sakis3g.org/ sakis3g] which is an all in one command line script and automatises all the steps above. The installation steps are as follows: <br />
<br />
wget "http://www.sakis3g.org/versions/latest/$ARCH/sakis3g.gz" # where $ARCH is either i386 or amd64<br />
gunzip sakis3g.gz<br />
chmod +x sakis3g<br />
./sakis3g --interactive<br />
<br />
or you could simply install it from aur:<br />
<br />
https://aur.archlinux.org/packages.php?ID=59017<br />
<br />
Since sakis3g.org is no longer up, you need to download it from here and extract it.<br />
http://sourceforge.net/projects/vim-n4n0/files/sakis3g.tar.gz/download<br />
<br />
=== Low connection speed ===<br />
Someone claims that the connection speed under linux is lower than Windows.<br />
https://bbs.archlinux.org/viewtopic.php?id=111513<br />
<br />
A short summary for possible solutions which are not fully verified.<br />
In most of conditions, the low speed is caused by bad receiver signals and too many people in cell. But you still could use the following method to try to improve the connection speed.<br />
====QoS parameter====<br />
AT+CGEQMIN and AT+CGEQREQ command could used to set the Qos command. And also it should be possible to used to decrease and limit the connect speed.<br />
Add the following Init command in wvdial.conf.<br />
Init6 = AT+CGEQMIN=1,4,64,640,64,640<br />
Init7 = AT+CGEQREQ=1,4,64,640,64,640<br />
====Baud parameter====<br />
Baud parameter in wvdial.conf could be used to increase the connection speed.<br />
Baud = 460800<br />
But the official Huawei E261 windows application set the Baud=9600 under Windows Vista.<br />
More verifications are needed to double check this point.<br />
===Monitor used bandwith===<br />
Frequently a 3G connection obtained via a mobile phone operator comes with restricted bandwidth, so that you are only allowed to use a certain bandwidth per time (e.g. 1GB per month). While it is quite straight-forward to know which type of network applications are pretty bandwidth extensive (e.g. video streaming, gaming, torrent, etc.), it may be difficult to keep an overview about overall consumed bandwidth. <br />
<br />
A number of tools are available to help with that. Two console tools are {{pkg|vnstat}}, which allows to keep track of bandwith over time, and {{pkg|iftop}} to monitor bandwidth of individual sessions. If you are a [[KDE]] user, {{pkg|KNemo}} might help. All are available in the [[Official Repositories|community repository]].<br />
<br />
==Reading SMS==<br />
This was tested on a Huawei EM770W (GTM382E) 3g card integrated into an Acer Aspire AS3810TG laptop.<br />
<br />
<pre><br />
$ pacman -S gnokii<br />
$ mkdir -p $XDG_CONFIG_HOME/gnokii<br />
</pre><br />
<br />
(usually ~/.config/gnokii)<br />
<br />
<pre><br />
$ cp /etc/gnokiirc ~/.config/gnokii/config<br />
</pre><br />
<br />
edit ~/.config/gnokii/config as follows:<br />
<br />
<pre><br />
port = /dev/ttyUSB0<br />
</pre><br />
<br />
You may have to use a different port depending on your config, i.e. /dev/ttyUSB1 or something else.<br />
<br />
<pre><br />
model = AT<br />
connection = serial<br />
</pre><br />
<br />
You need to be part of the uucp group to use /dev/ttyUSB0, for example if your user is called "x" and assuming you have sudo rights:<br />
<br />
<pre><br />
$ sudo gpasswd -a x uucp<br />
$ newgrp uucp<br />
</pre><br />
The newgrp command allows you to take advantage of the new group assignment immediately without having to logout/login.<br />
<br />
Then launch gnokii:<br />
<pre><br />
$ xgnokii<br />
</pre><br />
Click on the "SMS" icon button, a window opens up. Then click: "messages->activate sms reading". Your messages will show up in the window.<br />
===command line script===<br />
A small command line script using gnokii to read SMS on your SIM card (not phone memory) without having to start a GUI:<br />
$ gnokii --getsms SM 0 end 2>&1|grep Text -A1 -B3|grep -v Text<br />
What it does:<br />
<pre><br />
gnokii # invoke gnokii<br />
--getsms SM 0 end # read SMS from SM-memory location (=SIM card) starting at 0 and reading all occupied memory locations ("end")<br />
2>&1 # connect STDERR to STDOUT to make sure the output from the --getsms command can be piped to grep<br />
|grep Text # pipe output from gnokii to grep, anchoring at output containing "Text"<br />
-A1 -B3 # print one line after the matched pattern and three lines before the matched pattern<br />
|grep -v Text # grep result to another grep to exclude the "Text" line (-v for inverting the pattern)<br />
</pre><br />
Granted this doesn't work very well if your SMS contains the word "Text", but you may adapt the script to your liking.<br />
<br />
== Fix image quality ==<br />
If you're getting low quality images while browsing the web over a mobile broadband connection with the hints "shift+r improves the quality of this image" and "shift+a improves the quality of all images on this page", follow these instructions:<br />
pacman -Sy tinyproxy<br />
Edit /etc/tinyproxy/tinyproxy.conf and insert the following two lines:<br />
AddHeader "Pragma" "No-Cache"<br />
AddHeader "Cache-Control" "No-Cache"<br />
Start tinyproxy:<br />
/etc/rc.d/tinyproxy start<br />
Configure your browser to use localhost:8888 as a proxy server and you're all done. This is especially useful if you're using, for example, Google Chrome which, unlike Firefox, doesn't allow you to modify the Pragma and Cache-Control headers.<br />
==Related Articles==<br />
[[Huawei E220]]<br><br />
[[Allow users to dial with wvdial]]<br><br />
[[Idea_netsetter(Huawei_EG162G)]]<br><br />
[[ZTE MF110/MF190]]<br><br />
[[ZTE MF636]]<br><br />
[[Internet key Momo Design]]<br><br />
[[Dialup_without_a_dialer_HOWTO]]<br><br />
[[3G and GPRS modems with pppd alone]]<br><br />
[[Huawei E1550 3G modem]]<br><br />
[[Huawei E173s]]</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=256102MacBookPro10,x2013-05-04T19:25:07Z<p>Aelman: /* What doesn't work (early September 2012, 3.6-rc6) */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the stock UI elements are vectors (not rasters which look terrible on Retina and don't scale infinitely). In addition the [[Wayland|KWin compositor]] does a remarkable job on the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
* Thunderbolt ethernet controller is not hot pluggable as of the 3.8.11-1 kernel. The controller cannot<br />
** be connected and used after boot<br />
** be used if the controller is logically or physically disconnected and reconnected during an active session<br />
** survive suspend and resume states because the kernel is not able to successfully change the power state<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=255639MacBookPro10,x2013-04-29T08:12:56Z<p>Aelman: /* Graphics */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the stock UI elements are vectors (not rasters which look terrible on Retina and don't scale infinitely). In addition the [[Wayland|KWin compositor]] does a remarkable job on the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=255634MacBookPro10,x2013-04-29T06:01:14Z<p>Aelman: /* Graphics */ grammar</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the stock UI elements are vectors (not rasters which look terrible on Retina and don't scale infinitely). In addition the KWin compositor does a remarkable job on the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelmanhttps://wiki.archlinux.org/index.php?title=User:Aelman&diff=255633User:Aelman2013-04-29T05:58:20Z<p>Aelman: stub on userpage</p>
<hr />
<div>I've been an Archlinux user since 2010 and a Linux user since 2002. I would recommend Archlinux to anyone looking for a bleeding edge yet stable distro with fantastic community support and broad documentation. I chose Archlinux for my personal use because it makes the least assumptions about how I intend to use it. Oh and batteries are included.</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=255632MacBookPro10,x2013-04-29T05:46:03Z<p>Aelman: /* Graphics */ added adjective</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the stock UI elements are vectors (not rasters which look terrible on Retina and don't scale infinitely). In addition the KWin compositor does a remarkable job with the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=255631MacBookPro10,x2013-04-29T05:45:09Z<p>Aelman: /* Graphics */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the UI elements are vectors (not rasters which look terrible on Retina and don't scale infinitely). In addition the KWin compositor does a remarkable job with the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelmanhttps://wiki.archlinux.org/index.php?title=MacBookPro10,x&diff=255630MacBookPro10,x2013-04-29T05:44:05Z<p>Aelman: /* Graphics */ tip about kdm added</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|This wiki page should help you in getting your [[Wikipedia:MacBook_Pro#Third_generation_.28Retina.29|MacBook Pro with Retina Display]] to work with Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
== Overview ==<br />
This page should help you setting up ArchLinux on a MacBook Pro 10,1 with Retina display. Most of the steps are the same or very similar to the regular ArchLinux installation. However, because this is very new hardware, the setup requires a few different steps. <br />
The general installation guidelines are descibed in [[MacBook]].<br />
<br />
{{Note| To have all hardware supported, you should run this Notebook with Kernel 3.7 or newer. }}<br />
<br />
== Preparing for the Installation ==<br />
=== Preparing the Hard drive ===<br />
Assuming you want to dual boot with OS X, you have to shrink its partition with the Disk Utility. You can either create your Linux partition directly here, or do that later in Linux during the installation (using {{ic|parted}} and {{ic|mkfs}}).<br />
<br />
=== Using the Thunderbolt to Ethernet adapter ===<br />
The adapter should work out of the box if connected before booting. Thunderbolt hotplugging is not supported (yet?).<br />
<br />
=== Getting wireless firmware ===<br />
In order for the WiFi chip to work, you need to get the firmware for it. You can just copy it from another b43 enabled Arch, extract it from Broadcom's driver using {{Pkg|b43-fwcutter}} or get them through the {{AUR|b43-firmware}} available in the [[AUR]]. In the end you should have a folder called {{ic|b43}} with lots of {{ic|.fw}} files in it.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
Now, download the latest [[Archboot]] iso, write it to USB and boot from it by selecting it in the Apple boot loader. When it comes to the syslinux boot loader, press {{Keypress|Tab}} to edit the entry and append {{ic|noapic}} or {{ic|nointremap}} to the end to prevent a kernel panic during bootup. Currently (Aug 4, 2012), you also have to add {{ic|nomodeset}}.<br />
<br />
=== Connecting WiFi ===<br />
{{Note| You can skip this if you use the Thunderbolt to ethernet adapter for the installation.}}<br />
After it has finished booting, enter a command line. Copy the entire folder with the firmware for your wireless card to {{ic|(/usr)/lib/firmware/}}. Now you should be able to use {{Pkg|wpa_supplicant}} to connect to your WiFi network.<br />
<br />
=== The installation ===<br />
{{Note|Refer to the [[MacBook]] page if you don't want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
Run the installation wizard. When asked to partition your hard drive, create a small HFS partition. This is where you put the standalone GRUB package after the installation.<br />
The rest of the installation is pretty much the same as usual. When choosing the bootloader, select GRUB and install it. Don't worry about any errors, we will create the bootable efi image on our own afterwards.<br />
<br />
After the installation has completed, directly copy the WiFi firmware to the installed system to {{ic|/tmp/install/usr/lib/firmware/}}.<br />
<br />
=== Bootloader ===<br />
<br />
==== Direct EFI booting ====<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
==== GRUB ====<br />
<br />
Another solution is to install [[GRUB]]. Edit {{ic|/tmp/install/boot/grub/grub.cfg}} and edit the boot entry to load linux-mainline instead of the normal one. Also append {{ic|noapic}} to the kernel line again.<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by calling:<br />
grub-mkstandalone -o grub-standalone-x86_64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
This will create file called {{ic|grub-standalone-x86_64.efi}} which contains GRUB and the config file. It is important to {{ic|cd}} into the right directory to make it pick up the config file and put it into the right place within the image.<br />
Copy this file to the HFS partition you have created earlier. Downside of this method is that you need to repeat this step whenever you want to change the GRUB config.<br />
<br />
Reboot the machine and boot into OS X. The HFS partition should be mounted and the GRUB standalone image in there. Follow the steps on this page to create the files needed to make the Apple boot loader pick up GRUB: http://mjg59.dreamwidth.org/7468.html.<br />
After creating the files, use {{ic|bless}} on the GRUB image on the partition, if you want to boot automatically to Arch, append {{ic|--setBoot}}.<br />
<br />
After another reboot, you should be able to select your installed Arch Linux by keeping the alt button pressed while booting in case you haven't used{{ic| --setBoot}} while blessing.<br />
<br />
== Post installation ==<br />
=== Graphics ===<br />
The Laptop comes with an nVidia and an Intel chip. The Nouveau, the i915 (from 3.6-rc5) and proprietary nvidia (from 302.17) drivers work.<br />
You can install the nvidia driver through {{Pkg|nvidia}} or the AUR package {{AUR|nvidia-beta-all}}.<br />
<br />
Since this device comes with a Retina (HiDPI) display, things are really small with native resolution. There are different ways to work around this "issue":<br />
# Increase the DPI value to get larger fonts (other things like icons may not look great that way)<br />
# Some desktop managers like [[KDM]] offer fine grained control over the size of icons, fonts, window controls, panels, etc... <br />
#* KDM is a great choice because the UI elements are vectors (not rasters which look terrible on Retina). In addition the KWin compositor does a remarkable job with the Retina display.<br />
# Lower the screen resolution to 1680x1050 (works fine at least with nouveau drivers), but things look a little bit blurry, of course<br />
<br />
=== Sound ===<br />
<br />
On the MacBookPro10,2 you must use the 'snd_hda_intel' driver with the model option 'mbp101'. This model option goes in the modprobe configuration and is undocumented in the list of models available online, but it work admirably. (Until you do this, it will look it is working because you'll be able to get sound out through HDMI, but /not/ the built-in speakers.)<br />
<br />
=== Touchpad ===<br />
Because of the integrated button, the synaptics touchpad driver can cause some issues. Adjusting {{AUR|xf86-input-mtrack-git}} should lead to a better end result.<br />
<br />
The following config uses a single touch for left, two for middle, three for right:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.65"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "3"<br />
Option "ClickFinger3" "2"<br />
Option "BottomEdge" "25"<br />
EndSection<br />
<br />
== What doesn't work (early September 2012, 3.6-rc6) ==<br />
<br />
* Suspend mode on lid close with nouveau <s>and i915</s> (does not come out of suspend; blank screen).<br />
<br />
== Discussions ==<br />
<br />
Here are a couple of interesting threads:<br />
* http://ubuntuforums.org/showthread.php?t=2006475<br />
* https://bbs.archlinux.org/viewtopic.php?id=144255&p=1</div>Aelman