https://wiki.archlinux.org/api.php?action=feedcontributions&user=Trusktr&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:42:44ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=IOS&diff=412289IOS2015-12-14T18:58:04Z<p>Trusktr: /* iPhone/iPod Touch */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Mobile devices]]<br />
[[fr:iPod]]<br />
[[ja:iPod]]<br />
{{Related articles start}}<br />
{{Related|Audiobook}}<br />
{{Related articles end}}<br />
{{Style|Numerous style issues, see [[Help:Style]]}}<br />
The purpose of this article is to demonstrate the use of iDevices under Arch Linux.<br />
<br />
== Required Packages ==<br />
To interact with iOS devices with thunar or GNOME Files, install {{pkg|gvfs-afc}} and {{pkg|usbmuxd}}. Remember restart X afterwards. Now iOS devices should show up in thunar or Files. Not tested with KDE file managers.<br />
<br />
{{Note|All deps should get pulled down when installing gvfs-afc.}}<br />
<br />
== Changing iPod Mountpoint ==<br />
<br />
Traditional iPods are accessed just like a normal USB storage device containing a vfat file system (in rare cases {{ic|hfsplus}}), and can be [[USB storage devices|accessed as such]]. See the [[USB storage devices]] article for detailed instructions.<br />
<br />
If udisks2 is running, it will mount an attached iPod to {{ic|/run/media/''$USER''/''iPod name''}} (the older udisks will use {{ic|/media/''&lt;iPod name&gt;''}}).<br />
<br />
If the volume label of your iPod is long, or contains a mixture of spaces, and/or lower-case and capital letters, it may present an inconvenience. You may easily change the volume label for more expedient access using {{ic|dosfslabel}} from the {{pkg|dosfstools}} package:<br />
<br />
* Get and confirm the current volume label:<br />
# dosfslabel /dev/sd''XY''<br />
* Set the new volume label:<br />
# dosfslabel /dev/sd''XY'' ArchPod<br />
* Unmount the device:<br />
$ udisksctl unmount -b /dev/sd''XY''<br />
* Mount it again:<br />
$ udisksctl mount -b /dev/sd''XY''<br />
where {{ic|/dev/sdxx}} is the current device node of your iPod.<br />
<br />
== Importing videos and pictures ==<br />
<br />
Both videos and photos can be found in typically in {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}.<br />
<br />
=== HTML5 videos ===<br />
<br />
Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora. Note that the creation date metadata is not in the converted video, so you need to use a script like:<br />
<br />
find -name "*.MOV" | while read mov<br />
do<br />
d=$(gst-discoverer-0.10 -v $mov | awk '/datetime:/{print $2}' | tr -d \")<br />
base=${mov%.*}<br />
if test -f $base.ogv<br />
then<br />
touch -d${d} $base.ogv<br />
ls -l $base.ogv<br />
else<br />
echo $base.ogv missing<br />
fi<br />
done<br />
<br />
And use {{ic|cp -a}} or {{ic|rsync -t}} in order to preserve the file's date & time.<br />
<br />
=== Importing pictures and deleting them ===<br />
<br />
You can move photos and videos out of {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}, however you need to trigger a rebuild of the "Camera Roll" database by deleting the old databases.<br />
<br />
PhotoData$ sudo rm Photos* com.apple.photos.caches_metadata.plist<br />
<br />
== Converting video for iPod ==<br />
<br />
=== Gen 5/5.5 ===<br />
<br />
=== Handbrake ===<br />
<br />
[http://handbrake.fr/ Handbrake] is a nifty tool with presets for a variety of iPod versions. CLI and GTK versions are available from pacman as {{pkg|handbrake-cli}} and {{pkg|handbrake}} respectively.<br />
<br />
If you do decide to take the CLI way, a good guide is available at http://trac.handbrake.fr/wiki/CLIGuide.<br />
<br />
==== DVD to iPod ====<br />
'''Get from:''' {{AUR|podencoder}}{{Broken package link|{{aur-mirror|podencoder}}}}<br><br />
'''Depends on:''' aur/gpac mplayer<br />
<br />
Has detailed help, and is fairly self explanatory.<br />
<br />
An alternative is to use a method suggested at [[DVD Ripping]] then use one of the programs listed below to convert that to an iPod-friendly format.<br />
<br />
==== Video File to iPod ====<br />
'''Get from:''' http://thomer.com/howtos/mp4ize<br><br />
'''Depends on:''' {{pkg|mplayer}}<br />
<br />
This is a Ruby script to convert video files to an mp4 suitable for an iPod or iPhone.<br />
<br />
=== More Advanced/Configurable Methods ===<br />
<br />
==== Avidemux ====<br />
[[Install]] {{Pkg|avidemux-gtk}} or {{Pkg|avidemux-qt}} from the official repositories.<br />
<br />
This can convert to mp4 files. If you enforce a hard max of bit rate @ 700ish and keep the video size to 720x480 or 320x240 than it works fine for video file exporting.<br />
<br />
==== Mencoder ====<br />
<br />
[[Install]] the {{pkg|mplayer}} package from the official repositories.<br />
<br />
Has ''extremely'' comprehensive configuration support, which will be able to spit out iPod-compatible video files. Check out {{ic|man mencoder}}; a lot of MPlayer opts will also affect encoding.<br />
<br />
A basic guide is also available at [[MEncoder]].<br />
<br />
An example command to encode iPhone/iPod Touch-compatible video:<br />
<br />
mencoder INPUT -o output.mp4 \<br />
-vf scale=480:-10,harddup \<br />
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \<br />
-of lavf -lavfopts format=mp4 \<br />
-ovc x264 -x264encopts nocabac:level_idc=30:bframes=0<br />
<br />
==== FFMpeg ====<br />
<br />
[[Install]] the {{pkg|ffmpeg}} package from the official repositories.<br />
<br />
Another encoder with comprehensive configuration support. Example command to encode for 5G iPod:<br />
<br />
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 \<br />
-g 300 -acodec aac -ab 96 -i INPUT -s 320x240 \<br />
-aspect 4:3 output.mp4<br />
<br />
or iPod Touch/iPhone compatible video output:<br />
<br />
ffmpeg -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5\<br />
-bufsize 4096 -g 300 -acodec aac -ab 192 -s 480×320 -aspect 4:3 -i INPUT output.mp4<br />
<br />
== iPhone/iPod Touch ==<br />
<br />
=== Introduction ===<br />
By default, neither the iPhone nor the iPod Touch present mass storage capability over USB, though there exist two solutions for accessing your files.<br />
<br />
The first is to mount your device through the FUSE file system SSHFS. This requires jailbreaking, which can be done on any major OS using e.g. [http://www.ijailbreak.com/how-to/how-to-jailbreak-iphone-4s-absinthe-linux/ Absinthe] for recent iOS versions. After jailbreaking, an SSH server will also need to be installed on the device, which can be done through the Cydia program, installed on the device during the jailbreak process.<br />
<br />
The second is to use a FUSE file system called [https://www.archlinux.org/packages/?q=ifuse ifuse], which allows you to mount your device through USB, as you normally would. After installing ifuse, for instance, you should see your iPhone appear in the left navigation of Gnome Files and other supporting file managers. This method requires no hacking and is in general the better solution, though be aware that the software is still under heavy development. As of late, however, it has proven to be rather reliable and stable.<br />
<br />
{{Note|The current releases of {{pkg|libgpod}} and {{pkg|gtkpod}} support the iPod Touch and the iPhone OS 3.1.x up to iOS 4.3.x. It is possible to transfer pictures and music without limitations.}}<br />
<br />
Refer to this page:[https://help.ubuntu.com/community/PortableDevices/iPhone]<br />
<br />
=== Making Friends with the Device ===<br />
<br />
==== The SSHFS Way ====<br />
<br />
After this the easiest way to properly initialise a few things on the device's side is with the [http://launchpad.net/ipod-convenience iPod convenience script]. This is available in the AUR as {{AUR|ipod-convenience}}{{Broken package link|{{aur-mirror|ipod-convenience}}}}<br />
<br />
Next do {{ic|modprobe fuse}} to actually load the fuse module. You may also want to add it to your MODULES array in {{ic|/etc/rc.conf}} to have it loaded on boot.<br />
<br />
A few things may need changing in the script, depending on your setup. If you do not use sudo, replace:<br />
sudo lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf "FirewireGuid: 0x%s" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo<br />
with:<br />
su -c "lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf \"FirewireGuid: 0x%s\" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo"<br />
in the file /usr/share/ipod-convenience/mount-umount. You may also need to replace:<br />
PROCESS=`ssh root@$IPADDRESS ps x | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
with:<br />
PROCESS=`ssh root@$IPADDRESS ps ax | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
(I'm not sure under what circumstances this is necessary; it was on my iPod Touch running 2.2.1, and it will not have any adverse affect under other firmware version)<br />
<br />
After that, edit the {{ic|/etc/default/ipod-convenience}} file with details of your device's IP address, and create the mount point, which is {{ic|/media/ipod}} by default (make sure to set the permissions correctly if you want it accessible by a regular user)<br />
<br />
To actually mount the device, run {{ic|ipod-touch-mount}} or {{ic|iphone-mount}} (they both do exactly the same thing so it doesn't matter which). This should prompt for the root password of the device twice, which is 'alpine' by default in firmware versions 1.1 and up. This will need to be done every time you want to sync. (This can be done without having to type the password each time by using SSH keys - see [[Using SSH Keys]] for more information)<br />
<br />
==== The iFuse Way ====<br />
{{Note|If using an iPad/iPad2 that has a screen password, one must unlock the device to gain access through the USB interface.}}<br />
{{Note|The current version of ifuse is unable to mount an iPad2 using iOS v5.0.1. The git version of libimobiledevice in AUR works with an iPod using iOS v5.1.1}}<br />
<br />
You will need to install '''usbmuxd''', '''libplist''', '''libimobiledevice''', '''ifuse'''. As libimobiledevice is required by ifuse and usbmuxd, you can pull in all four with:<br />
# pacman -S ifuse usbmuxd libplist<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in {{ic|/etc/rc.conf}} already.<br />
<br />
You can now mount your device. Make sure it is unlocked before you plug it in, or it won't be recognized.<br />
# ifuse <mountpoint><br />
The mountpoint field is where you want to have it mounted.<br />
<br />
And you're done! You should be able to point your syncing software of choice to the mount point and be able to transfer files.<br />
<br />
To unmount your device:<br />
# umount <mountpoint><br />
<br />
==== Generating HashInfo file ====<br />
If you have not previously synced your device using iTunes specifically, you will get error messages telling you that the HashInfo file is missing. This can be fixed by making an iTunes installation on MacOS or Windows create it (by plugging in the iPod there). Alternatively you can create this file yourself, instructions can be found on [http://ihash.marcansoft.com/ this website].<br />
<br />
=== Unobfuscating the Database ===<br />
<br />
Since firmware version 2.0, Apple has obfuscated the music database. If you are using recent firmware, the file {{ic|/System/Library/Lockdown/Checkpoint.xml}} can be modified to enable use of the older, non-obfuscated database. Replace:<br />
<key>DBVersion</key><br />
<integer>4</integer><br />
with:<br />
<key>DBVersion</key><br />
<integer>2</integer><br />
Then reboot your device.<br />
<br />
If syncing fails with "ERROR: Unsupported checksum type '0' in cbk file generation!", you may need to leave this at 4. libgpod seems to [http://gitorious.org/libgpod/libgpod/blobs/b9b83dc8b6c3d1f0c53ed32f05279ca838d54e02/src/itdb_sqlite.c#line2064 expect a hashed database.]<br />
<br />
=== Syncing ===<br />
<br />
Use your favourite [[#iPod management apps|iPod-compatible program]]. Individual configuration will vary, but in general, pointing your program to your specified mount point should yield good results.<br />
<br />
After you've synced, run {{ic|ipod-touch-umount}} (or {{ic|iphone-umount}}, depending on your taste) to unmount the SSHFS file system and restart the {{ic|MobileMusicPlayer}} process on the device, so that the new music database is read.<br />
<br />
If you used iFuse, simply type:<br />
# umount <mountpoint><br />
You will still need to reload the MobileMusicPlayer process. If your device is not jailbroken, then you are stuck restarting it.<br />
<br />
=== The iFuse Way - iPhone OS 3.x and 4.x ===<br />
''Warning: this software is considered unstable and should probably not be used in a productive environment''<br />
<br />
Make sure you already installed base-devel, which contains several programs needed to compile your new components. If you did not, just run:<br />
<br />
# pacman -S base-devel<br />
<br />
which will install everything you will need.<br />
<br />
You will need to install {{Pkg|libplist}}, {{Pkg|libimobiledevice}}, {{Pkg|libgpod}}, {{Pkg|usbmuxd}} and {{Pkg|ifuse}}.<br />
<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in /etc/rc.conf already.<br />
Check if the group "usbmux" has been created and add your user using<br />
# gpasswd -a <user> usbmux<br />
<br />
To make sure the new rules apply, execute<br />
$ udevadm control --reload-rules<br />
and plug in your iPod/iPhone. <br />
<br />
Run as ROOT:<br />
# usbmuxd<br />
Now you should the be able to mount your device by running<br />
$ ifuse ~/ipod<br />
or similar. Make sure the directory used exists and is accessible to your user.<br />
<br />
Mount the device and create the iTunes_Control/Device directory. Then, get your UUID. It should be in the syslog from usbmuxd, or you can find it by running <br />
$ lsusb -v | egrep "iSerial.*[a-f0-9]{40}"<br />
It should be 40 characters long. Then, run <br />
$ ipod-read-sysinfo-extended <uuid> <mountpoint>. <br />
This should generate a file named {{ic|iTunes_Control/Device/SysInfoExtended}}.<br />
<br />
Now, start up your favourite app, it should detect the device via libgpod.<br />
I recommend using gtkpod-git for the time being, as that is what the libgpod developers seem to be using for debugging purposes.<br />
<br />
{{Note|If gtkpod/gtkpod-git seems to work only from root/sudo while your user only gets the slash screen, you can delete your {{ic|~/.gtkpod}} folder and retry. Note that gtkpod will forget your preferences.}}<br />
<br />
=== Rhythmbox ===<br />
<br />
Rhythmbox uses the Gnome Virtual File System to detect mobile devices. If using the iFuse way, gvfs-afc needs to be installed:<br />
# pacman -S gvfs-afc<br />
<br />
== iPod Classic/Nano3g ==<br />
<br />
You need to set up the iPod to make libgpod able to find its FireWire ID. For this, you will need to get your FireWire ID manually<br />
<br />
1) Mount the iPod as a rw mount point. In the following example, I will use {{ic|/mnt/ipod}}.<br />
<br />
2 ) Find the serial number by typing<br />
<br />
sudo lsusb -v | grep -i Serial <br />
<br />
this should print a 16 character long string like 00A1234567891231 (it will have no colons or hyphens) <br />
<br />
3) Once you have that number, create or edit {{ic|/mnt/ipod/iPod_Control/Device/SysInfo}}. Add to that file the line below:<br />
<br />
FirewireGuid: 0xffffffffffffffff<br />
<br />
(replace ffffffffffffffff with the 16 digit string you obtained at the previous step and do not forget the leading 0x before the string)<br />
<br />
Your iPod can now be managed with Amarok or gtkpod.<br />
<br />
== iPod management apps ==<br />
*[http://wiki.gnome.org/Apps/Rhythmbox Rhythmbox]<br />
**GTK interface ([[GNOME]])<br />
**Is part of the official GNOME projects.<br />
**Fast, light interface.<br />
**Manage music on your computer and iPod<br />
**Download or stream podcasts and video podcasts<br />
**Queue up songs and podcasts<br />
**Last.fm integration<br />
**Live radio stations<br />
**Jamendo and Magnatune support<br />
**Audio CD burning<br />
**Album cover display<br />
**Song lyrics display<br />
**DAAP sharing<br />
<br />
*[http://banshee.fm Banshee]<br />
**GTK interface (GNOME)<br />
**Uses Mono so it is slower and more resource hogging than rhythmbox<br />
**Device Sync: Sync your music and videos to your Android, iPod, or other device - or import its media<br />
**Podcasts: Download or stream podcasts and video podcasts<br />
**Play Queue: Queue up songs, videos, and podcasts, or let the Auto DJ take over<br />
**Shuffle Modes: Shuffle (or Auto DJ) by artist, album, rating, or even songs' acoustic similarity<br />
**Album Art: Artwork is automatically fetched as you listen<br />
**Powerful Search, Smart Playlists: Find exactly what you want, fast<br />
**Video Support: All the power of Banshee, now for your videos<br />
<br />
*[http://www.yamipod.com Yamipod]<br />
**GTK interface (GNOME)<br />
**super lightweight application for managing ONLY music on your iPod (not on your computer)<br />
**easy ratings edit<br />
**PC to iPod synchronization<br />
**News RSS and podcasts to iPod upload<br />
**Last.fm support <br />
**playlist support<br />
<br />
*[http://www.gtkpod.org gtkpod]<br />
**GTK interface (GNOME)<br />
**Read your existing iTunesDB (i.e. import the existing contents of your iPod including play counts, ratings and on-the-go playlists).<br />
**Add MP3, WAV, M4A (non-protected AAC), M4B (audio book), podcasts, and various video files (single files, directories or existing playlists) to the **iPod. You need a third party product to download podcasts, like 'bashpodder' or 'gpodder'<br />
**View, add and modify Cover Art<br />
**Browse the contents of your local hard disk by album/artist/genre by adding all your songs to the 'local' database. From there the tracks can be **dragged over to the iPod/Shuffle easily.<br />
**Create and modify playlists, including smart playlists.<br />
**You can choose the charset the ID3 tags are encoded in from within gtkpod. The default is the charset currently used by your locale setting.<br />
**Extract tag information (artist, album, title...) from the filename if you supply a template.<br />
**Detect duplicates when adding songs (optional).<br />
**Remove and export tracks from your iPod.<br />
**Modify ID3 tags -- changes are also updated in the original file (optional).<br />
**Refresh ID3 tags from file (if you have changed the tags in the original file).<br />
**Sync directories.<br />
**Normalize the volume of your tracks (uses mp3gain or the replay-gain tag)<br />
**Write the updated iTunesDB and added songs to your iPod.<br />
**Work offline and synchronize your new playlists / songs with the iPod at a later time.<br />
**Export your korganizer/kaddressbook/Thunderbird/evocalendar/evolution/webcalendar... data to the iPod (scripts for other programs can be added).<br />
<br />
*[http://www.floola.com Floola]<br />
**GTK interface (GNOME)<br />
<br />
*[http://amarok.kde.org/ Amarok]<br />
**KDE/qt interface<br />
<br />
*[http://qpod.sourceforge.net qPod]<br />
**KDE/qt interface<br />
**front-end for GNUpod<br />
<br />
*[http://www.gnu.org/software/gnupod/ GNUpod]<br />
**command-line only<br />
<br />
*[http://www.jakpod.de/ jakpod]<br />
** JakPod is based on Java and allows you to copy music and video files to your iPod.<br />
** iPod Nano 6th support<br />
** {{AUR|jakpod}}<br />
<br />
== See also ==<br />
** [http://help.ubuntu.com/community/PortableDevices/iPhone More information about iPhone/iPod Touch support]<br />
** [http://wiki.gotux.net/code/perl/atget Apple trailers downloader script]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Qt_for_Android&diff=407223Qt for Android2015-10-28T18:22:14Z<p>Trusktr: </p>
<hr />
<div>{{Stub|TODO}}<br />
<br />
One way to currently get started, which doesn't follow Arch Linux standards, is to run the Qt for Android installer which can modify your system in a way that pacman will not track. The installer is at<br />
<br />
http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-android-5.5.1.run<br />
<br />
TODO: Make a package for the AUR, qt-android, and describe setup and troubleshooting here.</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Qt&diff=407222Qt2015-10-28T18:21:06Z<p>Trusktr: </p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[ja:Qt]]<br />
[[ru:Qt]]<br />
[[zh-CN:Qt]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related|Uniform Look for Qt and GTK Applications}}<br />
{{Related|GTK+}}<br />
{{Related|Qt for Android}}<br />
{{Related articles end}}<br />
[http://qt-project.org/ Qt] is a cross-platform application and widget toolkit that uses standard C++ but makes extensive use of a special code generator (called the [http://qt-project.org/doc/qt-4.8/moc.html Meta Object Compiler], or ''moc'') together with several macros to enrich the language. Some of its more important features include:<br />
* Running on the major desktop platforms and some of the mobile platforms.<br />
* Extensive internationalization support.<br />
* A complete library that provides SQL database access, XML parsing, thread management, network support, and a unified cross-platform application programming interface (API) for file handling.<br />
<br />
The Qt framework is emerging as a major development platform and is the basis of the [[KDE]] software community, among other important open source and proprietary applications such as [[VLC]], [[VirtualBox]], [[Mathematica]], [[Skype]] and many others.<br />
<br />
== Installation ==<br />
Two versions of Qt are currently available in the [[official repositories]]. They can be [[Pacman|installed]] with the following packages:<br />
* '''Qt 5.x''' is available in the {{Pkg|qt5-base}} package, with documentation in the {{Pkg|qt5-doc}} package.<br />
* '''Qt 4.x''' is available in the {{Pkg|qt4}} package, with documentation on AUR in the {{AUR|qt4-doc}} package.<br />
* '''Qt 3.x''' is available from the AUR in the {{AUR|qt3}} package, with documentation on AUR in the {{AUR|qt3-doc}} package.<br />
<br />
{{ Warning|Qt packages do not provide the usual bins (e.g. ''qmake'') in {{ic|/usr/bin}} anymore. Instead {{ic|-qt5}}, {{ic|-qt4}} and {{ic|-qt3}} symlinks are provided (e.g. {{ic|qmake-qt5}}, {{ic|qmake-qt4}}, {{ic|qmake-qt3}}). This may cause compilation failures in Qt3/4 applications.<br />
To install usual bins, see [[#Default Qt toolkit]] section. }}<br />
<br />
=== Qt5 Platform Plugins and Missing Dependencies ===<br />
Using {{Pkg|qt5-base}} will install Qt5, which makes use of [http://doc.qt.io/qt-5/qpa.html platform abstractions], but some platform abstraction plugin dependencies may be missing. Qt may tell you that the plugin is unavailable, rather than resolve the chain of missing dependencies. For instance, if your application relies on [http://xcb.freedesktop.org xcb], and dependencies of the xcb library are missing, Qt will report:<br />
<br />
This application failed to start because it could not find or load the Qt platform plugin "xcb". Available plugins are: xcb.<br />
<br />
Reinstalling the application may fix this problem.<br />
<br />
The Qt5 page proposes a [http://doc.qt.io/qt-5/linux-requirements.html list of packages] that are recommended for installation, blindly installing all of which may not be very Arch-like. Instead, you may identify the plugin (in the case of xcb, libqxcb.so), and use {{ic|ldd}} to identify missing dependencies. Installing these dependencies should resolve the issue.<br />
<br />
== Default Qt toolkit ==<br />
By installing {{Pkg|qtchooser}} you can restore the usual bins (e.g. ''qmake'') in {{ic|/usr/bin}} and setup the Qt toolkit to use. By default Qt5 is used.<br />
<br />
=== Using environment variables ===<br />
To define default Qt toolkit, you can create {{ic|QT_SELECT}} [[environment variable]]. For example, to set Qt4, do {{ic|1=export QT_SELECT=4}} in your shell's init file (e.g. {{ic|~/.bash_profile.}} or {{ic|~/.zsh_profile.}}).<br />
<br />
=== Using configuration files ===<br />
You can set default Qt toolkit by creating a symlink {{ic|~/.config/qtchooser/default.conf}} to one of ''.conf'' files in {{ic|/etc/xdg/qtchooser/}} directory. For example, to set Qt4 symlink {{ic|/etc/xdg/qtchooser/4.conf}} to {{ic|~/.config/qtchooser/default.conf}}:<br />
<br />
$ ln -s {{ic|/etc/xdg/qtchooser/4.conf}} {{ic|~/.config/qtchooser/default.conf}}<br />
<br />
== Appearance ==<br />
=== Qt4 ===<br />
Qt4 application will try to mimic the behavior of the desktop environment they are running on, unless they run into some problems or hard-coded settings.<br />
* In KDE 4, it uses the actually selected Qt style in KDE. It can be configured using ''KDE System Settings'' (''systemsettings''), the settings can be found in ''Common Appearance and Behavior > Application Appearance > Style > Widget Style''<br />
* In KDE Plasma 5, it uses Plastique.<br />
* In Cinnamon, GNOME, Xfce, it uses GTK+ ([[Uniform look for Qt and GTK applications#QGtkStyle|QGtkStyle]]).<br />
* In other desktop environments, it uses Windows.<br />
<br />
For those who want to change the look and feel of Qt4 application, the ''Qt Configuration'' (''qtconfig-qt4'') GUI tool is available. It offers a very simple configuration for the appearance of Qt4 applications that gives the user easy access to the current Qt Style, colors, fonts and other more advanced options.<br />
<br />
{{Note|If you use ''GTK+'' style, then color and font settings will be ignored, and inherited from GTK+ 2.}}<br />
<br />
Qt keeps all its configuration information in {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific). The file is rather difficult to navigate because it contains a lot of information not related to appearance, but for any changes you can just add to the end of the file and overwrite any previous values (make sure to add your modification under the [Qt] header).<br />
<br />
For example, to change the theme to QtCurve, add:<br />
{{hc|~/.config/Trolltech.conf|<nowiki><br />
...<br />
[Qt]<br />
style=QtCurve<br />
</nowiki>}}<br />
<br />
The following styles are included in Qt4: ''CDE'', ''Cleanlooks'', ''GTK+'', ''Motif'', ''Plastique'', ''Windows''. Others can be installed from the official repositories or the [[AUR]] (most are written for KDE Plasma Desktop):<br />
* {{App|Breeze|Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.|https://projects.kde.org/projects/kde/workspace/breeze|{{Pkg|breeze-kde4}}}}<br />
* {{App|[[Wikipedia:Oxygen Project|Oxygen]]|KDE Oxygen style.|https://projects.kde.org/projects/kde/workspace/oxygen|{{Pkg|oxygen-kde4}}}} or {{Pkg|kdebase-workspace}}<br />
* {{App|QtCurve|A configurable set of widget styles for KDE and Gtk.|https://projects.kde.org/projects/playground/base/qtcurve|{{Pkg|qtcurve-qt4}}}}<br />
* {{App|Phase|Widget style designed to be functional but not drab, and aesthetic but not distracting.|http://kde-look.org/content/show.php?content&#61;11402|{{Pkg|kdeartwork-styles}}}}<br />
* {{App|Skulpture|A GUI style addon for KDE and Qt programs that features a classical three dimensional artwork with shadows and smooth gradients to enhance the visual experience.|http://kde-look.org/content/show.php/?content&#61;59031|{{AUR|skulpture}}{{Broken package link|{{aur-mirror|skulpture}}}}}}<br />
* {{App|Bespin|A very configurable KDE theme.|http://cloudcity.sourceforge.net/frame.php|{{AUR|bespin-svn}}{{Broken package link|{{aur-mirror|bespin-svn}}}}}}<br />
<br />
=== Qt5 ===<br />
Qt5 decides the style to use based on what desktop environment is used:<br />
* In KDE Plasma 5, it uses the actually selected Qt style in KDE Plasma 5. It can be configured using ''KDE 5 System Settings'' (''systemsettings5''), the settings can be found in ''Appearance > Application Style > Widget Style''.<br />
* In KDE 4, it uses Oxygen (if available) or Fusion.<br />
* In Cinnamon, GNOME, MATE, LXDE, Xfce, it uses GTK+ ([[Uniform look for Qt and GTK applications#QGtkStyle|QGtkStyle]]).<br />
* In other desktop environments, it uses Fusion.<br />
<br />
To force a specific style, you can set the {{ic|QT_STYLE_OVERRIDE}} environment variable. Specifically, set it to {{ic|GTK+}} if you want to use the gtk theme. Qt5 applications also support the {{ic|-style}} flag, which you can use to launch a Qt5 application with a specific style.<br />
<br />
The following styles are included in Qt5: ''GTK+'', ''Fusion'', ''Windows''. Others can be installed from the official repositories:<br />
* {{App|Breeze|Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.|https://projects.kde.org/projects/kde/workspace/breeze|{{Pkg|breeze}}}}<br />
* {{App|Oxygen|KDE Oxygen style.|https://projects.kde.org/projects/kde/workspace/oxygen|{{Pkg|oxygen}}}}<br />
* {{App|QtCurve|A configurable set of widget styles for KDE and Gtk.|https://projects.kde.org/projects/playground/base/qtcurve|{{Pkg|qtcurve-qt5}}}}<br />
<br />
Like with {{ic|qtconfig-qt4}} for Qt4 apps, {{pkg|qt5ct}} can be used to customize the look and feel of Qt5 apps.<br />
<br />
=== Qt Style Sheets ===<br />
An interesting way of customizing the look and feel of a Qt application is using Style Sheets, which are just simple CSS files. Using Style Sheets, one can modify the appearance of every widget in the application.<br />
<br />
To run an application with a different style just execute:<br />
$ qt_application -stylesheet ''style.qss''<br />
<br />
For more information on Qt Style Sheets see the [http://doc.qt.io/qt-5/stylesheet-reference.html official documentation] or other [http://thesmithfam.org/blog/2009/09/10/qt-stylesheets-tutorial/ tutorials]. As an example Style Sheet see this [http://kde-apps.org/content/show.php/roxydoxy?content&#61;125979 Dolphin modification].<br />
<br />
=== GTK+ and Qt ===<br />
If you have GTK+ and Qt applications, their looks might not exactly blend in very well. If you wish to make your GTK+ styles match your Qt styles please read [[Uniform look for Qt and GTK applications]].<br />
<br />
=== Native KDE look for Qt apps under environments other than KDE ===<br />
<br />
Unlike Qt4, Qt5 doesn't ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running DE. In KDE or GNOME this works well, but in other less popular DEs or WM it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting <br />
{{ic|1=XDG_CURRENT_DESKTOP=KDE}} or {{ic|GNOME}}, and then using the corresponding configuration application to set the desired icon set.<br />
<br />
Another solution is provided by the {{pkg|qt5ct}} package, which provides a DE independent Qt5 QPA and a configuration utility. After installing the package, run {{ic|qt5ct}} to set an icon theme, and set the environment variable {{ic|1=QT_QPA_PLATFORMTHEME="qt5ct"}} so that the settings are picked up by Qt applications.<br />
<br />
== Development ==<br />
<br />
=== Supported platforms ===<br />
Qt supports most platforms that are available today, even some of the more obscure ones, with more ports appearing every once in a while. For a more complete list see the [[Wikipedia:Qt_(framework)#Platforms|Qt Wikipedia article]].<br />
<br />
=== Tools ===<br />
<br />
{{Expansion|missing references to Qt5 tools}}<br />
<br />
The following are official Qt tools:<br />
<br />
* {{App|[[Wikipedia:Qt Creator|Qt Creator]]|A cross-platform IDE tailored for Qt that supports all of its features.|http://qt-project.org/doc/qtcreator/|{{Pkg|qtcreator}}}}<br />
* {{App|Qt Linguist|A set of tools that speed the translation and internationalization of Qt applications.|http://qt-project.org/doc/qt-4.8/linguist-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Assistant|A configurable and redistributable documentation reader for Qt ''qch'' files.|http://qt-project.org/doc/qt-4.8/assistant-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Designer|A powerful cross-platform GUI layout and forms builder for Qt widgets.|http://qt-project.org/doc/qt-4.8/designer-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Quick Designer|A visual editor for QML files which supports WYSIWYG. It allows you to rapidly design and build Qt Quick applications and components from scratch.|http://qt-project.org/doc/qtcreator-2.8/creator-using-qt-quick-designer.html|{{Pkg|qtcreator}}}}<br />
* {{App|QML Viewer|A tool for loading QML documents that makes it easy to quickly develop and debug QML applications.|http://qt-project.org/doc/qt-4.8/qmlviewer.html|{{Pkg|qt4}}}}<br />
* {{App|[[Wikipedia:Qmake|qmake]]|A tool that helps simplify the build process for development project across different platforms, similar to [[Wikipedia:CMake|cmake]], but with fewer options and tailored for Qt applications.|https://qt-project.org/doc/qt-4.8/qmake-manual.html|{{Pkg|qt4}}}}<br />
* {{App|uic|A tool that reads ''*.ui'' XML files and generates the corresponding C++ files.|http://qt-project.org/doc/qt-4.8/uic.html|{{Pkg|qt4}}}}<br />
* {{App|rcc|A tool that is used to embed resources (such as pictures) into a Qt application during the build process. It works by generating a C++ source file containing data specified in a Qt resource (.qrc) file.|http://qt-project.org/doc/qt-4.8/rcc.html|{{Pkg|qt4}}}}<br />
* {{App|moc|A tool that handles Qt's C++ extensions (the signals and slots mechanism, the run-time type information, and the dynamic property system, etc.).|http://doc.qt.digia.com/4.7-snapshot/moc.html|{{Pkg|qt4}}}}<br />
<br />
=== Bindings ===<br />
Qt has bindings for all of the more popular languages, for a full list see [[Wikipedia:Qt (framework)#Programming language bindings|this list]].<br />
<br />
The following examples display a small 'Hello world!' message in a window.<br />
<br />
==== C++ ====<br />
* Package: <br />
** {{Pkg|qt4}} - Version 4.x of the Qt toolkit.<br />
** {{Pkg|qt5-base}} - Version 5.x of the Qt toolkit.<br />
* Website: http://qt-project.org/<br />
* Build: <br />
** The Qt4 version: {{ic|g++ $(pkg-config --cflags --libs QtGui) -o hello hello.cpp}}<br />
** The Qt5 version: {{ic|g++ $(pkg-config --cflags --libs Qt5Widgets) -o hello hello.cpp}}<br />
* Run with: {{ic|./hello}}<br />
{{hc|hello.cpp|<br />
#include <QApplication><br />
#include <QLabel><br />
<br />
int main(int argc, char **argv)<br />
{<br />
QApplication app(argc, argv);<br />
QLabel hello("Hello world!");<br />
<br />
hello.show();<br />
return app.exec();<br />
}<br />
}}<br />
<br />
==== QML ====<br />
* Package: {{Pkg|qt4}} or {{Pkg|qt5-declarative}}.<br />
* Website: http://qt-project.org/<br />
* Run with: {{ic|qmlviewer-qt4 hello.qml}} or {{ic|qmlscene-qt5 hello.qml}}<br />
{{hc|hello.qml|<br />
import QtQuick 1.0<br />
<br />
Rectangle {<br />
id: page<br />
width: 400; height: 100<br />
color: "lightgray"<br />
<br />
Text {<br />
id: helloText<br />
text: "Hello world!"<br />
anchors.horizontalCenter: page.horizontalCenter<br />
anchors.verticalCenter: page.verticalCenter<br />
font.pointSize: 24; font.bold: true<br />
}<br />
}<br />
}}<br />
{{Note|For version 5.x of the Qt toolkit, we need to import QtQuick 2.y.}}<br />
<br />
==== Python (PyQt) ====<br />
* Package:<br />
** {{Pkg|python-pyqt4}} - Python 3.x bindings for Qt 4<br />
** {{Pkg|python2-pyqt4}} - Python 2.x bindings for Qt 4<br />
** {{Pkg|python-pyqt5}} - Python 3.x bindings for Qt 5<br />
** {{Pkg|python2-pyqt5}} - Python 2.x bindings for Qt 5<br />
<br />
* Website: http://www.riverbankcomputing.co.uk/software/pyqt/intro<br />
* Run with: {{ic|python hello-pyqt.py}} or {{ic|python2 hello-pyqt.py}}.<br />
{{hc|hello-pyqt.py|<nowiki><br />
import sys<br />
from PyQt4 import QtGui<br />
<br />
app = QtGui.QApplication(sys.argv)<br />
label = QtGui.QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
The Qt 5.x version is slighly different:<br />
{{hc|hello-pyqt.py|<nowiki><br />
import sys<br />
from PyQt5 import QtWidgets<br />
<br />
app = QtWidgets.QApplication(sys.argv)<br />
label = QtWidgets.QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
==== Python (PySide) ====<br />
* Package:<br />
** {{Pkg|python-pyside}} - Python 3.x bindings<br />
** {{Pkg|python2-pyside}} - Python 2.x bindings<br />
* Website: http://www.pyside.org/<br />
* Run with: {{ic|python hello-pyside.py}} or {{ic|python2 hello-pyside.py}}<br />
{{hc|hello-pyside.py|<nowiki><br />
import sys<br />
from PySide.QtCore import *<br />
from PySide.QtGui import *<br />
<br />
app = QApplication(sys.argv)<br />
label = QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
==== C# ====<br />
* Package: {{AUR|kdebindings-qyoto}}{{Broken package link|{{aur-mirror|kdebindings-qyoto}}}}<br />
* Website: http://techbase.kde.org/Development/Languages/Qyoto<br />
* Build with: {{ic|mcs -pkg:qyoto hello.cs}}<br />
* Run with: {{ic|mono hello.exe}}<br />
{{hc|hello.cs|<br />
using System;<br />
using Qyoto;<br />
<br />
public class Hello {<br />
public static int Main(String[] args) {<br />
new QApplication(args);<br />
new QLabel("Hello world!").Show();<br />
<br />
return QApplication.Exec();<br />
}<br />
}<br />
}}<br />
<br />
==== Ruby ====<br />
* Package: {{AUR|kdebindings-qtruby}}{{Broken package link|{{aur-mirror|kdebindings-qtruby}}}}<br />
* Website: http://rubyforge.org/projects/korundum/<br />
* Run with: {{ic|ruby hello.rb}}<br />
{{hc|hello.rb|<nowiki><br />
require 'Qt4'<br />
<br />
app = Qt::Application.new(ARGV)<br />
hello = Qt::Label.new('Hello World!')<br />
<br />
hello.show<br />
app.exec</nowiki><br />
}}<br />
==== Java ====<br />
* Package: {{AUR|qtjambi}}{{Broken package link|{{aur-mirror|qtjambi}}}} or {{AUR|qtjambi-beta}}{{Broken package link|{{aur-mirror|qtjambi-beta}}}}.<br />
* Website: http://qt-jambi.org/<br />
* Build with: {{ic|javac Hello.java -cp /opt/qtjambi-beta/qtjambi-linux64-community-4.7.0/qtjambi-4.7.0.jar}}.<br />
* Run with: {{ic|java -cp /opt/qtjambi-beta/qtjambi-linux64-community-4.7.0/qtjambi-4.7.0.jar:. Hello}}.<br />
{{hc|Hello.java|<nowiki><br />
import com.trolltech.qt.gui.*;<br />
<br />
public class Hello<br />
{<br />
public static void main(String args[])<br />
{<br />
QApplication.initialize(args);<br />
QLabel hello = new QLabel("Hello World!");<br />
<br />
hello.show();<br />
QApplication.exec();<br />
}<br />
}</nowiki><br />
}}<br />
{{Note|The build instructions and example have been tested on the beta version of Qt Jambi 4.7.0.}}<br />
<br />
==== Perl ====<br />
* Package: {{AUR|kdebindings-perlqt}}{{Broken package link|{{aur-mirror|kdebindings-perlqt}}}}<br />
* Website: http://code.google.com/p/perlqt4/<br />
* Run with: {{ic|perl hello.pl}}<br />
{{hc|hello.pl|<nowiki><br />
use QtGui4;<br />
<br />
my $a = Qt::Application(\@ARGV);<br />
my $hello = Qt::Label("Hello World!", undef);<br />
<br />
$hello->show;<br />
exit $a->exec;<br />
</nowiki><br />
}}<br />
==== Lua ====<br />
* Package: {{AUR|libqtlua}}{{Broken package link|{{aur-mirror|libqtlua}}}}<br />
* Website: http://www.nongnu.org/libqtlua/<br />
* Run with: {{ic|qtlua hello.lua}}<br />
{{hc|hello.lua|<nowiki><br />
label = qt.new_widget("QLabel")<br />
<br />
label:setText("Hello World!")<br />
label:show()</nowiki><br />
}}<br />
<br />
{{Note|QtLua is not designed to develop an application in pure Lua but rather to extend a Qt C++ application using Lua as scripting language.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Icon theme is not applied ===<br />
<br />
Since Qt 5.1 SVG support has moved into a module. Since {{Pkg|qt5-base}} does not depend on {{Pkg|qt5-svg}} it may happen that the {{Pkg|qt5-base}} is installed but not {{Pkg|qt5-svg}}. This results in deceptive icon theme behaviour. Since SVG is not supported the icons are silently skipped and the icon theme may seem to be unused. Installing {{Pkg|qt5-svg}} explicitly solves the problem.<br />
<br />
=== Qt4 style not respected ===<br />
<br />
If pure Qt4 (non-KDE) applications do not stick with your selected Qt4 style, then you'll probably need to tell Qt4 how to find KDE's styles (Oxygen, Phase etc.). You just need to set the environment variable QT_PLUGIN_PATH. E.g. put<br />
<br />
export QT_PLUGIN_PATH=$HOME/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/<br />
<br />
into your {{ic|/etc/profile}} (or {{ic|~/.profile}} if you do not have root access). {{ic|qtconfig-qt4}} should then be able to find your kde styles and everything should look nice again!<br />
<br />
Alternatively, you can symlink the Qt4 styles directory to the KDE4 styles one:<br />
# ln -s /usr/lib/{kde,qt}4/plugins/styles/[theme name]<br />
<br />
== Resources ==<br />
* [http://qt.io/ Official Website]<br />
* [http://doc.qt.io/ Qt Documentation]<br />
* [http://planet.qt.io/ Planet Qt]<br />
* [http://qt-apps.org/ Qt Applications]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Qt&diff=407221Qt2015-10-28T18:20:42Z<p>Trusktr: Added ilnk to new "Qt for Android" page, which is WIP.</p>
<hr />
<div>[[Category:Widget toolkits]]<br />
[[ja:Qt]]<br />
[[ru:Qt]]<br />
[[zh-CN:Qt]]<br />
{{Related articles start}}<br />
{{Related|KDE}}<br />
{{Related|Uniform Look for Qt and GTK Applications}}<br />
{{Related|GTK+}}<br />
{{Related|Qt_for_Android}}<br />
{{Related articles end}}<br />
[http://qt-project.org/ Qt] is a cross-platform application and widget toolkit that uses standard C++ but makes extensive use of a special code generator (called the [http://qt-project.org/doc/qt-4.8/moc.html Meta Object Compiler], or ''moc'') together with several macros to enrich the language. Some of its more important features include:<br />
* Running on the major desktop platforms and some of the mobile platforms.<br />
* Extensive internationalization support.<br />
* A complete library that provides SQL database access, XML parsing, thread management, network support, and a unified cross-platform application programming interface (API) for file handling.<br />
<br />
The Qt framework is emerging as a major development platform and is the basis of the [[KDE]] software community, among other important open source and proprietary applications such as [[VLC]], [[VirtualBox]], [[Mathematica]], [[Skype]] and many others.<br />
<br />
== Installation ==<br />
Two versions of Qt are currently available in the [[official repositories]]. They can be [[Pacman|installed]] with the following packages:<br />
* '''Qt 5.x''' is available in the {{Pkg|qt5-base}} package, with documentation in the {{Pkg|qt5-doc}} package.<br />
* '''Qt 4.x''' is available in the {{Pkg|qt4}} package, with documentation on AUR in the {{AUR|qt4-doc}} package.<br />
* '''Qt 3.x''' is available from the AUR in the {{AUR|qt3}} package, with documentation on AUR in the {{AUR|qt3-doc}} package.<br />
<br />
{{ Warning|Qt packages do not provide the usual bins (e.g. ''qmake'') in {{ic|/usr/bin}} anymore. Instead {{ic|-qt5}}, {{ic|-qt4}} and {{ic|-qt3}} symlinks are provided (e.g. {{ic|qmake-qt5}}, {{ic|qmake-qt4}}, {{ic|qmake-qt3}}). This may cause compilation failures in Qt3/4 applications.<br />
To install usual bins, see [[#Default Qt toolkit]] section. }}<br />
<br />
=== Qt5 Platform Plugins and Missing Dependencies ===<br />
Using {{Pkg|qt5-base}} will install Qt5, which makes use of [http://doc.qt.io/qt-5/qpa.html platform abstractions], but some platform abstraction plugin dependencies may be missing. Qt may tell you that the plugin is unavailable, rather than resolve the chain of missing dependencies. For instance, if your application relies on [http://xcb.freedesktop.org xcb], and dependencies of the xcb library are missing, Qt will report:<br />
<br />
This application failed to start because it could not find or load the Qt platform plugin "xcb". Available plugins are: xcb.<br />
<br />
Reinstalling the application may fix this problem.<br />
<br />
The Qt5 page proposes a [http://doc.qt.io/qt-5/linux-requirements.html list of packages] that are recommended for installation, blindly installing all of which may not be very Arch-like. Instead, you may identify the plugin (in the case of xcb, libqxcb.so), and use {{ic|ldd}} to identify missing dependencies. Installing these dependencies should resolve the issue.<br />
<br />
== Default Qt toolkit ==<br />
By installing {{Pkg|qtchooser}} you can restore the usual bins (e.g. ''qmake'') in {{ic|/usr/bin}} and setup the Qt toolkit to use. By default Qt5 is used.<br />
<br />
=== Using environment variables ===<br />
To define default Qt toolkit, you can create {{ic|QT_SELECT}} [[environment variable]]. For example, to set Qt4, do {{ic|1=export QT_SELECT=4}} in your shell's init file (e.g. {{ic|~/.bash_profile.}} or {{ic|~/.zsh_profile.}}).<br />
<br />
=== Using configuration files ===<br />
You can set default Qt toolkit by creating a symlink {{ic|~/.config/qtchooser/default.conf}} to one of ''.conf'' files in {{ic|/etc/xdg/qtchooser/}} directory. For example, to set Qt4 symlink {{ic|/etc/xdg/qtchooser/4.conf}} to {{ic|~/.config/qtchooser/default.conf}}:<br />
<br />
$ ln -s {{ic|/etc/xdg/qtchooser/4.conf}} {{ic|~/.config/qtchooser/default.conf}}<br />
<br />
== Appearance ==<br />
=== Qt4 ===<br />
Qt4 application will try to mimic the behavior of the desktop environment they are running on, unless they run into some problems or hard-coded settings.<br />
* In KDE 4, it uses the actually selected Qt style in KDE. It can be configured using ''KDE System Settings'' (''systemsettings''), the settings can be found in ''Common Appearance and Behavior > Application Appearance > Style > Widget Style''<br />
* In KDE Plasma 5, it uses Plastique.<br />
* In Cinnamon, GNOME, Xfce, it uses GTK+ ([[Uniform look for Qt and GTK applications#QGtkStyle|QGtkStyle]]).<br />
* In other desktop environments, it uses Windows.<br />
<br />
For those who want to change the look and feel of Qt4 application, the ''Qt Configuration'' (''qtconfig-qt4'') GUI tool is available. It offers a very simple configuration for the appearance of Qt4 applications that gives the user easy access to the current Qt Style, colors, fonts and other more advanced options.<br />
<br />
{{Note|If you use ''GTK+'' style, then color and font settings will be ignored, and inherited from GTK+ 2.}}<br />
<br />
Qt keeps all its configuration information in {{ic|/etc/xdg/Trolltech.conf}} (system-wide) or {{ic|~/.config/Trolltech.conf}} (user-specific). The file is rather difficult to navigate because it contains a lot of information not related to appearance, but for any changes you can just add to the end of the file and overwrite any previous values (make sure to add your modification under the [Qt] header).<br />
<br />
For example, to change the theme to QtCurve, add:<br />
{{hc|~/.config/Trolltech.conf|<nowiki><br />
...<br />
[Qt]<br />
style=QtCurve<br />
</nowiki>}}<br />
<br />
The following styles are included in Qt4: ''CDE'', ''Cleanlooks'', ''GTK+'', ''Motif'', ''Plastique'', ''Windows''. Others can be installed from the official repositories or the [[AUR]] (most are written for KDE Plasma Desktop):<br />
* {{App|Breeze|Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.|https://projects.kde.org/projects/kde/workspace/breeze|{{Pkg|breeze-kde4}}}}<br />
* {{App|[[Wikipedia:Oxygen Project|Oxygen]]|KDE Oxygen style.|https://projects.kde.org/projects/kde/workspace/oxygen|{{Pkg|oxygen-kde4}}}} or {{Pkg|kdebase-workspace}}<br />
* {{App|QtCurve|A configurable set of widget styles for KDE and Gtk.|https://projects.kde.org/projects/playground/base/qtcurve|{{Pkg|qtcurve-qt4}}}}<br />
* {{App|Phase|Widget style designed to be functional but not drab, and aesthetic but not distracting.|http://kde-look.org/content/show.php?content&#61;11402|{{Pkg|kdeartwork-styles}}}}<br />
* {{App|Skulpture|A GUI style addon for KDE and Qt programs that features a classical three dimensional artwork with shadows and smooth gradients to enhance the visual experience.|http://kde-look.org/content/show.php/?content&#61;59031|{{AUR|skulpture}}{{Broken package link|{{aur-mirror|skulpture}}}}}}<br />
* {{App|Bespin|A very configurable KDE theme.|http://cloudcity.sourceforge.net/frame.php|{{AUR|bespin-svn}}{{Broken package link|{{aur-mirror|bespin-svn}}}}}}<br />
<br />
=== Qt5 ===<br />
Qt5 decides the style to use based on what desktop environment is used:<br />
* In KDE Plasma 5, it uses the actually selected Qt style in KDE Plasma 5. It can be configured using ''KDE 5 System Settings'' (''systemsettings5''), the settings can be found in ''Appearance > Application Style > Widget Style''.<br />
* In KDE 4, it uses Oxygen (if available) or Fusion.<br />
* In Cinnamon, GNOME, MATE, LXDE, Xfce, it uses GTK+ ([[Uniform look for Qt and GTK applications#QGtkStyle|QGtkStyle]]).<br />
* In other desktop environments, it uses Fusion.<br />
<br />
To force a specific style, you can set the {{ic|QT_STYLE_OVERRIDE}} environment variable. Specifically, set it to {{ic|GTK+}} if you want to use the gtk theme. Qt5 applications also support the {{ic|-style}} flag, which you can use to launch a Qt5 application with a specific style.<br />
<br />
The following styles are included in Qt5: ''GTK+'', ''Fusion'', ''Windows''. Others can be installed from the official repositories:<br />
* {{App|Breeze|Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.|https://projects.kde.org/projects/kde/workspace/breeze|{{Pkg|breeze}}}}<br />
* {{App|Oxygen|KDE Oxygen style.|https://projects.kde.org/projects/kde/workspace/oxygen|{{Pkg|oxygen}}}}<br />
* {{App|QtCurve|A configurable set of widget styles for KDE and Gtk.|https://projects.kde.org/projects/playground/base/qtcurve|{{Pkg|qtcurve-qt5}}}}<br />
<br />
Like with {{ic|qtconfig-qt4}} for Qt4 apps, {{pkg|qt5ct}} can be used to customize the look and feel of Qt5 apps.<br />
<br />
=== Qt Style Sheets ===<br />
An interesting way of customizing the look and feel of a Qt application is using Style Sheets, which are just simple CSS files. Using Style Sheets, one can modify the appearance of every widget in the application.<br />
<br />
To run an application with a different style just execute:<br />
$ qt_application -stylesheet ''style.qss''<br />
<br />
For more information on Qt Style Sheets see the [http://doc.qt.io/qt-5/stylesheet-reference.html official documentation] or other [http://thesmithfam.org/blog/2009/09/10/qt-stylesheets-tutorial/ tutorials]. As an example Style Sheet see this [http://kde-apps.org/content/show.php/roxydoxy?content&#61;125979 Dolphin modification].<br />
<br />
=== GTK+ and Qt ===<br />
If you have GTK+ and Qt applications, their looks might not exactly blend in very well. If you wish to make your GTK+ styles match your Qt styles please read [[Uniform look for Qt and GTK applications]].<br />
<br />
=== Native KDE look for Qt apps under environments other than KDE ===<br />
<br />
Unlike Qt4, Qt5 doesn't ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running DE. In KDE or GNOME this works well, but in other less popular DEs or WM it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting <br />
{{ic|1=XDG_CURRENT_DESKTOP=KDE}} or {{ic|GNOME}}, and then using the corresponding configuration application to set the desired icon set.<br />
<br />
Another solution is provided by the {{pkg|qt5ct}} package, which provides a DE independent Qt5 QPA and a configuration utility. After installing the package, run {{ic|qt5ct}} to set an icon theme, and set the environment variable {{ic|1=QT_QPA_PLATFORMTHEME="qt5ct"}} so that the settings are picked up by Qt applications.<br />
<br />
== Development ==<br />
<br />
=== Supported platforms ===<br />
Qt supports most platforms that are available today, even some of the more obscure ones, with more ports appearing every once in a while. For a more complete list see the [[Wikipedia:Qt_(framework)#Platforms|Qt Wikipedia article]].<br />
<br />
=== Tools ===<br />
<br />
{{Expansion|missing references to Qt5 tools}}<br />
<br />
The following are official Qt tools:<br />
<br />
* {{App|[[Wikipedia:Qt Creator|Qt Creator]]|A cross-platform IDE tailored for Qt that supports all of its features.|http://qt-project.org/doc/qtcreator/|{{Pkg|qtcreator}}}}<br />
* {{App|Qt Linguist|A set of tools that speed the translation and internationalization of Qt applications.|http://qt-project.org/doc/qt-4.8/linguist-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Assistant|A configurable and redistributable documentation reader for Qt ''qch'' files.|http://qt-project.org/doc/qt-4.8/assistant-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Designer|A powerful cross-platform GUI layout and forms builder for Qt widgets.|http://qt-project.org/doc/qt-4.8/designer-manual.html|{{Pkg|qt4}}}}<br />
* {{App|Qt Quick Designer|A visual editor for QML files which supports WYSIWYG. It allows you to rapidly design and build Qt Quick applications and components from scratch.|http://qt-project.org/doc/qtcreator-2.8/creator-using-qt-quick-designer.html|{{Pkg|qtcreator}}}}<br />
* {{App|QML Viewer|A tool for loading QML documents that makes it easy to quickly develop and debug QML applications.|http://qt-project.org/doc/qt-4.8/qmlviewer.html|{{Pkg|qt4}}}}<br />
* {{App|[[Wikipedia:Qmake|qmake]]|A tool that helps simplify the build process for development project across different platforms, similar to [[Wikipedia:CMake|cmake]], but with fewer options and tailored for Qt applications.|https://qt-project.org/doc/qt-4.8/qmake-manual.html|{{Pkg|qt4}}}}<br />
* {{App|uic|A tool that reads ''*.ui'' XML files and generates the corresponding C++ files.|http://qt-project.org/doc/qt-4.8/uic.html|{{Pkg|qt4}}}}<br />
* {{App|rcc|A tool that is used to embed resources (such as pictures) into a Qt application during the build process. It works by generating a C++ source file containing data specified in a Qt resource (.qrc) file.|http://qt-project.org/doc/qt-4.8/rcc.html|{{Pkg|qt4}}}}<br />
* {{App|moc|A tool that handles Qt's C++ extensions (the signals and slots mechanism, the run-time type information, and the dynamic property system, etc.).|http://doc.qt.digia.com/4.7-snapshot/moc.html|{{Pkg|qt4}}}}<br />
<br />
=== Bindings ===<br />
Qt has bindings for all of the more popular languages, for a full list see [[Wikipedia:Qt (framework)#Programming language bindings|this list]].<br />
<br />
The following examples display a small 'Hello world!' message in a window.<br />
<br />
==== C++ ====<br />
* Package: <br />
** {{Pkg|qt4}} - Version 4.x of the Qt toolkit.<br />
** {{Pkg|qt5-base}} - Version 5.x of the Qt toolkit.<br />
* Website: http://qt-project.org/<br />
* Build: <br />
** The Qt4 version: {{ic|g++ $(pkg-config --cflags --libs QtGui) -o hello hello.cpp}}<br />
** The Qt5 version: {{ic|g++ $(pkg-config --cflags --libs Qt5Widgets) -o hello hello.cpp}}<br />
* Run with: {{ic|./hello}}<br />
{{hc|hello.cpp|<br />
#include <QApplication><br />
#include <QLabel><br />
<br />
int main(int argc, char **argv)<br />
{<br />
QApplication app(argc, argv);<br />
QLabel hello("Hello world!");<br />
<br />
hello.show();<br />
return app.exec();<br />
}<br />
}}<br />
<br />
==== QML ====<br />
* Package: {{Pkg|qt4}} or {{Pkg|qt5-declarative}}.<br />
* Website: http://qt-project.org/<br />
* Run with: {{ic|qmlviewer-qt4 hello.qml}} or {{ic|qmlscene-qt5 hello.qml}}<br />
{{hc|hello.qml|<br />
import QtQuick 1.0<br />
<br />
Rectangle {<br />
id: page<br />
width: 400; height: 100<br />
color: "lightgray"<br />
<br />
Text {<br />
id: helloText<br />
text: "Hello world!"<br />
anchors.horizontalCenter: page.horizontalCenter<br />
anchors.verticalCenter: page.verticalCenter<br />
font.pointSize: 24; font.bold: true<br />
}<br />
}<br />
}}<br />
{{Note|For version 5.x of the Qt toolkit, we need to import QtQuick 2.y.}}<br />
<br />
==== Python (PyQt) ====<br />
* Package:<br />
** {{Pkg|python-pyqt4}} - Python 3.x bindings for Qt 4<br />
** {{Pkg|python2-pyqt4}} - Python 2.x bindings for Qt 4<br />
** {{Pkg|python-pyqt5}} - Python 3.x bindings for Qt 5<br />
** {{Pkg|python2-pyqt5}} - Python 2.x bindings for Qt 5<br />
<br />
* Website: http://www.riverbankcomputing.co.uk/software/pyqt/intro<br />
* Run with: {{ic|python hello-pyqt.py}} or {{ic|python2 hello-pyqt.py}}.<br />
{{hc|hello-pyqt.py|<nowiki><br />
import sys<br />
from PyQt4 import QtGui<br />
<br />
app = QtGui.QApplication(sys.argv)<br />
label = QtGui.QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
The Qt 5.x version is slighly different:<br />
{{hc|hello-pyqt.py|<nowiki><br />
import sys<br />
from PyQt5 import QtWidgets<br />
<br />
app = QtWidgets.QApplication(sys.argv)<br />
label = QtWidgets.QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
==== Python (PySide) ====<br />
* Package:<br />
** {{Pkg|python-pyside}} - Python 3.x bindings<br />
** {{Pkg|python2-pyside}} - Python 2.x bindings<br />
* Website: http://www.pyside.org/<br />
* Run with: {{ic|python hello-pyside.py}} or {{ic|python2 hello-pyside.py}}<br />
{{hc|hello-pyside.py|<nowiki><br />
import sys<br />
from PySide.QtCore import *<br />
from PySide.QtGui import *<br />
<br />
app = QApplication(sys.argv)<br />
label = QLabel("Hello world!")<br />
<br />
label.show()<br />
sys.exit(app.exec_())</nowiki><br />
}}<br />
<br />
==== C# ====<br />
* Package: {{AUR|kdebindings-qyoto}}{{Broken package link|{{aur-mirror|kdebindings-qyoto}}}}<br />
* Website: http://techbase.kde.org/Development/Languages/Qyoto<br />
* Build with: {{ic|mcs -pkg:qyoto hello.cs}}<br />
* Run with: {{ic|mono hello.exe}}<br />
{{hc|hello.cs|<br />
using System;<br />
using Qyoto;<br />
<br />
public class Hello {<br />
public static int Main(String[] args) {<br />
new QApplication(args);<br />
new QLabel("Hello world!").Show();<br />
<br />
return QApplication.Exec();<br />
}<br />
}<br />
}}<br />
<br />
==== Ruby ====<br />
* Package: {{AUR|kdebindings-qtruby}}{{Broken package link|{{aur-mirror|kdebindings-qtruby}}}}<br />
* Website: http://rubyforge.org/projects/korundum/<br />
* Run with: {{ic|ruby hello.rb}}<br />
{{hc|hello.rb|<nowiki><br />
require 'Qt4'<br />
<br />
app = Qt::Application.new(ARGV)<br />
hello = Qt::Label.new('Hello World!')<br />
<br />
hello.show<br />
app.exec</nowiki><br />
}}<br />
==== Java ====<br />
* Package: {{AUR|qtjambi}}{{Broken package link|{{aur-mirror|qtjambi}}}} or {{AUR|qtjambi-beta}}{{Broken package link|{{aur-mirror|qtjambi-beta}}}}.<br />
* Website: http://qt-jambi.org/<br />
* Build with: {{ic|javac Hello.java -cp /opt/qtjambi-beta/qtjambi-linux64-community-4.7.0/qtjambi-4.7.0.jar}}.<br />
* Run with: {{ic|java -cp /opt/qtjambi-beta/qtjambi-linux64-community-4.7.0/qtjambi-4.7.0.jar:. Hello}}.<br />
{{hc|Hello.java|<nowiki><br />
import com.trolltech.qt.gui.*;<br />
<br />
public class Hello<br />
{<br />
public static void main(String args[])<br />
{<br />
QApplication.initialize(args);<br />
QLabel hello = new QLabel("Hello World!");<br />
<br />
hello.show();<br />
QApplication.exec();<br />
}<br />
}</nowiki><br />
}}<br />
{{Note|The build instructions and example have been tested on the beta version of Qt Jambi 4.7.0.}}<br />
<br />
==== Perl ====<br />
* Package: {{AUR|kdebindings-perlqt}}{{Broken package link|{{aur-mirror|kdebindings-perlqt}}}}<br />
* Website: http://code.google.com/p/perlqt4/<br />
* Run with: {{ic|perl hello.pl}}<br />
{{hc|hello.pl|<nowiki><br />
use QtGui4;<br />
<br />
my $a = Qt::Application(\@ARGV);<br />
my $hello = Qt::Label("Hello World!", undef);<br />
<br />
$hello->show;<br />
exit $a->exec;<br />
</nowiki><br />
}}<br />
==== Lua ====<br />
* Package: {{AUR|libqtlua}}{{Broken package link|{{aur-mirror|libqtlua}}}}<br />
* Website: http://www.nongnu.org/libqtlua/<br />
* Run with: {{ic|qtlua hello.lua}}<br />
{{hc|hello.lua|<nowiki><br />
label = qt.new_widget("QLabel")<br />
<br />
label:setText("Hello World!")<br />
label:show()</nowiki><br />
}}<br />
<br />
{{Note|QtLua is not designed to develop an application in pure Lua but rather to extend a Qt C++ application using Lua as scripting language.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Icon theme is not applied ===<br />
<br />
Since Qt 5.1 SVG support has moved into a module. Since {{Pkg|qt5-base}} does not depend on {{Pkg|qt5-svg}} it may happen that the {{Pkg|qt5-base}} is installed but not {{Pkg|qt5-svg}}. This results in deceptive icon theme behaviour. Since SVG is not supported the icons are silently skipped and the icon theme may seem to be unused. Installing {{Pkg|qt5-svg}} explicitly solves the problem.<br />
<br />
=== Qt4 style not respected ===<br />
<br />
If pure Qt4 (non-KDE) applications do not stick with your selected Qt4 style, then you'll probably need to tell Qt4 how to find KDE's styles (Oxygen, Phase etc.). You just need to set the environment variable QT_PLUGIN_PATH. E.g. put<br />
<br />
export QT_PLUGIN_PATH=$HOME/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/<br />
<br />
into your {{ic|/etc/profile}} (or {{ic|~/.profile}} if you do not have root access). {{ic|qtconfig-qt4}} should then be able to find your kde styles and everything should look nice again!<br />
<br />
Alternatively, you can symlink the Qt4 styles directory to the KDE4 styles one:<br />
# ln -s /usr/lib/{kde,qt}4/plugins/styles/[theme name]<br />
<br />
== Resources ==<br />
* [http://qt.io/ Official Website]<br />
* [http://doc.qt.io/ Qt Documentation]<br />
* [http://planet.qt.io/ Planet Qt]<br />
* [http://qt-apps.org/ Qt Applications]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Qt_for_Android&diff=407220Qt for Android2015-10-28T18:20:07Z<p>Trusktr: Created a stub page.</p>
<hr />
<div>This page is TODO.<br />
<br />
One way to currently get started, which doesn't follow Arch Linux standards, is to run the Qt for Android installer which can modify your system in a way that pacman will not track. The installer is at<br />
<br />
http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-android-5.5.1.run<br />
<br />
TODO: Make a package, qt-android, and describe setup and issues here.</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=396599MacBookPro11,x2015-08-30T07:55:07Z<p>Trusktr: /* MacBook Pro 11,5 */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|xf86-video-nouveau}} package seems to be stable. Switching to VTs and back works fine from MATE and GNOME. SOmetimes Chromium causes a "kernele rejected pixbuf" error which freezes the desktop.<br />
* The {{AUR|nvidia-dkms}} driver has been crashing a lot.<br />
* The {{Pkg|nvidia}} driver seems to be super stable, but GNOME desktop won't like to start, showing you a "Oh no! Something has gone wrong" message. Cinnamon Desktop is buttery smooth with the nvidia driver, and if you want your GNOME desktop, you can run `gnome-shell --relace &` while in cinnamon desktop to switch to Gnome Shell as a workaround.<br />
<br />
====== HiDPI ======<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
====== Xfce ======<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
====== lightdm ======<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
====== MATE ======<br />
<br />
MATE's Marco seems to have problems. Replace it with GNOME's Mutter for nice animated effects. This works best with the nouveau driver.<br />
<br />
# mutter --replace &&<br />
<br />
Or configure MATE to use Mutter in dconf...<br />
<br />
====== GNOME ======<br />
<br />
It all works great out of the box with the nouveau driver.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390701MacBookPro11,x2015-08-09T19:31:05Z<p>Trusktr: /* MacBook Pro 11,5 */ More details.</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|xf86-video-nouveau}} package seems to be stable. Switching to VTs and back works fine from MATE and GNOME.<br />
* The {{Pkg|nvidia}} and {{AUR|nvidia-dkms}} packages seem to be fairly unstable and crash a lot ({{AUR|nvidia-dkms}} is worse than {{Pkg|nvidia}}). You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver especially. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia}} package, but fails completely with the {{AUR|nvidia-dkms}} package.<br />
<br />
====== HiDPI ======<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
====== Xfce ======<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
====== lightdm ======<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
====== MATE ======<br />
<br />
MATE's Marco seems to have problems. Replace it with GNOME's Mutter for nice animated effects. This works best with the nouveau driver.<br />
<br />
# mutter --replace &&<br />
<br />
Or configure MATE to use Mutter in dconf...<br />
<br />
====== GNOME ======<br />
<br />
It all works great out of the box with the nouveau driver.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390588MacBookPro11,x2015-08-09T07:52:25Z<p>Trusktr: /* MacBook Pro 11,5 */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|nvidia}} and {{AUR|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia}} package, but fails completely with the {{AUR|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} package seems to be stable with MATE, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390587MacBookPro11,x2015-08-09T07:51:58Z<p>Trusktr: /* MacBook Pro 11,5 */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|nvidia}} and {{AUR|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia}} package, but fails completely with the {{AUR|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} package seems to be stable, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390586MacBookPro11,x2015-08-09T07:51:32Z<p>Trusktr: /* MacBook Pro 11,5 */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|nvidia}} and {{AUR|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia}} package, but fails completely with the {{AUR|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} packages seems to be stable, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390585MacBookPro11,x2015-08-09T07:49:59Z<p>Trusktr: /* MacBook Pro 11,4 */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,5 ======<br />
<br />
* The {{Pkg|nvidia}} and {{Pkg|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia package}}, but fails completely with the {{Pkg|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} packages seems to be stable, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390584MacBookPro11,x2015-08-09T07:49:37Z<p>Trusktr: /* Graphics */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
====== MacBook Pro 11,1 ======<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,2 ======<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
====== MacBook Pro 11,3 ======<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
====== MacBook Pro 11,4 ======<br />
<br />
* The {{Pkg|nvidia}} and {{Pkg|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia package}}, but fails completely with the {{Pkg|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} packages seems to be stable, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=390583MacBookPro11,x2015-08-09T07:48:09Z<p>Trusktr: /* Graphics */ Added 11,5 graphics details.</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
{{Style|This page flat-out ignores every possible [[Help:Style|style]] rule}}<br />
This wiki page should help you in getting your MacBook Pro from Late 2013 or Mid 2014 to work with Arch Linux. (This includes models 1-3 in the 11,x series).<br />
<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Dual booting with OS X may be desirable if you wish to update firmware. If this is the case, in order to carry out the installation you will need to shrink the main OS X HFS+ partition from within OS X's Disk Utility program, this will also move the OS X Recovery partition to the end of the OS X partition. <br />
<br />
{{note| Please note you may need to disable Filevault encryption before you can resize the partition, feel free to reinitialize this after you perform the partition resize}}<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
To begin your installation, download the current [[Archboot]] ISO and write it to your USB drive according to the [[USB flash installation media]] instructions. Boot from the created USB drive by selecting it in the Apple boot manager which is accessible by holding {{ic|Alt}} on power on.<br />
<br />
rEFIt and [[REFInd]] depending on how they are configured can also allow you to boot from the media.<br />
<br />
If the install media you are using has a kernel version earlier than 3.13 you will need to edit the boot entry in the syslinux boot loader. This can be accomplished by pressing {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} this will prevent visible screen corruption.<br />
<br />
If the install media you are using has a kernel version later than 3.13 '''do not''' use {{ic|nomodeset}} as it is not needed and will break [[VA-API]].<br />
<br />
=== Console ===<br />
<br />
As this model of notebook has a high DPI display, the console font displayed will be extremely small and depending on your preferences is likely to be uncomfortable to use. You may wish to change this for a more legible font, an example of which is;<br />
<br />
$ setfont sun12x22<br />
<br />
=== Internet ===<br />
<br />
==== Wired ====<br />
<br />
Thunderbolt Ethernet adapters and USB-to-Ethernet adapters should be picked up automatically. <br />
{{Note|You may have to power on the machine with the Thunderbolt Ethernet adapter plugged in for it to be picked up initially.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system. Note that it does have to be built against the exact same kernel version as used by the installer, and this may differ from the latest version. If built against the wrong kernel you may encounter an error ''(ERROR: could not insert 'wl': Invalid argument)'' upon modprobe. Build the package as follows:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using:<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice. <br />
<br />
{{Note|You need to repeat this process when you have finished your installation and booting into the system for the first time. If kernel versions differ, you may want to ensure to install a number of essential packages while you have connectivity and before you boot into your system , <br />
these allow you to build the broadcom driver again and connect (provided you put the AUR tarball for the driver on USB drive too):<br />
{{Pkg|dkms}},{{Pkg|wpa_supplicant}}, {{Pkg|dhcpcd}} ({{Pkg|dialog}} and {{Pkg|netctl}} are needed if you want to use {{ic|wifi-menu}} again after you boot)}}<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It is possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it is up to you).<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|1=<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
}}<br />
<br />
{{Note|It is possible to do the above modifications to/on the extra partition from within Linux (if you have installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it will not do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
See: [[UEFI_Bootloaders]]<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Do not forget to replace the angle brackets with your data.<br />
<br />
==== Direct EFI booting (gummiboot) ====<br />
<br />
See [[Beginners' guide#For_UEFI_motherboards]]<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You will need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
==== MacBook Pro 11,1 ====<br />
<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
==== MacBook Pro 11,2 ====<br />
<br />
* Intel works from 3.13.4-1-ARCH<br />
<br />
==== MacBook Pro 11,3 ====<br />
<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
==== MacBook Pro 11,4 ====<br />
<br />
* The {{Pkg|nvidia}} and {{Pkg|nvidia-dkms}} packages seem to be fairly unstable and crash a lot. You may not be able to start Gnome with either driver, and MATE crashes a lot with the dkms driver. Switching to linux terminals (f.e. ones using Kernel Mode Setting like kmscon) fails, and the screen goes blank (switching back to the desktop restores video only with the {{Pkg|nvidia package}}, but fails completely with the {{Pkg|nvidia-dkms}} package.<br />
* The {{Pkg|xf86-video-nouveau}} packages seems to be stable, but still no luck starting Gnome. Switching to VTs and back works fine.<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
If you are using lightdm on HiDPI/Retina screens you may experience a small login box<br />
, to use the native resolution of 2560x1600 on the login screen create a script<br />
<br />
#!/bin/sh<br />
xrandr --output eDP1 --primary --mode 2560x1600<br />
<br />
and set it as display-setup-script in /etc/lightdm/lightdm.conf<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function has not officially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt type 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
==== Alternative method to disable NVIDIA card ====<br />
<br />
While the above method for switching graphics works, there is a more effective method that does not require the use of gfxCardStatus or a patched GRUB installation (but it can be used if desired).<br />
<br />
First, the Intel GPU will not function without a patch called apple_set_os. You can either use a patched GRUB (as seen above) or use the apple_set_os.efi patch via rEFInd or chainload it via GRUB, the EFI patch can be download here, https://github.com/0xbb/apple_set_os.efi, this tricks the machine into thinking that it is booting a Mac OS X installation, making the hardware behave as such, allowing the Intel GPU to be used. rEFInd should automatically detect the patch as described on the application page. This will need to be loaded before each boot of Arch or else the Intel GPU will not function, to load it automatically it can be chainloaded via GRUB. Also, download and install the Intel drivers as described above.<br />
<br />
Then you will need to download an application called gpu-switch for switching the GPU on dual MacBook Pros, it is fairly easy to use as well. It can be downloaded from here, https://github.com/0xbb/gpu-switch.<br />
<br />
Secondly, once you have downloaded gpu-switch, extract the application to your home directory and open up a terminal emulator and cd to that directory. To switch to the Intel graphics, run <code>gpu-switch -i</code> as sudo, and the card will be active on reboot. Conversely, to enable the dedicated card instead, run <code>gpu-switch -d</code> as sudo. You must have booted with the aforementioned patch for this to work.<br />
<br />
Next, gpu-switch will not completely power down the dedicated card. To do that, you will have to create a custom grub menuentry and compile a program that will power off the dedicated card.<br />
<br />
To do that, please refer to the following article, [[MacBookPro10,x#Graphics_2]].<br />
<br />
You should now have working integrated graphics and the dedicated GPU should now power down. If you get a blank screen after doing this, wait and see what happens, if it stays blank for a prolonged period of time, try resetting the SMC, and then booting back into Arch.<br />
<br />
I noticed that afterwards VGA switcheroo disabled the nouveau driver, if this workaround still does not work, try installing a cronjob package, and adding the following:<br />
<br />
<br />
<code>@reboot echo OFF > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<code>@reboot echo IGD > /sys/kernel/debug/vgaswitcheroo/switch</code><br />
<br />
I'm not sure if the vgaswitcheroo commands actually do anything, I need somebody to test this workaround and let me know how it works for them.<br />
<br />
<br />
To see if you dedicated GPU is actually disabled, run:<br />
<br />
<code><br />
sudo cat /sys/kernel/debug/vgaswitcheroo/switch<br />
</code><br />
<br />
NOTICE: gpu-switch has been tested only on a select few models, those being MacBookPro9,1, MacBookPro10,1, and MacBookPro11,3. Use at your own risk.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
==== Ctrl-Click as Right-Click ====<br />
<br />
Using this SuperUser receipt [http://superuser.com/questions/217615/how-to-right-click-using-the-keyboard-from-ubuntu-on-a-mac] I got Ctrl-click working as right-click. I had to increase the sleep time to 0.1 though.<br />
<br />
==== input-mtrack ====<br />
<br />
Another method is to use xf86-input-mtrack-git [https://aur.archlinux.org/packages/xf86-input-mtrack-git/]. If you like to have a thumb resting on the touchpad, this driver is the right choice, because it has an option for IgnoreThumb.<br />
<br />
With this config the touchpad behavior becomes more osx-like.<br />
<br />
/etc/X11/xorg.conf.d/00-touchpad.conf<br />
<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "Touchpads"<br />
Driver "mtrack"<br />
Option "Sensitivity" "0.64"<br />
Option "FingerHigh" "5"<br />
Option "FingerLow" "1"<br />
Option "IgnoreThumb" "true"<br />
Option "IgnorePalm" "true"<br />
Option "DisableOnPalm" "true"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "TapButton4" "0"<br />
Option "ClickFinger1" "1"<br />
Option "ClickFinger2" "2"<br />
Option "ClickFinger3" "3"<br />
Option "ButtonMoveEmulate" "false"<br />
Option "ButtonIntegrated" "true"<br />
Option "ClickTime" "25"<br />
Option "BottomEdge" "30"<br />
Option "SwipeLeftButton" "8"<br />
Option "SwipeRightButton" "9"<br />
Option "SwipeUpButton" "0"<br />
Option "SwipeDownButton" "0"<br />
Option "ScrollDistance" "75"<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE controlling the backlight with the increase or decrease brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen does not show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works from Linux 3.13<br />
** It may be necessary to disable USB's wakeup ability by by echoing 'XHC1' to '/proc/acpi/wakeup' in order to prevent immediate wakeup on suspend.<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
=== Powersave ===<br />
<br />
Disabling the internal cardreader and bluetooth controller may save battery life. When not using them, create the following [[udev]] rules:<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_cardreader.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8406", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8406"<br />
}}<br />
<br />
{{hc|1=/etc/udev/rules.d/99-apple_broadcom_bcm2046_bluetooth.rules|2=<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8289", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 05ac 8289"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="4500", RUN+="/usr/local/sbin/remove_ignore_usb-device.sh 0a5c 4500"<br />
}}<br />
<br />
As udev's {{ic|1=OPTIONS=="ignore_device"}} may not work reliably, the above rules use [https://gist.github.com/anonymous/9c9d45c4818e3086ceca a script] to manually remove the usb device from {{ic|/sys/bus/usb/devices/}}.<br />
<br />
If battery life is not satisfactory, it may help to use power saving utilities, such as {{Pkg|tlp}}, and/or {{Pkg|powertop}} from the official repositories. To better optimize battery life, TLP also has a configuration file located at {{ic|/etc/default/tlp}} that you can edit to suit your machine. For more information, visit the wiki pages for these tools, [[TLP]] and [[Powertop]], respectively.<br />
<br />
=== SD Card Reader ===<br />
<br />
* Disappears sporadically after suspend as of Linux 3.18. Workaround is to create {{ic|/etc/modprobe.d/xhci-reset-on-suspend.conf}} with:<br />
# Reset XHCI USB devices on suspend/resume, fixes SD Card reader vanishing after suspend <br />
options xhci_hcd quirks=0x80<br />
<br />
Note: As of Linux 3.18.6-1 (and possibly earlier versions post-3.18), this fix '''may''' not be needed and might cause issues ranging from failed suspend to the SD card not being recognized at all. Test with and without the fix to determine which works best for you.<br />
<br />
=== Repurpose the power key ===<br />
<br />
By default systemd handles the rMBPs power key as defined in /etc/systemd/logind.conf. By setting<br />
HandlePowerKey=ignore<br />
systemd ignores power key events.<br />
<br />
Now the power key can be repurposed as keycode 124. For example in i3 conf:<br />
bindcode 124 ...<br />
<br />
== What does not work ==<br />
<br />
Updated 2015-04-08<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some, look at [[Broadcom wireless]] for possible fixes (e.g. downgrading kernel works if your card is BCM4360)<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
** When the apple_set_os grub patch is used with a 11,3 machine lspci reports; 04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
* Efforts to develop a reverse engineered driver: https://github.com/patjak/bcwc_pcie/<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=GNU_Screen&diff=324121GNU Screen2014-07-09T01:04:53Z<p>Trusktr: /* Use 256 colors */</p>
<hr />
<div>[[Category:System administration]]<br />
[[ru:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
{{Related articles start}}<br />
{{Related|tmux}}<br />
{{Related articles end}}<br />
[http://www.gnu.org/s/screen/ GNU Screen] is a wrapper that allows separation between the text program and the shell from which it was launched. This allows the user to, for example, start a text program in a terminal in X, kill X, and continue to interact with the program. Here are a couple of tips and tricks you may be interested in.<br />
<br />
== Installation ==<br />
<br />
GNU Screen can be [[pacman|installed]] using the {{pkg|screen}} package found in the [[official repositories]].<br />
<br />
== Usage == <br />
Commands are entered pressing {{ic|ctrl+a}} and then the key binding.<br />
<br />
=== Common Commands ===<br />
* {{ic|ctrl+a}} {{ic|?}} Displays commands and its defaults (VERY important)<br />
* {{ic|ctrl+a}} {{ic|:}} Enter to the command prompt of screen<br />
* {{ic|ctrl+a}} {{ic|"}} Window list<br />
* {{ic|ctrl+a}} {{ic|0}} opens window 0<br />
* {{ic|ctrl+a}} {{ic|A}} Rename the current window<br />
* {{ic|ctrl+a}} {{ic|a}} Sends {{ic|ctrl+a}} to the current window<br />
* {{ic|ctrl+a}} {{ic|c}} Create a new window (with shell)<br />
* {{ic|ctrl+a}} {{ic|S}} Split current region into two regions<br />
* {{ic|ctrl+a}} {{ic|tab}} Switch the input focus to the next region<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Toggle between current and previous region<br />
* {{ic|ctrl+a}} {{ic|Esc}} Enter Copy Mode (use enter to select a range of text)<br />
* {{ic|ctrl+a}} {{ic|]}} Paste text<br />
* {{ic|ctrl+a}} {{ic|Q}} Close all regions but the current one<br />
* {{ic|ctrl+a}} {{ic|X}} Close the current region<br />
* {{ic|ctrl+a}} {{ic|d}} Detach from the current screen session, and leave it running. Use {{ic|screen -r}} to resume<br />
<br />
=== Command Prompt Commands ===<br />
* {{ic|ctrl+a}} {{ic|:quit}} Closes all windows and closes screen session<br />
* {{ic|ctrl+a}} {{ic|:source ~/.screenrc}} Reloads screenrc configuration file (can alternatively use /etc/screenrc)<br />
<br />
=== Named sessions ===<br />
To create a named session, run screen with the following command:<br />
$ screen -S ''session_name''<br />
<br />
To prints a list of ''pid.tty.host'' strings identifying your screen sessions:<br />
$ screen -list<br />
<br />
To attach to a named screen session, run this command:<br />
$ screen -x ''session_name''<br />
<br />
=== Autostart with systemd ===<br />
<br />
This service autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
=== Change the escape key ===<br />
The escape key can be changed with the {{ic|escape}} option in {{ic|~/.screenrc}}. For example:<br />
{{bc|escape ``}}<br />
sets the escape key to {{ic|`}} and<br />
{{bc|escape ^^^}}<br />
sets it to {{ic|ctrl+^}}.<br />
<br />
=== Start at window 1 ===<br />
By default, the first screen window is 0. If you'd rather never have a window 0 and start instead with 1, add the following lines on your configuration:<br />
{{hc|~/.screenrc|<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
}}<br />
=== Nested Screen Sessions ===<br />
It is possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to {{ic|ctrl+a}} commands. To send a command to the inner screen session, use {{ic|ctrl+a}} {{ic|a}}, followed by your command. For example:<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|d}} Detaches the inner screen session.<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|K}} Kills the inner screen session.<br />
<br />
=== Use 256 colors ===<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
{{hc|~/.screenrc|<br />
term screen-256color<br />
}}<br />
<br />
If that doesn't work, try:<br />
{{hc|~/.screenrc|<br />
term xterm-256color<br />
}}<br />
<br />
If one of those two still fail to render 256 colors in [[xterm]], try the following instead:<br />
{{hc|~/.screenrc|<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
If all of those still fail, why not try combining them?<br />
{{hc|~/.screenrc|<br />
term xterm-256color<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
=== Use 256 Colors with Rxvt-Unicode (urxvt) ===<br />
If you are using {{pkg|rxvt-unicode}} from the [[official repositories]], you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
{{hc|~/.screenrc|<nowiki><br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
</nowiki>}}<br />
<br />
=== Informative statusbar ===<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
{{hc|~/.screenrc|<nowiki><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
</nowiki>}}<br />
=== Turn welcome message off ===<br />
{{hc|~/.screenrc|<br />
startup_message off<br />
}}<br />
<br />
=== Turn your hardstatus line into a dynamic urxvt|xterm|aterm window title ===<br />
This one is pretty simple; just switch your current {{ic|hardstatus}} line into a {{ic|caption}} line with notification, and edit accordingly:<br />
{{hc|~/.screenrc|<nowiki><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</nowiki>}}<br />
<br />
This will give you something like {{ic|screen (0 bash)}} in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
===Use X scrolling mechanism===<br />
The scroll buffer of GNU Screen can be accessed with {{ic|ctrl+a}} {{ic|[}}. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line:<br />
{{hc|~/.screenrc|<br />
termcapinfo xterm* ti@:te@<br />
}}<br />
<br />
=== Attach an existing running program to screen ===<br />
If you started a program outside screen, but now you would like it to be inside, you can use '''reptyr''' to reparent the process from it's current tty to one inside screen.<br />
<br />
[[Pacman|Install]] the package {{Pkg|reptyr}} from the [[official repositories]]. <br />
<br />
Get the PID of the process (you can use {{ic|ps ax}} for that). Now just enter the PID as argument to reptyr inside a screen window.<br />
{{bc|$ reptyr ''<pid>''}}<br />
<br />
===Add a GRUB entry to boot into Screen===<br />
{{Out of date|[https://www.archlinux.org/news/end-of-initscripts-support/ Initscripts] is deprecated, and the use of runlevels as well. Also, this instructions are for legacy GRUB}}<br />
If you mostly use [[Xorg|X]] but occasionally want to run a Screen-as-window-manager session, here is one way to do it by adding a [[GRUB]] entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we will use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a {{ic|4}} to the kernel boot parameters list, like so:<br />
{{bc|1=<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
}}<br />
<br />
Add some entries to {{ic|/etc/inittab}} to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
{{bc|# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
}}<br />
<br />
The above line uses {{AUR|mingetty}} to [[automatically login some user to a virtual console on startup]]. The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which is not used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We will need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove {{ic|4}} from the the first of the agetty lines:<br />
<br />
{{bc|c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux}}<br />
<br />
Once we are logged in, we want to ensure that screen is started. Add the following to the end of your {{ic|~/.bash_profile}}:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
</nowiki>}}<br />
This checks for the current runlevel and will launch a screen session immediately after the automatic login if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This checks to see if we are on virtual console 3:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</nowiki>}}<br />
Set inittab/mingetty to automatically log in to vc/3 on runlevel 5 and you are set.<br />
<br />
===Setting a different bash prompt while in screen===<br />
If you want a different bash prompt when in a screen session, add the following to your .bashrc:<br />
{{bc|<nowiki><br />
if [ -z $STY ]<br />
then<br />
PS1="YOUR REGULAR PROMPT"<br />
else <br />
PS1="YOUR SCREEN PROMPT"<br />
fi<br />
</nowiki>}}<br />
[http://serverfault.com/questions/257975/how-to-check-if-im-in-screen-session]<br />
<br />
===Turn off visual bell===<br />
With this setting, screen will not make an ugly screen flash instead of a bell sound.<br />
{{hc|~/.screenrc|<br />
vbell off<br />
}}<br />
<br />
== Troubleshooting ==<br />
=== Fix Midnight Commander hard hang when starting in screen ===<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Fix for residual editor text ===<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following:<br />
{{hc|~/.screenrc|<br />
altscreen on<br />
}}<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[Ratpoison|Ratpoison - A window manager based on gnu screen]]<br />
* [[Xpra|Xpra - An utility to detach/reattach X programs, in a way similar as screen does for command line based programs]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=GNU_Screen&diff=324120GNU Screen2014-07-09T01:04:23Z<p>Trusktr: /* Use 256 colors */</p>
<hr />
<div>[[Category:System administration]]<br />
[[ru:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
{{Related articles start}}<br />
{{Related|tmux}}<br />
{{Related articles end}}<br />
[http://www.gnu.org/s/screen/ GNU Screen] is a wrapper that allows separation between the text program and the shell from which it was launched. This allows the user to, for example, start a text program in a terminal in X, kill X, and continue to interact with the program. Here are a couple of tips and tricks you may be interested in.<br />
<br />
== Installation ==<br />
<br />
GNU Screen can be [[pacman|installed]] using the {{pkg|screen}} package found in the [[official repositories]].<br />
<br />
== Usage == <br />
Commands are entered pressing {{ic|ctrl+a}} and then the key binding.<br />
<br />
=== Common Commands ===<br />
* {{ic|ctrl+a}} {{ic|?}} Displays commands and its defaults (VERY important)<br />
* {{ic|ctrl+a}} {{ic|:}} Enter to the command prompt of screen<br />
* {{ic|ctrl+a}} {{ic|"}} Window list<br />
* {{ic|ctrl+a}} {{ic|0}} opens window 0<br />
* {{ic|ctrl+a}} {{ic|A}} Rename the current window<br />
* {{ic|ctrl+a}} {{ic|a}} Sends {{ic|ctrl+a}} to the current window<br />
* {{ic|ctrl+a}} {{ic|c}} Create a new window (with shell)<br />
* {{ic|ctrl+a}} {{ic|S}} Split current region into two regions<br />
* {{ic|ctrl+a}} {{ic|tab}} Switch the input focus to the next region<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Toggle between current and previous region<br />
* {{ic|ctrl+a}} {{ic|Esc}} Enter Copy Mode (use enter to select a range of text)<br />
* {{ic|ctrl+a}} {{ic|]}} Paste text<br />
* {{ic|ctrl+a}} {{ic|Q}} Close all regions but the current one<br />
* {{ic|ctrl+a}} {{ic|X}} Close the current region<br />
* {{ic|ctrl+a}} {{ic|d}} Detach from the current screen session, and leave it running. Use {{ic|screen -r}} to resume<br />
<br />
=== Command Prompt Commands ===<br />
* {{ic|ctrl+a}} {{ic|:quit}} Closes all windows and closes screen session<br />
* {{ic|ctrl+a}} {{ic|:source ~/.screenrc}} Reloads screenrc configuration file (can alternatively use /etc/screenrc)<br />
<br />
=== Named sessions ===<br />
To create a named session, run screen with the following command:<br />
$ screen -S ''session_name''<br />
<br />
To prints a list of ''pid.tty.host'' strings identifying your screen sessions:<br />
$ screen -list<br />
<br />
To attach to a named screen session, run this command:<br />
$ screen -x ''session_name''<br />
<br />
=== Autostart with systemd ===<br />
<br />
This service autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
=== Change the escape key ===<br />
The escape key can be changed with the {{ic|escape}} option in {{ic|~/.screenrc}}. For example:<br />
{{bc|escape ``}}<br />
sets the escape key to {{ic|`}} and<br />
{{bc|escape ^^^}}<br />
sets it to {{ic|ctrl+^}}.<br />
<br />
=== Start at window 1 ===<br />
By default, the first screen window is 0. If you'd rather never have a window 0 and start instead with 1, add the following lines on your configuration:<br />
{{hc|~/.screenrc|<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
}}<br />
=== Nested Screen Sessions ===<br />
It is possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to {{ic|ctrl+a}} commands. To send a command to the inner screen session, use {{ic|ctrl+a}} {{ic|a}}, followed by your command. For example:<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|d}} Detaches the inner screen session.<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|K}} Kills the inner screen session.<br />
<br />
=== Use 256 colors ===<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
{{hc|~/.screenrc|<br />
term screen-256color<br />
}}<br />
<br />
If that doesn't work, try:<br />
{{hc|~/.screenrc|<br />
term xterm-256color<br />
}}<br />
<br />
If one of those two still fail to render 256 colors in [[xterm]], try the following instead:<br />
{{hc|~/.screenrc|<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
If all of those still fail, try combining them:<br />
{{hc|~/.screenrc|<br />
term xterm-256color<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
Ahhh. Computer scientific experiments.<br />
<br />
=== Use 256 Colors with Rxvt-Unicode (urxvt) ===<br />
If you are using {{pkg|rxvt-unicode}} from the [[official repositories]], you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
{{hc|~/.screenrc|<nowiki><br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
</nowiki>}}<br />
<br />
=== Informative statusbar ===<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
{{hc|~/.screenrc|<nowiki><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
</nowiki>}}<br />
=== Turn welcome message off ===<br />
{{hc|~/.screenrc|<br />
startup_message off<br />
}}<br />
<br />
=== Turn your hardstatus line into a dynamic urxvt|xterm|aterm window title ===<br />
This one is pretty simple; just switch your current {{ic|hardstatus}} line into a {{ic|caption}} line with notification, and edit accordingly:<br />
{{hc|~/.screenrc|<nowiki><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</nowiki>}}<br />
<br />
This will give you something like {{ic|screen (0 bash)}} in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
===Use X scrolling mechanism===<br />
The scroll buffer of GNU Screen can be accessed with {{ic|ctrl+a}} {{ic|[}}. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line:<br />
{{hc|~/.screenrc|<br />
termcapinfo xterm* ti@:te@<br />
}}<br />
<br />
=== Attach an existing running program to screen ===<br />
If you started a program outside screen, but now you would like it to be inside, you can use '''reptyr''' to reparent the process from it's current tty to one inside screen.<br />
<br />
[[Pacman|Install]] the package {{Pkg|reptyr}} from the [[official repositories]]. <br />
<br />
Get the PID of the process (you can use {{ic|ps ax}} for that). Now just enter the PID as argument to reptyr inside a screen window.<br />
{{bc|$ reptyr ''<pid>''}}<br />
<br />
===Add a GRUB entry to boot into Screen===<br />
{{Out of date|[https://www.archlinux.org/news/end-of-initscripts-support/ Initscripts] is deprecated, and the use of runlevels as well. Also, this instructions are for legacy GRUB}}<br />
If you mostly use [[Xorg|X]] but occasionally want to run a Screen-as-window-manager session, here is one way to do it by adding a [[GRUB]] entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we will use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a {{ic|4}} to the kernel boot parameters list, like so:<br />
{{bc|1=<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
}}<br />
<br />
Add some entries to {{ic|/etc/inittab}} to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
{{bc|# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
}}<br />
<br />
The above line uses {{AUR|mingetty}} to [[automatically login some user to a virtual console on startup]]. The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which is not used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We will need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove {{ic|4}} from the the first of the agetty lines:<br />
<br />
{{bc|c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux}}<br />
<br />
Once we are logged in, we want to ensure that screen is started. Add the following to the end of your {{ic|~/.bash_profile}}:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
</nowiki>}}<br />
This checks for the current runlevel and will launch a screen session immediately after the automatic login if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This checks to see if we are on virtual console 3:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</nowiki>}}<br />
Set inittab/mingetty to automatically log in to vc/3 on runlevel 5 and you are set.<br />
<br />
===Setting a different bash prompt while in screen===<br />
If you want a different bash prompt when in a screen session, add the following to your .bashrc:<br />
{{bc|<nowiki><br />
if [ -z $STY ]<br />
then<br />
PS1="YOUR REGULAR PROMPT"<br />
else <br />
PS1="YOUR SCREEN PROMPT"<br />
fi<br />
</nowiki>}}<br />
[http://serverfault.com/questions/257975/how-to-check-if-im-in-screen-session]<br />
<br />
===Turn off visual bell===<br />
With this setting, screen will not make an ugly screen flash instead of a bell sound.<br />
{{hc|~/.screenrc|<br />
vbell off<br />
}}<br />
<br />
== Troubleshooting ==<br />
=== Fix Midnight Commander hard hang when starting in screen ===<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Fix for residual editor text ===<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following:<br />
{{hc|~/.screenrc|<br />
altscreen on<br />
}}<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[Ratpoison|Ratpoison - A window manager based on gnu screen]]<br />
* [[Xpra|Xpra - An utility to detach/reattach X programs, in a way similar as screen does for command line based programs]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=GNU_Screen&diff=324119GNU Screen2014-07-09T01:03:06Z<p>Trusktr: /* Use 256 colors */</p>
<hr />
<div>[[Category:System administration]]<br />
[[ru:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
{{Related articles start}}<br />
{{Related|tmux}}<br />
{{Related articles end}}<br />
[http://www.gnu.org/s/screen/ GNU Screen] is a wrapper that allows separation between the text program and the shell from which it was launched. This allows the user to, for example, start a text program in a terminal in X, kill X, and continue to interact with the program. Here are a couple of tips and tricks you may be interested in.<br />
<br />
== Installation ==<br />
<br />
GNU Screen can be [[pacman|installed]] using the {{pkg|screen}} package found in the [[official repositories]].<br />
<br />
== Usage == <br />
Commands are entered pressing {{ic|ctrl+a}} and then the key binding.<br />
<br />
=== Common Commands ===<br />
* {{ic|ctrl+a}} {{ic|?}} Displays commands and its defaults (VERY important)<br />
* {{ic|ctrl+a}} {{ic|:}} Enter to the command prompt of screen<br />
* {{ic|ctrl+a}} {{ic|"}} Window list<br />
* {{ic|ctrl+a}} {{ic|0}} opens window 0<br />
* {{ic|ctrl+a}} {{ic|A}} Rename the current window<br />
* {{ic|ctrl+a}} {{ic|a}} Sends {{ic|ctrl+a}} to the current window<br />
* {{ic|ctrl+a}} {{ic|c}} Create a new window (with shell)<br />
* {{ic|ctrl+a}} {{ic|S}} Split current region into two regions<br />
* {{ic|ctrl+a}} {{ic|tab}} Switch the input focus to the next region<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Toggle between current and previous region<br />
* {{ic|ctrl+a}} {{ic|Esc}} Enter Copy Mode (use enter to select a range of text)<br />
* {{ic|ctrl+a}} {{ic|]}} Paste text<br />
* {{ic|ctrl+a}} {{ic|Q}} Close all regions but the current one<br />
* {{ic|ctrl+a}} {{ic|X}} Close the current region<br />
* {{ic|ctrl+a}} {{ic|d}} Detach from the current screen session, and leave it running. Use {{ic|screen -r}} to resume<br />
<br />
=== Command Prompt Commands ===<br />
* {{ic|ctrl+a}} {{ic|:quit}} Closes all windows and closes screen session<br />
* {{ic|ctrl+a}} {{ic|:source ~/.screenrc}} Reloads screenrc configuration file (can alternatively use /etc/screenrc)<br />
<br />
=== Named sessions ===<br />
To create a named session, run screen with the following command:<br />
$ screen -S ''session_name''<br />
<br />
To prints a list of ''pid.tty.host'' strings identifying your screen sessions:<br />
$ screen -list<br />
<br />
To attach to a named screen session, run this command:<br />
$ screen -x ''session_name''<br />
<br />
=== Autostart with systemd ===<br />
<br />
This service autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
=== Change the escape key ===<br />
The escape key can be changed with the {{ic|escape}} option in {{ic|~/.screenrc}}. For example:<br />
{{bc|escape ``}}<br />
sets the escape key to {{ic|`}} and<br />
{{bc|escape ^^^}}<br />
sets it to {{ic|ctrl+^}}.<br />
<br />
=== Start at window 1 ===<br />
By default, the first screen window is 0. If you'd rather never have a window 0 and start instead with 1, add the following lines on your configuration:<br />
{{hc|~/.screenrc|<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
}}<br />
=== Nested Screen Sessions ===<br />
It is possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to {{ic|ctrl+a}} commands. To send a command to the inner screen session, use {{ic|ctrl+a}} {{ic|a}}, followed by your command. For example:<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|d}} Detaches the inner screen session.<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|K}} Kills the inner screen session.<br />
<br />
=== Use 256 colors ===<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
{{hc|~/.screenrc|<br />
term screen-256color<br />
}}<br />
<br />
If that doesn't work, try:<br />
{{hc|~/.screenrc|<br />
term xterm-256color<br />
}}<br />
<br />
If this fails to render 256 colors in [[xterm]], try the following instead:<br />
{{hc|~/.screenrc|<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
If all that still fails, try combining the two methods:<br />
{{hc|~/.screenrc|<br />
term xterm-256color<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
=== Use 256 Colors with Rxvt-Unicode (urxvt) ===<br />
If you are using {{pkg|rxvt-unicode}} from the [[official repositories]], you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
{{hc|~/.screenrc|<nowiki><br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
</nowiki>}}<br />
<br />
=== Informative statusbar ===<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
{{hc|~/.screenrc|<nowiki><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
</nowiki>}}<br />
=== Turn welcome message off ===<br />
{{hc|~/.screenrc|<br />
startup_message off<br />
}}<br />
<br />
=== Turn your hardstatus line into a dynamic urxvt|xterm|aterm window title ===<br />
This one is pretty simple; just switch your current {{ic|hardstatus}} line into a {{ic|caption}} line with notification, and edit accordingly:<br />
{{hc|~/.screenrc|<nowiki><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</nowiki>}}<br />
<br />
This will give you something like {{ic|screen (0 bash)}} in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
===Use X scrolling mechanism===<br />
The scroll buffer of GNU Screen can be accessed with {{ic|ctrl+a}} {{ic|[}}. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line:<br />
{{hc|~/.screenrc|<br />
termcapinfo xterm* ti@:te@<br />
}}<br />
<br />
=== Attach an existing running program to screen ===<br />
If you started a program outside screen, but now you would like it to be inside, you can use '''reptyr''' to reparent the process from it's current tty to one inside screen.<br />
<br />
[[Pacman|Install]] the package {{Pkg|reptyr}} from the [[official repositories]]. <br />
<br />
Get the PID of the process (you can use {{ic|ps ax}} for that). Now just enter the PID as argument to reptyr inside a screen window.<br />
{{bc|$ reptyr ''<pid>''}}<br />
<br />
===Add a GRUB entry to boot into Screen===<br />
{{Out of date|[https://www.archlinux.org/news/end-of-initscripts-support/ Initscripts] is deprecated, and the use of runlevels as well. Also, this instructions are for legacy GRUB}}<br />
If you mostly use [[Xorg|X]] but occasionally want to run a Screen-as-window-manager session, here is one way to do it by adding a [[GRUB]] entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we will use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a {{ic|4}} to the kernel boot parameters list, like so:<br />
{{bc|1=<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
}}<br />
<br />
Add some entries to {{ic|/etc/inittab}} to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
{{bc|# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
}}<br />
<br />
The above line uses {{AUR|mingetty}} to [[automatically login some user to a virtual console on startup]]. The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which is not used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We will need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove {{ic|4}} from the the first of the agetty lines:<br />
<br />
{{bc|c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux}}<br />
<br />
Once we are logged in, we want to ensure that screen is started. Add the following to the end of your {{ic|~/.bash_profile}}:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
</nowiki>}}<br />
This checks for the current runlevel and will launch a screen session immediately after the automatic login if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This checks to see if we are on virtual console 3:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</nowiki>}}<br />
Set inittab/mingetty to automatically log in to vc/3 on runlevel 5 and you are set.<br />
<br />
===Setting a different bash prompt while in screen===<br />
If you want a different bash prompt when in a screen session, add the following to your .bashrc:<br />
{{bc|<nowiki><br />
if [ -z $STY ]<br />
then<br />
PS1="YOUR REGULAR PROMPT"<br />
else <br />
PS1="YOUR SCREEN PROMPT"<br />
fi<br />
</nowiki>}}<br />
[http://serverfault.com/questions/257975/how-to-check-if-im-in-screen-session]<br />
<br />
===Turn off visual bell===<br />
With this setting, screen will not make an ugly screen flash instead of a bell sound.<br />
{{hc|~/.screenrc|<br />
vbell off<br />
}}<br />
<br />
== Troubleshooting ==<br />
=== Fix Midnight Commander hard hang when starting in screen ===<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Fix for residual editor text ===<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following:<br />
{{hc|~/.screenrc|<br />
altscreen on<br />
}}<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[Ratpoison|Ratpoison - A window manager based on gnu screen]]<br />
* [[Xpra|Xpra - An utility to detach/reattach X programs, in a way similar as screen does for command line based programs]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Talk:Mac&diff=322838Talk:Mac2014-07-02T20:40:15Z<p>Trusktr: /* EFI bootloader */</p>
<hr />
<div>== Personal feedback ==<br />
Hi. I've spent a lot of time to install Arch on a Macbook 1.1, and I've fixed several issues that can be of real interest for other people...<br />
<br />
First, my hard drive was brand new, and I wanted a pure EFI boot. Moreover, my CDROM drive is dead, so I had to boot Arch install from a live USB. To do so, I've used a rEFIt usbkey. Then, after the standard Arch install, I've made a HFS+ partition for the *.efi grub2 have generated. Finally, I've bless-ed those files with OsX from another computer, so that my new install can boot without rEFIt.<br />
<br />
My second issue was the keyboard mapping. I was forced to make a new console keymap from scratch to get all my keys working "apple-style". Not a big deal. For xorg, it was a bit more difficult. I've specified a "macbook79" keyboard in evdev xorg config file, and I've added the following lines at the end of /usr/share/X11/xkb/keycodes/evdev :<br />
<br />
xkb_keycodes "macbook79" {<br />
include "evdev(evdev)"<br />
<RALT> = 64;<br />
<LALT> = 133;<br />
};<br />
<br />
And the new following rule to /usr/share/X11/xkb/rules/evdev (just after line 118) :<br />
macbook79 = evdev(macbook79)<br />
<br />
This allows to have key combinations such as ALT+5 working, leading to a "{" symbol... without using dirty Xmodmap tricks. Since Mod1 (LALT) is used a lot, I've decided to map it to the left Option key, but you can choose another key.<br />
<br />
== Major Edit ==<br />
Hi all, I'm working on a major edit for this page. It seems to me that a lot of this article can be made a little more clear, so I'm taking a go at it. I have already changed a few sections. It will probably take me a couple days to finish everything, so let me know what you think as time progresses.<br />
<br />
--[[User:Arcanazar|Arcanazar]] 20:37, 16 July 2009 (EDT)<br />
<br />
I'm helping you <br />
<br />
After this i test it .....<br />
<br />
and fix, add, cancel bugged parts <br />
<br />
--[[User:NTia89|nTia89]] 13:21, 17 July 2009 (EDT)<br />
<br />
=== Partition Section ===<br />
This section is a mess. I think that we should just find the fastest way to partition the hard drive, with a preference to tools on the Arch Linux install disk (as long as the work). Having multiple ways of creating the partitions seems confusing. I recommend using <tt>parted</tt> as it is part of Arch and can handle GPT format hard drives. --[[User:Arcanazar|Arcanazar]] 13:36, 17 July 2009 (EDT)<br />
<br />
== RE ==<br />
<br />
yes i think<br />
i think also that we can completely delete triple boot section and even the dual boot section redirecting users who wants dual boot to another guide like Ubuntu<br />
i think this because Archlinux users are experience users and precisely for this we can write a short partition section<br />
<br />
--[[User:NTia89|nTia89]] 15:00, 17 July 2009 (EDT)<br />
<br />
on the dual boot section ew can only write what they must do but NOT how<br />
example<br />
# install refit<br />
# partition disk with .....<br />
# install arch | and when you install grub select to install in the /boot NOT in /dev/sda<br />
<br />
== wiFi section ==<br />
<br />
needs to be reworked<br />
<br />
--[[User:NTia89|nTia89]] 16:49, 17 July 2009 (EDT)<br />
<br />
What is wrong with the Wifi section? I have a first-gen MacBook and wireless works out of the box for me.<br />
--[[User:Arcanazar|Arcanazar]] 16:54, 17 July 2009 (EDT)<br />
<br />
nothing is wrong, only needs a reorganization<br />
<br />
NOW is OK<br />
<br />
--[[User:NTia89|nTia89]] 06:33, 18 July 2009 (EDT)<br />
<br />
2.6.37 has the broadcom-wl drivers built in as the module brcm80211 -- we'll have to see if the packaged kernel enables it. If they work under macs, we could probably edit the wifi section. [[User:Telkkar|Telkkar]] 12:26, 6 January 2011 (EST)<br />
<br />
Updated the Wifi section to include a tip about out of the box support in kernel 2.6.32.35-1 for Macbook Pro 6.2 generation, and changed the instructions to point to the [[Broadcom wireless]] page rather than links to the driver itself (since the broadcom page includes all this information).<br />
--[[User:Fourisfive|fourisfive]] 21:18, 24 March 2011 (EDT)<br />
<br />
== new macbook note ==<br />
<br />
needs to be putted in begin of the page , first of all<br />
<br />
--[[User:NTia89|nTia89]] 16:49, 17 July 2009 (EDT)<br />
<br />
Why don't we move this page to one called "Apple" or something similar. It doesn't matter whether you're installing on a MacBook/Pro, Mac Mini, etc. except for drivers, which are easily listed on one page. At the very least, the new MacBook page should be merged with this one. We shouldn't have to make a new page each time a new model comes out.<br />
<br />
--[[User:Arcanazar|Arcanazar]] 16:54, 17 July 2009 (EDT)<br />
<br />
IMHO we don't need it. first we must do very well, that all works for macbook.<br />
For me a Apple page OK but that contain less things<br />
<br />
--[[User:NTia89|nTia89]] 07:00, 26 July 2009 (EDT)<br />
<br />
I'd like some new wiki for the 2009 MBP 5.5, but don't know where to start. On these pages? I agree we don't need a new wiki for every model coming out. As far as the "Apple" page, I don't have an opinion.<br />
<br />
--[[User:Jryarch|Jryarch]] 19:11, 22 August 2009 (EDT)<br />
<br />
== Doesn't work !!! ==<br />
<br />
home sharing and sound doesn't works for me !!!<br />
<br />
--[[User:NTia89|nTia89]] 16:48, 17 July 2009 (EDT)<br />
<br />
I'll try home sharing later. I know that the old instructions for configuring ALSA worked for me.<br />
<br />
--[[User:Arcanazar|Arcanazar]] 16:54, 17 July 2009 (EDT)<br />
<br />
I just checked the ALSA page, and those were the only instructions that I had to use to set up sound. It worked just fine for me. What generation is your MacBook?<br />
<br />
--[[User:Arcanazar|Arcanazar]] 17:03, 17 July 2009 (EDT)<br />
<br />
i've a 2,1 macbook white<br />
<br />
--[[User:NTia89|nTia89]] 06:34, 18 July 2009 (EDT)<br />
<br />
The iSight installation wouldn't work for me. I had to do it manually. It's easy:<br />
sudo ift-extract -a /media/MacOSX//System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
--[[User:Apol|Apol]] 20:58, 25 July 2009 (EDT)<br />
<br />
thanks Apol<br />
then edit it please<br />
<br />
--[[User:NTia89|nTia89]] 07:00, 26 July 2009 (EDT)<br />
<br />
control file name in POMMED <br />
--[[User:NTia89|nTia89]] 11:09, 16 September 2009 (EDT)<br />
<br />
== Quirks/tweaks ==<br />
<br />
After (finally) getting my new MacBook Pro (5,3) to dual-boot OSX and Arch, I thought I'd share my findings. I added the reboot quirk and module tweaks to the [[MacBook#Installation|Installation]] section, and I moved the note about using rEFIt to fix the partition table up in the article.<br />
<br />
My experience with rEFIt was that if I adjusted the table after installing GRUB (i.e. after finishing the Arch install process), the Mac wouldn't correcly recognize the boot partition, and I'd get an "Operating system not found" or similar error. If I reinstalled GRUB on the partition, it would then work. However, when I used rEFIt between partitioning and installing, everything worked on the first go.<br />
<br />
As for the modules, I was attempting to use [[LUKS]] for disk encryption, but when I got to the password prompt, the computer appeared to freeze. I discovered this was actually just because it wasn't accepting keyboard input, and I narrowed down which modules needed to be present for it to work. Since I rebooted a ''lot'' during this process, I found it nice when I could get the reboot command to work properly too.<br />
<br />
{{Note|I don't know if adjusting MODULES is the "right" solution, or if there's a bug with the udev hook that needs to be filed. If someone more acquainted with mkinitcpio lore could fill me in, I'd appreciate it!}}<br />
<br />
--[[User:DJPohly|DJPohly]] 17:01, 8 August 2009 (EDT)<br />
<br />
: Looks like my intuition about "there must be a better way" was right. Changed the article to use the <code>usbinput</code> hook rather than the extra modules. --[[User:DJPohly|DJPohly]] 18:31, 9 August 2009 (EDT)<br />
<br />
== hardware table & works table ==<br />
<br />
add a hardware table & works table like in some Acer archwiki page<br />
<br />
--[[User:NTia89|nTia89]] 11:09, 14 September 2009 (EDT)<br />
<br />
== wireless broadcom ==<br />
<br />
Q: wireless card works out of the box in macbooks which have BROADCOM CARD ????<br />
need answer. --[[User:NTia89|nTia89]] 09:53, 16 September 2009 (EDT)<br />
<br />
A: No they don't, you have to download the broadcom-wl drivers for it and manually install the packages.<br />
You can find the package in [https://aur.archlinux.org/packages.php?ID=19514 AUR]<br />
<br />
== move ==<br />
<br />
move refit section on top<br />
<br />
==Change name?==<br />
Why is the article titled "''Powebook '''(English)'''''"?<br />
<br />
Should I remove the '''(English)''' tag? [[User:Manolo|manolo]] 16:52, 16 November 2009 (EST)<br />
<br />
== Contributions ==<br />
<br />
* added some notes and comments here and there to clarify or give alternatives<br />
* added the whole power management section<br />
* This also works on macbook pros (at least the 5 serie), so I added a note in intro.<br />
* I had some trouble making lirc work, so I added some instructions. Note that I didn't need "appleir" and I can't find it in the repos, so I got rid of the reference to it.<br />
<br />
Please correct me if I am wrong.<br />
<br />
--[[User:Frigaut|Frigaut]] 09:54, 30 December 2009 (EST)<br />
<br />
* added updated info on sound<br />
<br />
--[[User:Zenlord|Zenlord]] 08:44, 11 January 2010 (CET)<br />
<br />
OLD Arch Wiki MacBook Pro7,1<br />
<br />
<br />
<br />
== Macbook 7,1 ==<br />
<br />
I've just installed Arch on my macbook 7,1 and run into several problems that have or will still require a good bit of hunting around the wiki, forums, and google. There seem to be a few key changes in the hardware of the newest model (mid 2010) that require some finagling on the part of the end user, and I think it would be helpful if this article reflected those in a new section, eg 'Macbok 7,1 (mid 2010).' I'll draft the process I've used so far to get where I am, and include notices about the problems I've run into, updating with solutions when I find them.<br />
<br />
I think it will be better to have a new section for the new model for the time being as the information in the article applies to several older models, and if we distinguish by Macbook model, it will be easier for users to find relevant information.<br />
<br />
I'd appreciate some help with the formatting and compliance with the wiki's style, etc. as well as (obviously) any input from people in the same boat.<br />
<br />
I've got some work piling up at the moment, so I'll just provide a brief outline of what I'm thinking of here, and then sometime next week I'll come back and be ready to start actually incorporating it. If anyone wants to go ahead, by all means, do so, and I'll catch up next week.<br />
<br />
<br />
Preparation: Assuming you have a GUID partition table (GPT), simply resize your current OS X partition in Disk Utility.app, which will leave some free space on the drive (however much you want to allot to Arch). You create and format the arch partitions you want later in the installer. <br />
Install rEFIt.<br />
<br />
Installation media: My problems with this were discussed in this [https://bbs.archlinux.org/viewtopic.php?pid=850872 thread].<br />
<br />
I was able to install finally by using Archboot on a live cd.<br />
<br />
Installation: following the regular instructions in the installation and beginner's guides and the info already on this page works fairly well here.<br />
<br />
Booting Arch from disk: Must boot from the fallback kernel (shows up in the boot menu). Also add options reboot=pci and vga=773 to the kernel line. This will let you reboot from the command line. In order to make these changes permanent you have to add these lines to /boot/grub/menu.lst kernel lines. See example:<br />
<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,2)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/YOURUUID rootflags=rw rootfstype=ext4 ro reboot=pci vga 773<br />
initrd /kernel26.img<br />
<br />
# (1) Arch Linux<br />
title Arch Linux Fallback<br />
root (hd0,2)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/YOURUUID rootflags=rw rootfstype=ext4 ro reboot=pci vga 773<br />
initrd /kernel26-fallback.img<br />
<br />
<br />
At this point you should have a working base installation of Arch and can proceed to install packages, etc. (I've found lynx and mutt to be quite helpful in troubleshooting without having to reboot).<br />
-- <br />
In my macbook 7,1 I had the problem of scsci and sata modules(hooks?) not being probed. I don't know why it was that but that fixed my problem and now can boot in my normal kernel. What I did was basically add these to the hooks and rebuild the boot image. I received help from a more experienced arch user, I will ask him so I can tell you the exact procedure that it made work my macbook7,1 with arch without defaulting to the fallback.<br />
--<br />
Here's where I could use a lot of assistance from more experienced users, especially those who have gotten Arch working well on this model macbook. I haven't been able to get sound working or my drivers correctly installed (so xorg doesn't work either). I'm going to make threads in the forum for these issues and will try to make sure any info I get makes its way here. I'm going to try Nouveau soon and will report back if I can get it working.<br />
<br />
== Other things I've noticed ==<br />
<br />
I edited the [[MacBook#Installation_of_Mac_OS_X_and_Firmware_Update]] to include the color profile if someone isn't going to have OSX installed. I ran into this problem while following the wiki exactly -- had to reinstall OSX to get my color profile. <br />
<br />
I am currently using the Nouveau driver on my 5,5 MPB -- I'm not sure how to reflect that in the wiki (or if other models can use the same driver)<br />
--[[User:Telkkar|Telkkar]] 12:52, 6 January 2011 (EST)<br />
<br />
== burning ==<br />
<br />
Has anyone else been able to burn DVD's on a Macbook with Arch Linux? Do we need a special driver? (Seems it's a MATSHITA DVD-R UJ-857E.) I just get power calibration errors from growisofs, while wodim tells me it cannot open new session.<br />
<br />
== Question about primary partitions ==<br />
<br />
It's said in the article that only 4 primary partitions are authorized, including the efi's one. But isn't that only true for MBR partition tables?<br />
The macbook pro uses GPT partition tables and thus can have as many primary partition as it supports partitions no?<br />
<br />
== Rename simply to Mac? ==<br />
A lot of these instructions work just as well for Mac Minis, and I imagine possibly Macbook Airs, iMacs..etc. Why not rename the page Mac Support or something similar and then focus on any differences between platforms separately.<br />
<br />
== EFI bootloader ==<br />
<br />
i think we should update bootloader section with latest selection of bootloaders <br />
<br />
see the link for more info: [http://www.phoronix.com/scan.php?page=news_item&px=MTEzODY]<br />
forum thread: [https://bbs.archlinux.org/viewtopic.php?pid=1130080#p1130080]<br />
<br />
--[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 15:14, 15 July 2012 (UTC)<br />
<br />
:I'm updating the Boot section of the Macbook 11,x page. Perhaps we can merge some of that onto here when I'm done. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:40, 2 July 2014 (UTC)<br />
<br />
== mics on apple mba1,1 early 2008 ==<br />
<br />
hi,<br />
from what is written in the wiki, it seems that microphones are working for you: can anyone confirm that?<br />
thanks, n</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Talk:MacBookPro11,x&diff=322837Talk:MacBookPro11,x2014-07-02T20:38:08Z<p>Trusktr: </p>
<hr />
<div>== Method 2 for booting using the native boot manager. ==<br />
<br />
I'll be doing this on the weekend. It will be the cleanest way to boot another OS and and it won't require you to create a new partition or generate a standalone boot.efi file (hopefully). [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 19:00, 26 June 2014 (UTC)<br />
<br />
:I gave it a shot over the weekend but without success. I'll try again this weekend. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:38, 2 July 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Talk:MacBookPro11,x&diff=321705Talk:MacBookPro11,x2014-06-26T19:00:59Z<p>Trusktr: /* Method 2 for booting using the native boot manager. */</p>
<hr />
<div>== Method 2 for booting using the native boot manager. ==<br />
<br />
I'll be doing this on the weekend. It will be the cleanest way to boot another OS and and it won't require you to create a new partition or generate a standalone boot.efi file (hopefully). [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 19:00, 26 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Talk:MacBookPro11,x&diff=321704Talk:MacBookPro11,x2014-06-26T19:00:12Z<p>Trusktr: /* Method 2 for booting using the native boot manager. */ new section</p>
<hr />
<div>== Method 2 for booting using the native boot manager. ==<br />
<br />
I'll be doing this on the weekend. It will be the best way to do it and won't require you to create a new partition or generate a standalone boot.efi file (hopefully). [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 19:00, 26 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321703MacBookPro11,x2014-06-26T18:58:14Z<p>Trusktr: /* Using the MacBook's native EFI bootloader (recommended method) */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321702MacBookPro11,x2014-06-26T18:57:53Z<p>Trusktr: /* Method 1: creating an extra apple-format bootable partition with GRUB */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
===== Method 1: creating an extra apple-format bootable partition with GRUB =====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321701MacBookPro11,x2014-06-26T18:57:35Z<p>Trusktr: /* Method 2: Using the default EFI System Partition with Grub */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
=== Method 1: creating an extra apple-format bootable partition with GRUB ===<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
===== Method 2: Using the default EFI System Partition with Grub =====<br />
{{Stub|Coming this weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321700MacBookPro11,x2014-06-26T18:56:45Z<p>Trusktr: /* Using the MacBook's native EFI bootloader (recommended method) */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
=== Method 1: creating an extra apple-format bootable partition with GRUB ===<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
=== Method 2: Using the default EFI System Partition with Grub ===<br />
{{Stub|This weekend...}}<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321699MacBookPro11,x2014-06-26T18:26:03Z<p>Trusktr: /* Using the MacBook's native EFI bootloader (recommended method) */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see [[GRUB EFI Examples#Apple Mac EFI systems]].<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321698MacBookPro11,x2014-06-26T18:05:34Z<p>Trusktr: /* Using the MacBook's native EFI bootloader (recommended method) */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. For additional info, see https://help.ubuntu.com/community/UEFIBooting#Apple_Mac_EFI_systems_.28both_EFI_architecture.29.<br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321694MacBookPro11,x2014-06-26T17:40:37Z<p>Trusktr: /* Using the MacBook's native EFI bootloader */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader (recommended method) ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321693MacBookPro11,x2014-06-26T17:38:37Z<p>Trusktr: /* Using the MacBook's native EFI bootloader */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ (in the "Erase" tab of Disk Utility), mount it, then create the following directory structure and file:<br />
$ mount -t hfs /dev/diskXsY <Path to root of extra partition><br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ touch <Path to root of extra partition>/mach_kernel<br />
<br />
where {{ic|diskXsy}} is the disk your partition is on (e.g. disk0s1). You can use {{ic|diskutil list}} to list your disks and partitions.<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
{{Note|It's possible to do the above modifications to/on the extra partition from within Linux (if you've installed the proper HFS tools), but the following bless commands have to be executed from within OS X.}}<br />
<br />
The last step is then to bless (make bootable) the extra partition (as root):<br />
# bless --folder=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
# bless --mount=<Path to root of extra partition> --file=<Path to root of extra partition>/System/Library/CoreServices/boot.efi --setBoot<br />
<br />
{{Note|It might not be necessary to execute both commands, but to be sure it worked it won't do any harm to execute both.}}<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done from in Linux, without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321578MacBookPro11,x2014-06-25T23:58:11Z<p>Trusktr: /* Using the MacBook's native EFI bootloader */ Added some detail.</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the Arch Linux install process we would normally install GRUB (or a variation) to a partition on the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]]. Make sure to follow the steps for setting up grub on a partition using the {{ic|grub-install}} and {{ic|grub-mkconfig}} commands, like normal. We will use the config file that {{ic|grub-mkconfig}} creates to generate a standalone {{ic|boot.efi}} file using the {{ic|grub-mkstandalone}} command, then we will wipe your just-created grub partition and set it up for Mac's native bootloader (or you can simply create a new partition and leave the grub partition alone, it's up to you). Now, let's do it.<br />
<br />
When generating a grub config file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file (in our current working directory):<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
{{Note|It's possible to do the following modifications to the extra partition in Linux, up until the point where we use the bless command, assuming that you have installed what's needed to mount an HFS+ partition writable in Linux.}}<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Path to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=321577MacBookPro11,x2014-06-25T23:44:41Z<p>Trusktr: /* Bootloader */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]].<br />
<br />
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and reformat the extra partition (or just make a new one) as HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Parth to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<?xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=HiDPI&diff=321472HiDPI2014-06-25T01:24:04Z<p>Trusktr: </p>
<hr />
<div>[[Category:Graphics]]<br />
HiDPI is simply a name for screens with a high resolution (High Dots Per Inch). The examples are Apple MacBooks labeled "with Retina", as well as some ultrabooks (e.g. Lenovo Yoga 2 Pro).<br />
<br />
Not all software behaves well in high-resolution mode yet. Here are listed most common tweaks which make work on a HiDPI screen more pleasant.<br />
<br />
{{Note| Gtk-3 3.10 and 3.12 require hidpi support in cairo, but the current release of cairo does not yet have this support. In order to enable full HiDPI support for Gtk-3.0 programs, you will have to build cairo-git then re-build gtk3 off of these newer cairo libraries.}}<br />
<br />
<br />
== Desktop environments (DEs) ==<br />
<br />
=== GNOME 3 ===<br />
<br />
GNOME seems to be supporting HiDPI since 3.10. The support isn't particularly great, though.<br />
<br />
For now to correctly enable HiDPI in GNOME you need latest version of cairo-git, and rebuild gtk with this version of cairo (this includes v3.12).<br />
<br />
To enable HiDPI, set your interface factor scaling using gsettings:<br />
<br />
gsettings set org.gnome.desktop.interface scaling-factor 2<br />
<br />
To reset this set scaling-factor to 1.<br />
<br />
=== XFCE ===<br />
<br />
Go to Settings Editor (you can find it in Settings Manager), and change the DPI parameter in <code>xsettings</code> → <code>Xft</code>. The value of 180 seems to work well on Retina screens.<br />
<br />
To enlarge icons in system tray, right-click on it (aim for empty space / top pixels / bottom pixels, so that you won't activate icons themselves) → “Properties” → set “Maximum icon size” to 32, 48 or 64.<br />
<br />
== Browsers ==<br />
<br />
=== Firefox ===<br />
<br />
Open Firefox advanced preferences page (<code>about:config</code>) and set parameter <code>layout.css.devPixelsPerPx</code> to <code>2</code> (or find the one that suits you better; <code>2</code> is a good choice for Retina screens).<br />
<br />
=== Chromium / Google Chrome ===<br />
<br />
No official support yet. Watch this thread: https://code.google.com/p/chromium/issues/detail?id=143619. In the meantime try setting default page zoom level to 200% (although it isn't the most elegant solution).<br />
<br />
For more adventurous users, Chromium can be recompiled using the -Denable_hidpi=1 flag to use experimental HiDPI scaling. Use the ABS to download the <code>chromium</code> package source, then edit the PKGBUILD file to add the flag. Note that this option will partially break context menus, but will optimize the interface and all webpages. <br />
<br />
== Mail clients ==<br />
<br />
=== Thunderbird ===<br />
<br />
See [[HiDPI#Firefox|Firefox]]. To access <code>about:config</code>, go to Edit → Preferences → Advanced → Config editor.<br />
<br />
== Skype ==<br />
<br />
Skype is a Qt program, and needs to be configured separately. You can't change the DPI setting for it, but at least you can change font size. Install <code>extra/qt4</code> and run <code>qtconfig-qt4</code> to do it.</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Trusktr&diff=319684User talk:Trusktr2014-06-14T01:26:10Z<p>Trusktr: </p>
<hr />
<div><br />
== Redirect ==<br />
<br />
What's up with those Beginner's guide/guidee redirects? :-/ --[[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:40, 13 June 2014 (UTC)<br />
<br />
I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide". [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:41, 13 June 2014 (UTC)<br />
<br />
:What for?? Please, read [[Help:Style#Title]], especially the first item -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 20:55, 13 June 2014 (UTC)<br />
<br />
::K, fixed. Sorry! Learning experience. "Beginners' guide" sounds like "Beginnerses guide" while "Beginner's guide" sounds like "Beginners guide" (at least here in the US) so I changed it to the second so it is spelled as people would expect it to sound. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:58, 13 June 2014 (UTC)<br />
<br />
::People in the US at least. I'm not sure about English in other countries, but I believe it's likely the same. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:59, 13 June 2014 (UTC)<br />
<br />
:::Please use your talk page, not mine :) ([[Help:Editing#Discussion pages]])<br />
:::I hope you'll not do such edits in the future, just remember about it :) As I know in English it must be ''Beginners' guide'', not ''Beginner's guide''. Also please always discuss such changes, especially in main articles (such as installation guides), '''before''' editing<br />
:::It's OK. There are some articles, that would help you to avoid mistakes in the future: [[Help:Style]] and [[Help:Editing]]<br />
:::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 21:25, 13 June 2014 (UTC)<br />
<br />
::::Thank you so much [[User:Kycok|Kycok]]. :) Do you get a notification of my reply even though it's not on your page?<br />
::::[[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 21:32, 13 June 2014 (UTC)<br />
:::::You can watch any page, including someone else's talk page. If it's in your watchlist, you get a notification. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 21:36, 13 June 2014 (UTC)<br />
<br />
:::::As Karol says, I just need to temporarily subscribe to your page -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 21:45, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Trusktr&diff=319634User talk:Trusktr2014-06-13T21:32:39Z<p>Trusktr: /* Redirect */</p>
<hr />
<div>Thank you for your recent contributions to the wiki. However, please remember to write objectively at all times. Avoid claims such as "method X is easier/better than Y." Instead, provide reasons why one user may consider method X over Y and vice versa; let the user decide how to manage their own system. Maintain a formal tone. Please avoid slang and emoticons in wiki articles. Thanks,<br />
<br />
-- [[User:Pointone|pointone]] 20:01, 30 August 2010 (EDT)<br />
<br />
Thanks pointone, I'm glad to be able to contribute. II will edit my additions so that they are not biased as you've suggested.<br />
<br />
[[User:Trusktr|Trusktr]] 01:59, 31 August 2010 (EDT)<br />
<br />
== MATE edits ==<br />
Home page of environment refers to it as "MATE". Was it renamed to lowercase? Also you have broken i18n by replacing name in template. --[[User:AlexanderR|AlexanderR]] 13:43, 2 May 2012 (UTC)<br />
<br />
== Redirect ==<br />
<br />
What's up with those Beginner's guide/guidee redirects? :-/ --[[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:40, 13 June 2014 (UTC)<br />
<br />
I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide". [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:41, 13 June 2014 (UTC)<br />
<br />
:What for?? Please, read [[Help:Style#Title]], especially the first item -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 20:55, 13 June 2014 (UTC)<br />
<br />
::K, fixed. Sorry! Learning experience. "Beginners' guide" sounds like "Beginnerses guide" while "Beginner's guide" sounds like "Beginners guide" (at least here in the US) so I changed it to the second so it is spelled as people would expect it to sound. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:58, 13 June 2014 (UTC)<br />
<br />
::People in the US at least. I'm not sure about English in other countries, but I believe it's likely the same. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:59, 13 June 2014 (UTC)<br />
<br />
:::Please use your talk page, not mine :) ([[Help:Editing#Discussion pages]])<br />
:::I hope you'll not do such edits in the future, just remember about it :) As I know in English it must be ''Beginners' guide'', not ''Beginner's guide''. Also please always discuss such changes, especially in main articles (such as installation guides), '''before''' editing<br />
:::It's OK. There are some articles, that would help you to avoid mistakes in the future: [[Help:Style]] and [[Help:Editing]]<br />
:::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 21:25, 13 June 2014 (UTC)<br />
<br />
::::Thank you so much [[User:Kycok|Kycok]]. :) Do you get a notification of my reply even though it's not on your page?<br />
::::[[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 21:32, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=319625MacBookPro11,x2014-06-13T21:07:21Z<p>Trusktr: /* Bootloader */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]].<br />
<br />
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and erase the extra partition, mentioned above, to HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Parth to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=319624MacBookPro11,x2014-06-13T21:07:09Z<p>Trusktr: /* The installation */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
=== Bootloader ===<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]].<br />
<br />
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and erase the extra partition, mentioned above, to HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Parth to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=319623MacBookPro11,x2014-06-13T21:06:28Z<p>Trusktr: /* The installation */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [[Beginner's guide]] and become a wizard at standard Arch installs first.<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
=== Bootloader ===<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]].<br />
<br />
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and erase the extra partition, mentioned above, to HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Parth to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=MacBookPro11,x&diff=319622MacBookPro11,x2014-06-13T21:06:14Z<p>Trusktr: /* The installation */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General Recommendations}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBook}}<br />
{{Related articles end}}<br />
<br />
This wiki page should help you in getting your MacBook Pro(Late 2013) to work with Arch Linux.<br />
== Preparing for the Installation ==<br />
<br />
=== Preparing the hard drive ===<br />
<br />
Assuming you want to dual boot with OS X, so you can update firmware, you have to shrink its partition with Disk Utility. You can either create a HFS+ partition now to override later, or leave it empty.<br />
<br />
== Installation ==<br />
<br />
=== Booting the live image ===<br />
<br />
Now, download the latest [[Archboot]] ISO, write it to USB, and boot from it by selecting it in the Apple boot loader by holding {{ic|Alt}} on boot (use rEFIt if you cannot manage to select it). If you are using a kernel before 3.13 when it comes to the syslinux boot loader, press {{ic|Tab}} to edit the entry and append {{ic|nomodeset}} to fix screen corruption, do not use nomodeset for kernel 3.13 and above, it is not needed anymore (and it will break vaapi).<br />
<br />
=== Internet ===<br />
<br />
{{Note|You can skip this if you use the Thunderbolt or USB-to-Ethernet adapter for the installation.}}<br />
<br />
==== Wireless ====<br />
<br />
As mentioned below, {{ic|broadcom-wl}} is sufficient if you are using the Linux mainline kernel. For custom kernels, you need to use {{ic|broadcom-wl-dkms}}. Both are available from the [[AUR]]. The easiest way to get Wi-Fi connectivity during install is to build the package driver on a separate system using:<br />
$ curl -O https://aur.archlinux.org/packages/br/broadcom-wl-dkms/broadcom-wl-dkms.tar.gz<br />
$ tar -zxvf broadcom-wl-dkms.tar.gz<br />
$ cd broadcom-wl-dkms<br />
$ makepkg -s<br />
This will give you a package ({{ic|broadcom-wl-*.pkg.tar.xz}}) which can be installed using [[pacman]]. Put this package on a USB drive, mount it, and install the package using<br />
# pacman -U broadcom-wl-*.pkg.tar.xz<br />
# modprobe wl<br />
during install.<br />
You may now use {{ic|wifi-menu}} to connect to your network of choice.<br />
{{Note|You need to repeat this process when you have finished your installation, for instance when booting into the system for the first time or when you have chrooted your install.}}<br />
<br />
=== The installation ===<br />
<br />
<br />
Run the installation wizard. Just kidding. You might want to take a look at the [Beginner's guide] and become a wizard at standard Arch installs first.<br />
<br />
{{Note|Refer to the [[MacBook]] page if you do not want to have a separate partition for GRUB but rather prefer to use [http://www.rodsbooks.com/refind/ rEFInd] (or [[MacBook#rEFIt|rEFIt]]).}}<br />
<br />
{{Tip|If you want to use the native MacBook bootloader, you need an extra partition of at least 128 MiB.}}<br />
<br />
=== Bootloader ===<br />
<br />
==== Using the MacBook's native EFI bootloader ====<br />
<br />
This method uses the MacBook's native EFI bootloader, i.e. the one the can be reached when holding the alt-key during boot. <br />
<br />
{{Note|For this method you need an extra partition of at least 128 MiB. This partition will be used by the MacBook's native bootloader to launch Arch. It also assumes that you are dual-booting OS X and Arch.}}<br />
{{Note|It's possible to avoid the HFS+ partition by using FAT32, this way you can do all the bootloader stuff right from the LiveCD.}}<br />
<br />
At the end of the install process we would normally install GRUB or a variation the the drive. For this method we will place a {{ic|boot.efi}} file on an extra partition used by the MacBook's native bootloader.<br />
<br />
First, [[pacman|install]] the {{Pkg|grub}} package from the [[official repositories]].<br />
<br />
When generating a {{ic|boot.efi}} file, GRUB looks to {{ic|/etc/default/grub}} for its configuration. Edit the parameter {{ic|GRUB_CMDLINE_LINUX_DEFAULT}} to look something like this:<br />
{{bc|<br />
<nowiki><br />
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=noncq"<br />
</nowiki><br />
}}<br />
<br />
The {{ic|1=libata.force=noncq}} parameter will prevent SSD lockups and the {{ic|rootflags}} option is used for SSD-performance.<br />
<br />
{{Note|Do not use the {{ic|rootflags}} option on Btrfs. It is not supported.}}<br />
<br />
Now we generate the {{ic|boot.efi}} file:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
Put this file on a USB (or other OS X accessible media) and reboot into OS X.<br />
<br />
Launch {{ic|DiskUtility.app}} and erase the extra partition, mentioned above, to HFS+ and mount it.<br />
$ mkdir -p <Path to root of extra partition>/System/Library/CoreServices<br />
$ mkdir <Parth to root of extra partition>/mach_kernel<br />
<br />
Copy the {{ic|boot.efi}} file to the {{ic|<Path to extra partition>/System/Library/CoreServices/}} directory. Using your editor of choice, create a {{ic|SystemVersion.plist}} file in the CoreServices directory, which is located here:<br />
''<path to extra partition>''/System/Library/CoreServices/SystemVersion.plist<br />
<br />
Edit that file to look like this:<br />
{{bc|<br />
<nowiki><br />
<xml version="1.0" encoding="utf-8"?><br />
<plist version="1.0"><br />
<dict><br />
<key>ProductBuildVersion</key><br />
<string></string><br />
<key>ProductName</key><br />
<string>Linux</string><br />
<key>ProductVersion</key><br />
<string>Arch Linux</string><br />
</dict><br />
</plist><br />
</nowiki><br />
}}<br />
<br />
The last step is then to bless the extra partition using:<br />
# bless --device disk0sX --setBoot<br />
If this command doesn't work try calling bless by the mount point instead.<br />
# bless --mount /Volumes/<mount> --setBoot <br />
<br />
Where {{ic|disk0sX}} is the extra partitions id. The id can be found using either {{ic|DiskUtility.app}} or by issuing:<br />
# diskutil list<br />
<br />
{{Note|In order to change grub settings both {{ic|grub.cfg}} and {{ic|boot.efi}} will have to be generated. This can be done without booting OS X.}}<br />
<br />
Generate {{ic|grub.cfg}} and {{ic|boot.efi}} from Arch Linux:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# mount -t hfsplus -o force,rw /dev/sdXY /mnt # mount the HFS+ partition<br />
# grub-mkstandalone -o /mnt/System/Library/CoreServices/boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg<br />
<br />
==== Direct EFI booting (rEFInd) ====<br />
<br />
''See: [[UEFI_Bootloaders]]''<br />
<br />
As of August 2013, refind can automatically detect the Arch kernel, removing the need for copying the kernel into the EFI partition. Simply install refind without the EFI file system drivers [http://forums.gentoo.org/viewtopic-t-967024-start-0.html] using the {{ic|--nodrivers}} option [https://bbs.archlinux.org/viewtopic.php?pid=1348145#p1348145], and enable the {{ic|scan_all_linux_kernels}} and {{ic|also_scan_dirs}} options in {{ic|refind.conf}} (see link above for instructions.).<br />
<br />
An alternative way is to omit all the scans and put the following bootentry at the end of your "refind.conf":<br />
menuentry "Arch" {<br />
icon EFI/refind/icons/os_arch.icns <br />
volume <Volume label><br />
ostype Linux<br />
loader /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
options "rw root=/dev/<arch partition> rootfstype=<filesystem type> libata.force=noncq"<br />
}<br />
Don't forget to replace the angle brackets with your data.<br />
<br />
==== GRUB (with OS X) ====<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.<br />
<br />
{{Note|{{ic|1=libata.force=noncq}} helps with hangs due to SSD speed.}}<br />
<br />
Now cd into {{ic|/tmp/install/}} and create the GRUB image by running:<br />
grub-mkstandalone -o bootx64.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|boot64.efi}} which contains GRUB and the configuration file incorporated inside. It is important to {{ic|cd}} into the right directory to make it pick up the configuration file and put it into the right place within the image.<br />
<br />
Copy this file to the MacBook's EFI partition. The downside of this method is that you need to repeat this step whenever you want to change the GRUB config. Reboot the machine and you should be able to select your installed Arch Linux by keeping the {{ic|Alt}} button pressed. It should appear as {{ic|EFI boot}}.<br />
<br />
To generate a nicer config use: {{ic|grub-mkconfig}}, remove {{ic|quiet}} if you like the text, then to update your GRUB post-installation, do this to make the GRUB EFI file and put it in the EFI partition:<br />
cd /<br />
grub-mkstandalone -o bootx64.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi -C xz boot/grub/grub.cfg<br />
sudo mount /dev/sda1 /mnt<br />
sudo cp bootx64.efi /mnt/EFI/boot/bootx64.efi<br />
<br />
{{note|You'll need {{ic|hfsprogs}} to run the above commands}}<br />
<br />
== Post installation ==<br />
<br />
=== Console ===<br />
<br />
Largest console font (although ugly) achieved by adding {{ic|1=FONT=sun12x22}} to {{ic|/etc/vconsole.conf}}<br />
It is still tiny but is at least readable.<br />
<br />
=== Graphics ===<br />
<br />
MacBook Pro 11,1<br />
* Intel works on 3.12 with nomodeset<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,2<br />
* Intel works from 3.13.4-1-ARCH<br />
MacBook Pro 11,3<br />
* Nvidia works (both 319.60 and 331.17 drivers)<br />
** Follow http://cberner.com/2013/03/01/installing-ubuntu-13-04-on-macbook-pro-retina/<br />
* Intel works after patching grub, see below<br />
<br />
See [[HiDPI]] for information on how to tweak the system for a Retina screen.<br />
<br />
If you are using [[Xfce]], you will probably experience tearing in Firefox, VLC, etc. Until newer versions of xfwm support OpenGL rendering, use another compositing window manager like [[compton]] with {{ic|1=backend = "glx"}}.<br />
<br />
==== Getting the integrated intel card to work on 11,3 ====<br />
<br />
By default the integrated card is powered off. To fix this we need a grub function called "apple_set_os". This function hasn't oficially been merged yet, so we need to build grub ourselves. Download the {{AUR|grub-git}} package from the AUR. Using something like:<br />
<br />
$ packer -G grub-git<br />
$ cd grub-git<br />
<br />
Get the patch from here: http://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html<br />
<br />
Put the patch contents into a file labeled something like "apple.patch"<br />
<br />
Add this patch to your PKGBUILD and run:<br />
<br />
$ makepkg -si<br />
<br />
Reboot into OS X and download gfxCardStatus v2.2.1 (newer versions do not work properly) run the app and specify the integrated card.<br />
<br />
Reboot and at the grub prompt typ 'c' to get into console, followed by "apple_set_os" at the prompt.<br />
<br />
You should now be able to install {{Pkg|xf86-video-intel}} and get your card running.<br />
<br />
Note that the HDMI port and MiniDP are soldered to the nvidia card meaning that to run external displays you need to use the dedicated card.<br />
<br />
=== Sound ===<br />
<br />
* Headphones work<br />
* Speakers work from kernel 3.13 and 3.12.2. 3.12.1 only with patch<br />
** Patch: https://bugzilla.kernel.org/attachment.cgi?id=114081.<br />
** See discussion here: https://bugzilla.kernel.org/show_bug.cgi?id=64401<br />
* Optical audio can be turned off and on with above sound patch.<br />
<br />
If you do not want to hear the annoying sound at system start-up, one way to get rid of it is to turn sound off while under Mac OS.<br />
<br />
Volume keys can be made to work with {{ic|xfce4-volumed}} (if you are using Xfce).<br />
<br />
Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install {{pkg|pavucontrol}} and set Analog Stereo as the fallback device.<br />
<br />
=== Touchpad ===<br />
<br />
One method is to install {{pkg|xf86-input-synaptics}} and configure to your liking in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
Section "InputClass"<br />
MatchIsTouchpad "on"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
# 1 = left, 2 = right, 3 = middle<br />
Option "TapButton1" "1" <br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
# Palm detection<br />
Option "PalmDetect" "1"<br />
# Horizontal scrolling<br />
Option "HorizTwoFingerScroll" "1"<br />
# Natural Scrolling (and speed)<br />
Option "VertScrollDelta" "-100"<br />
Option "HorizScrollDelta" "-100"<br />
EndSection<br />
<br />
=== Keyboard backlight ===<br />
<br />
* Works, see [[MacBook#Keyboard_Backlight]]<br />
* On KDE the backlight and the increse/decrese brightness keys work fine, but they need upower to start before the desktop. To do this create the file {{ic|/etc/systemd/system/kdm.service.d/kbd_backlight.conf}} with this content (you might need to create the directory as well)<br />
[Unit]<br />
Requires=upower.service<br />
After=upower.service<br />
<br />
=== Screen backlight ===<br />
<br />
* Intel, works on Linux 3.13<br />
* Framebuffer, works for MacBook Pro 11,1 and 11,3 via {{ic|/sys/class/backlight/gmux_backlight/brightness}}.<br />
* Nvidia, does not work using default settings. Try adding {{ic|1=setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0}} to {{ic|/etc/rc.local}}.<br />
{{note|If the screen doesn't show the prompt or the login manager (i.e. a black screen), append {{ic|1=i915.invert_brightness=1}} to the kernel. }}<br />
<br />
=== Suspend ===<br />
<br />
* Works on MacBook Pro 11,2 with Linux 3.13<br />
* No backlight after suspend with Linux 3.12<br />
** Use hibernate instead<br />
<br />
== What does not work ==<br />
<br />
Updated 2013-12-07<br />
<br />
=== General ===<br />
<br />
=== Wi-Fi ===<br />
<br />
* {{AUR|broadcom-wl}} or {{AUR|broadcom-wl-dkms}} from the [[AUR]] works<br />
** Stability is an issue for some<br />
<br />
=== Web cam ===<br />
<br />
* Listed on PCI bus as: Multimedia controller: Broadcom Corporation Device 1570.<br />
* In OS X, the camera is listed as FaceTime HD camera 1570.<br />
* No known Linux driver. [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Kernel.org Bug]<br />
<br />
== Discussions ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=171883<br />
<br />
== See also ==<br />
<br />
* [[MacBookPro10,x]]<br />
* [[MacBook]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Kycok&diff=319619User talk:Kycok2014-06-13T20:59:53Z<p>Trusktr: </p>
<hr />
<div>== <s>Команда переводчиков ArchWiki</s> ==<br />
<br />
Привет! Так как ты наиболее активен в русскоязычной части вики, решил написать об этом сюда. Было бы неплохо организовать перевод статей, синхронизацию с основными (англ.) страницами и поддержку их актуальности как это делаем мы.<br />
<br />
Для этого предлагаю cоздать страницу [[ArchWiki Translation Team (Русский)]], в которой:<br />
* Написать какую-нибудь полезную информацию и введение в то, чем мы занимаемся, чтобы побудить других энтузиастов участвовать. <br />
* Составлять список участников и статей, которые они поддерживают в актуальном состоянии. Для всех статей, которые никто не контролирует, можно создать категорию [[:Category:Unmaintained (Русский)]] и шаблон [[Template:Unmaintained (Русский)]] с информацией о том, что нет гарантии в актуальности статьи и требуется человек, желающий этим заняться.<br />
* Составить список приоритетных задач.<br />
Какие твои мысли и предложения по этому поводу? -- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 09:07, 21 May 2014 (UTC)<br />
<br />
:Идея хорошая, можно реализовать. Есть только некоторые вещи, которые надо изменить:<br />
:* Категория не нужна. Категории предназначены для классификации статей, а не пометок их состояния. Шаблон подойдет для этого гораздо лучше. Со страницы [[ArchWiki Translation Team (Русский)]] создадим ссылку [[Special:WhatLinksHere/Template:Unmaintained (Русский)]] с приглашением взять какие-либо статьи из этого списка<br />
:* Самые важные статьи из списка [[Special:WhatLinksHere/Template:Unmaintained (Русский)]] можно вносить в список приоритетных задач<br />
:* Можно создать русский [[Template:Translateme]] и помечать им соответствующие статьи. Их также вносить в отдельный список<br />
:Как-то так :) -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 12:19, 21 May 2014 (UTC)<br />
<br />
::Совсем забыл про [[Special:WhatLinksHere]], действительно. Я создал начальные версии страниц и шаблонов:<br />
::* [[ArchWiki Translation Team (Русский)]]<br />
::* [[Template:Unmaintained (Русский)]]<br />
::* [[Template:Translateme (Русский)]]<br />
::Улучшения и добавления приветствуются :) -- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 15:19, 21 May 2014 (UTC)<br />
<br />
:::Не забывай здесь создавать отступы при ответе :) Теперь к делу.<br />
:::'''1.''' Подумал я тут, подумал, и пришел к выводу, что не знаю даже, нужен ли [[Template:Unmaintained (Русский)]]. Причины: во-первых, придется перебрать почти 200 страниц из [[:Category:Русский]], чтобы на (почти) все повесить этот шаблон; во-вторых, есть русские страницы, которые не добавлены в эту категорию, и их будет проблематично отловить; в-третьих, нет никакой гарантии, что кто-либо, создающий русскую страницу, добавит ее в эту категорию, что, в свою очередь, очень сильно затруднит отслеживание подобных страниц. Можно было бы, наоборот, не использовать этот шаблон, а использовать [[Template:Maintained (Русский)]] (думаю, понятно, что там можно было бы написать), но это тоже плохой вариант, т.к. в таком шаблоне будет явный намек на то, что "все это лишь благодаря нашей команде", а это противоречит основному принципу ("это существует благодаря всему сообществу, а не конкретным людям").<br />
:::''Итог'': считаю, что подобные шаблоны не нужны. Есть страница [[ArchWiki Translation Team (Русский)]], на ней даны ссылки на поддерживаемые страницы, и этой информации достаточно. '''В крайнем случае''' всегда можно использовать [[Template:Translateme (Русский)]], а на основной странице - соответствующая ссылка со страницами, ссылающимися на этот шаблон<br />
:::'''2.''' Слово "section" надо переводить как "раздел": привычное русскому уху слово :)<br />
:::'''3.''' Если возникает ситуация, при которой сопроводитель не может перевести какое-либо предложение/раздел, предлагаю оставлять в русской статье английский текст, раздел помечать шаблоном Translateme '''и писать об этом [[ArchWiki Translation Team (Русский)#Список страниц с сопроводителем|в столбец заметок]]'''. Например, так: "Требуется перевод: [[Network Security Services (Русский)#Добавление сертификата]]". Тогда это будет быстро переведено остальными. Можно об этом написать на странице команды<br />
:::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 23:02, 21 May 2014 (UTC)<br />
<br />
::::По поводу шаблона. Ну во-первых, это отличный способ дать понять читателю, что существует команда переводчиков и как он может помочь развитию ArchWiki, своего рода реклама. А во-вторых, поздновато -- на большое количество страниц я уже успел навесить этот шаблон. Да, новые страницы не так просто отследить, особенно если страница не добавлена в соответствующую категорию, однако это не такая уж и большая проблема. Страница, не находящаяся в поле зрения команды переводчиков, в любом случае, вероятно останется без внимания в первый период времени. Проблема может возникнуть разве что если отсутствие шаблона на странице покажется пользователю как наличие сопроводителя, однако если сам шаблон отсутствует, пользователь точно так же не уведомлён о том, что статья может оказаться устаревшей.<br />
::::У меня ещё была такая идея -- участникам, активность которых замечена командой переводчиков, добавлять в страницу обсуждения какой-нибудь текст приветствия. Это может частично решить проблему с игнорированием необходимости в шаблоне [[Template:Unmaintained (Русский)]] для страницы.<br />
::::В поиске новых страниц нам отлично поможет [[Special:NewPages]]. Например, взглянув на неё в данный момент, можно заметить, что создана страница [[dhcpd (Русский)]] без категорий, связывающих страницу с русской частью вики, а так же видна недавняя активность [[User:52th]], можно смело писать текст приветствия. Надо бы прям в [[ArchWiki Translation Team (Русский)]] добавить ещё информацию о создании новых страниц и необходимости указать русские категории.<br />
::::Про "section" и заметки в списке согласен.<br />
::::-- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 04:11, 22 May 2014 (UTC)<br />
<br />
:::::Ок, пусть будет шаблон, оставляю это на твоей совести :) Но тогда про него надо и на [[Help:Редактирование]], и на [[Help:Стиль]] написать, и на подобных статьях. Это тоже "может частично решить проблему с игнорированием". Займусь этим только завтра. Ссылки на основной странице тогда надо вернуть на Unmaintained.<br />
:::::К слову, у меня есть на компе небольшой алгоритм действий "чтобы ничего не забыть", могу добавить.<br />
:::::Приглашения - хорошо, но не стоит их рассылать сразу же всем, кто начинает править русские статьи. Надо хотя бы в течение недели смотреть на активность<br />
:::::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 05:04, 22 May 2014 (UTC)<br />
<br />
::::::Обсуждение закрыто. Далее все вопросы - на соответствующей странице [[Talk:ArchWiki Translation Team (Русский)]] -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 00:17, 23 May 2014 (UTC)<br />
<br />
K, fixed. Sorry! Learning experience.<br />
"Beginners' guide" sounds like "Beginnerses guide" while "Beginner's guide" sounds like "Beginners guide" (at least here in the US) so I changed it to the second so it is spelled as people would expect it to sound. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:58, 13 June 2014 (UTC)<br />
<br />
People in the US at least. I'm not sure about English in other countries, but I believe it's likely the same. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:59, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Kycok&diff=319617User talk:Kycok2014-06-13T20:58:58Z<p>Trusktr: </p>
<hr />
<div>== <s>Команда переводчиков ArchWiki</s> ==<br />
<br />
Привет! Так как ты наиболее активен в русскоязычной части вики, решил написать об этом сюда. Было бы неплохо организовать перевод статей, синхронизацию с основными (англ.) страницами и поддержку их актуальности как это делаем мы.<br />
<br />
Для этого предлагаю cоздать страницу [[ArchWiki Translation Team (Русский)]], в которой:<br />
* Написать какую-нибудь полезную информацию и введение в то, чем мы занимаемся, чтобы побудить других энтузиастов участвовать. <br />
* Составлять список участников и статей, которые они поддерживают в актуальном состоянии. Для всех статей, которые никто не контролирует, можно создать категорию [[:Category:Unmaintained (Русский)]] и шаблон [[Template:Unmaintained (Русский)]] с информацией о том, что нет гарантии в актуальности статьи и требуется человек, желающий этим заняться.<br />
* Составить список приоритетных задач.<br />
Какие твои мысли и предложения по этому поводу? -- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 09:07, 21 May 2014 (UTC)<br />
<br />
:Идея хорошая, можно реализовать. Есть только некоторые вещи, которые надо изменить:<br />
:* Категория не нужна. Категории предназначены для классификации статей, а не пометок их состояния. Шаблон подойдет для этого гораздо лучше. Со страницы [[ArchWiki Translation Team (Русский)]] создадим ссылку [[Special:WhatLinksHere/Template:Unmaintained (Русский)]] с приглашением взять какие-либо статьи из этого списка<br />
:* Самые важные статьи из списка [[Special:WhatLinksHere/Template:Unmaintained (Русский)]] можно вносить в список приоритетных задач<br />
:* Можно создать русский [[Template:Translateme]] и помечать им соответствующие статьи. Их также вносить в отдельный список<br />
:Как-то так :) -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 12:19, 21 May 2014 (UTC)<br />
<br />
::Совсем забыл про [[Special:WhatLinksHere]], действительно. Я создал начальные версии страниц и шаблонов:<br />
::* [[ArchWiki Translation Team (Русский)]]<br />
::* [[Template:Unmaintained (Русский)]]<br />
::* [[Template:Translateme (Русский)]]<br />
::Улучшения и добавления приветствуются :) -- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 15:19, 21 May 2014 (UTC)<br />
<br />
:::Не забывай здесь создавать отступы при ответе :) Теперь к делу.<br />
:::'''1.''' Подумал я тут, подумал, и пришел к выводу, что не знаю даже, нужен ли [[Template:Unmaintained (Русский)]]. Причины: во-первых, придется перебрать почти 200 страниц из [[:Category:Русский]], чтобы на (почти) все повесить этот шаблон; во-вторых, есть русские страницы, которые не добавлены в эту категорию, и их будет проблематично отловить; в-третьих, нет никакой гарантии, что кто-либо, создающий русскую страницу, добавит ее в эту категорию, что, в свою очередь, очень сильно затруднит отслеживание подобных страниц. Можно было бы, наоборот, не использовать этот шаблон, а использовать [[Template:Maintained (Русский)]] (думаю, понятно, что там можно было бы написать), но это тоже плохой вариант, т.к. в таком шаблоне будет явный намек на то, что "все это лишь благодаря нашей команде", а это противоречит основному принципу ("это существует благодаря всему сообществу, а не конкретным людям").<br />
:::''Итог'': считаю, что подобные шаблоны не нужны. Есть страница [[ArchWiki Translation Team (Русский)]], на ней даны ссылки на поддерживаемые страницы, и этой информации достаточно. '''В крайнем случае''' всегда можно использовать [[Template:Translateme (Русский)]], а на основной странице - соответствующая ссылка со страницами, ссылающимися на этот шаблон<br />
:::'''2.''' Слово "section" надо переводить как "раздел": привычное русскому уху слово :)<br />
:::'''3.''' Если возникает ситуация, при которой сопроводитель не может перевести какое-либо предложение/раздел, предлагаю оставлять в русской статье английский текст, раздел помечать шаблоном Translateme '''и писать об этом [[ArchWiki Translation Team (Русский)#Список страниц с сопроводителем|в столбец заметок]]'''. Например, так: "Требуется перевод: [[Network Security Services (Русский)#Добавление сертификата]]". Тогда это будет быстро переведено остальными. Можно об этом написать на странице команды<br />
:::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 23:02, 21 May 2014 (UTC)<br />
<br />
::::По поводу шаблона. Ну во-первых, это отличный способ дать понять читателю, что существует команда переводчиков и как он может помочь развитию ArchWiki, своего рода реклама. А во-вторых, поздновато -- на большое количество страниц я уже успел навесить этот шаблон. Да, новые страницы не так просто отследить, особенно если страница не добавлена в соответствующую категорию, однако это не такая уж и большая проблема. Страница, не находящаяся в поле зрения команды переводчиков, в любом случае, вероятно останется без внимания в первый период времени. Проблема может возникнуть разве что если отсутствие шаблона на странице покажется пользователю как наличие сопроводителя, однако если сам шаблон отсутствует, пользователь точно так же не уведомлён о том, что статья может оказаться устаревшей.<br />
::::У меня ещё была такая идея -- участникам, активность которых замечена командой переводчиков, добавлять в страницу обсуждения какой-нибудь текст приветствия. Это может частично решить проблему с игнорированием необходимости в шаблоне [[Template:Unmaintained (Русский)]] для страницы.<br />
::::В поиске новых страниц нам отлично поможет [[Special:NewPages]]. Например, взглянув на неё в данный момент, можно заметить, что создана страница [[dhcpd (Русский)]] без категорий, связывающих страницу с русской частью вики, а так же видна недавняя активность [[User:52th]], можно смело писать текст приветствия. Надо бы прям в [[ArchWiki Translation Team (Русский)]] добавить ещё информацию о создании новых страниц и необходимости указать русские категории.<br />
::::Про "section" и заметки в списке согласен.<br />
::::-- [[User:Gim|Gim]] ([[User talk:Gim|talk]]) 04:11, 22 May 2014 (UTC)<br />
<br />
:::::Ок, пусть будет шаблон, оставляю это на твоей совести :) Но тогда про него надо и на [[Help:Редактирование]], и на [[Help:Стиль]] написать, и на подобных статьях. Это тоже "может частично решить проблему с игнорированием". Займусь этим только завтра. Ссылки на основной странице тогда надо вернуть на Unmaintained.<br />
:::::К слову, у меня есть на компе небольшой алгоритм действий "чтобы ничего не забыть", могу добавить.<br />
:::::Приглашения - хорошо, но не стоит их рассылать сразу же всем, кто начинает править русские статьи. Надо хотя бы в течение недели смотреть на активность<br />
:::::-- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 05:04, 22 May 2014 (UTC)<br />
<br />
::::::Обсуждение закрыто. Далее все вопросы - на соответствующей странице [[Talk:ArchWiki Translation Team (Русский)]] -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 00:17, 23 May 2014 (UTC)<br />
<br />
K, fixed. Sorry! Learning experience.<br />
"Beginners' guide" sounds like "Beginnerses guide" while "Beginner's guide" sounds like "Beginners guide" (at least here in the US) so I changed it to the second so it is spelled as people would expect it to sound. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:58, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=319616Beginners' guide2014-06-13T20:56:25Z<p>Trusktr: Redirected page to Beginner's guide</p>
<hr />
<div>#REDIRECT [[Beginner's guide]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginner%27s_Guide&diff=319614Beginner's Guide2014-06-13T20:54:29Z<p>Trusktr: Redirected page to Beginner's guide</p>
<hr />
<div>#REDIRECT [[Beginner's guide]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginner%27s_guide&diff=319612Beginner's guide2014-06-13T20:52:31Z<p>Trusktr: </p>
<hr />
<div><br />
[[Category:Getting and installing Arch]]<br />
[[ar:Beginners' Guide]]<br />
[[bg:Beginners' Guide]]<br />
[[cs:Beginners' Guide]]<br />
[[da:Beginners' Guide]]<br />
[[de:Anleitung für Einsteiger]]<br />
[[el:Beginners' Guide]]<br />
[[es:Beginners' Guide]]<br />
[[fa:راهنمای تازهکارها]]<br />
[[fr:Installation]]<br />
[[he:Beginners' Guide]]<br />
[[hr:Beginners' Guide]]<br />
[[hu:Beginners' Guide]]<br />
[[id:Beginners' Guide]]<br />
[[it:Beginners' Guide]]<br />
[[ja:Beginners' Guide]]<br />
[[ko:Beginners' Guide]]<br />
[[lt:Beginners' Guide]]<br />
[[nl:Beginners' Guide]]<br />
[[pl:Beginners' Guide]]<br />
[[pt:Beginners' Guide]]<br />
[[ro:Ghidul începătorilor]]<br />
[[ru:Beginners' guide]]<br />
[[sk:Beginners' Guide]]<br />
[[sr:Beginners' Guide]]<br />
[[sv:Nybörjarguiden]]<br />
[[tr:Yeni başlayanlar rehberi]]<br />
[[uk:Beginners' Guide]]<br />
[[zh-CN:Beginners' guide]]<br />
[[zh-TW:Beginners' Guide]]<br />
{{Related articles start}}<br />
{{Related|:Category:Accessibility}}<br />
{{Related|Installation guide}}<br />
{{Related|Diskless System}}<br />
{{Related|Install from SSH}}<br />
{{Related|General recommendations}}<br />
{{Related|General Troubleshooting}}<br />
{{Related articles end}}<br />
This document will guide you through the process of installing [[Arch Linux]] using the [https://projects.archlinux.org/arch-install-scripts.git/ Arch Install Scripts]. Before installing, you are advised to skim over the [[FAQ]].<br />
<br />
The community-maintained [[Main page|ArchWiki]] is the primary resource that should be consulted if issues arise. The [[IRC Channel]] (irc://irc.freenode.net/#archlinux) and the [https://bbs.archlinux.org/ forums] are also excellent resources if an answer cannot be found elsewhere. In accordance with [[the Arch Way]], you are encouraged to type {{ic|man ''command''}} to read the {{ic|man}} page of any command you are unfamiliar with.<br />
<br />
== Preparation ==<br />
<br />
{{Note|If you wish to install from an existing GNU/Linux distribution, please see [[Install from Existing Linux]]. This can be useful particularly if you plan to install Arch via [[VNC]] or [[SSH]] remotely. Users seeking to perform the Arch Linux installation remotely via an [[SSH]] connection should read [[Install from SSH]] for additional tips.}}<br />
<br />
=== System requirements ===<br />
<br />
Arch Linux should run on any [[Wikipedia:P6 (microarchitecture)|i686]] compatible machine with a minimum of 64 MB RAM. A basic installation with all packages from the {{Grp|base}} group should take less than 800 MB of disk space. If you are working with limited space, this can be trimmed down considerably, but you will have to know what you are doing.<br />
<br />
=== Prepare the latest installation medium ===<br />
<br />
{{Note|ArchLinux image 2014_05 does not boot on a FAT32-filesystem, booting ARCH_2014_04 works fine (UEFI-mode). See {{Bug|40217}}}}<br />
<br />
The latest release of the installation media can be obtained from the [https://archlinux.org/download/ Download] page. Note that the single ISO image supports both 32 and 64-bit architectures. It is highly recommended to always use the latest ISO image.<br />
<br />
* Install images are signed and it is highly recommended to verify their signature before use. Dowload the ''.sig'' file from the download page (or one of the mirrors listed there) to the same directory as the ''.iso'' file. On Arch Linux, use {{ic|pacman-key -v ''iso-file''.sig}} as root; in other environments make use, still as root, of gpg2 directly with {{ic|gpg2 --verify ''iso-file''.sig}}. The file integrity checksums md5 and sha1 are also provided {{Note|The gpg2 verification will fail if you have not downloaded the public key corresponding to the RSA key ID. See http://sparewotw.wordpress.com/2012/10/31/how-to-verify-signature-using-sig-file/ for details}}<br />
* Burn the ISO image on a CD or DVD with your preferred software. On Arch, that is covered in [[Optical Disc Drive#Burning]] <br> {{Note|The quality of optical drives and the discs themselves varies greatly. Generally, using a slow burn speed is recommended for reliable burns. If you are experiencing unexpected behaviour from the disc, try burning at the lowest speed supported by your burner}}<br />
* Or you can write the ISO image to a USB stick. For detailed instructions, see [[USB Flash Installation Media]]<br />
<br />
==== Installing over the network ====<br />
<br />
Instead of writing the boot media to a disc or USB stick, you may alternatively boot the ISO image over the network. This works well when you already have a server set up. Please see the [[PXE]] article for more information, and then continue to [[#Boot the installation medium]].<br />
<br />
==== Install from an existing Linux system ====<br />
<br />
Alternatively, it is possible to install from an already running Linux system. See [[Install from Existing Linux]].<br />
<br />
==== Installing on a virtual machine ====<br />
<br />
Installing on a [[Wikipedia:Virtual machine|virtual machine]] is a good way to become familiar with Arch Linux and its installation procedure without leaving your current operating system and repartitioning the storage drive. It will also let you keep this Beginners' Guide open in your browser throughout the installation. Some users may find it beneficial to have an independent Arch Linux system on a virtual drive, for testing purposes.<br />
<br />
Examples of virtualization software are [[VirtualBox]], [[VMware]], [[QEMU]], [[Xen]], [[Parallels]].<br />
<br />
The exact procedure for preparing a virtual machine depends on the software, but will generally follow these steps:<br />
<br />
# Create the virtual disk image that will host the operating system.<br />
# Properly configure the virtual machine parameters.<br />
# Boot the downloaded ISO image with a virtual CD drive.<br />
# Continue with [[#Boot the installation medium|Boot the installation medium]].<br />
<br />
The following articles may be helpful:<br />
<br />
* [[VirtualBox#Installation steps for Arch Linux guests|Arch Linux as VirtualBox guest]]<br />
* [[VirtualBox Arch Linux Guest On Physical Drive|Arch Linux as VirtualBox guest on a physical drive]]<br />
* [[Installing Arch Linux in VMware|Arch Linux as VMware guest]]<br />
* [[Moving an existing install into (or out of) a virtual machine]]<br />
<br />
==== Boot the installation medium ====<br />
<br />
Most modern systems allow you to select the boot device during the [[Wikipedia:Power-on self test|POST]] phase, usually by pressing the {{ic|F12}} key while the BIOS splash screen is visible. Select the device which contains the Arch ISO. Alternatively, you may need to change the boot order in your computer's BIOS. <br />
To do this, press a key (usually {{ic|Delete}}, {{ic|F1}}, {{ic|F2}}, {{ic|F11}} or {{ic|F12}}) during the [[Wikipedia:Power-on self test|POST]] phase. This will take you into the BIOS settings screen where you can set the order in which the system searches for devices to boot from. Set the device which contains the Arch ISO as the first device from which boot is attempted. Select "Save & Exit" (or your BIOS's equivalent) and the computer should then complete its normal boot process.<br />
When the Arch menu appears, select "Boot Arch Linux" and press {{ic|Enter}} to enter the live environment where you will run the actual installation<br />
(if booting from a UEFI boot disk, the option may look more like "Arch Linux archiso x86_64 UEFI").<br />
<br />
===== Testing if you are booted into UEFI mode =====<br />
<br />
In case you have a [[Unified Extensible Firmware Interface|UEFI]] motherboard and UEFI Boot mode is enabled (and is preferred over BIOS/Legacy mode), the CD/USB will automatically launch Arch Linux via [[Gummiboot]]. To test if you have booted into UEFI mode, first make sure {{ic|efivars}} is mounted:<br />
<br />
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
<br />
Then run:<br />
<br />
# efivar -l<br />
<br />
If ''efivar'' lists the UEFI variables properly, then you have booted in UEFI mode. If not check whether all the requirements listed in [[Unified Extensible Firmware Interface#Requirements for UEFI Variables support to work properly|Unified Extensible Firmware Interface]] are met.<br />
<br />
==== Troubleshooting boot problems ====<br />
<br />
* If you are using an Intel video chipset and the screen goes blank during the boot process, the problem is likely an issue with [[Kernel mode setting]]. A possible workaround may be achieved by rebooting and pressing {{ic|e}} over the entry that you are trying to boot (i686 or x86_64). At the end of the string type {{ic|nomodeset}} and press {{ic|Enter}}. Alternatively, try {{ic|1=video=SVIDEO-1:d}} which, if it works, will not disable kernel mode setting. You can also try {{ic|1=i915.modeset=0}}. See the [[Intel]] article for more information.<br />
* If the screen does ''not'' go blank and the boot process gets stuck while trying to load the kernel, press {{ic|Tab}} while hovering over the menu entry, type {{ic|1=acpi=off}} at the end of the string and press {{ic|Enter}}.<br />
<br />
== Installation ==<br />
<br />
You are now presented with a shell prompt, automatically logged in as root. Your shell is [[Zsh]]; this will provide you advanced Tab completion, and other features as part of the [http://grml.org/zsh/ grml config].<br />
For editing text files, the console editor ''nano'' is suggested. If you are not familiar with it, see [[nano#nano usage]].<br />
If you have (or plan on having) a dual boot setup with Windows, see [[Windows and Arch Dual Boot]].<br />
<br />
=== Change the language ===<br />
<br />
{{Tip|These are optional for the majority of users. Useful only if you plan on writing in your own language in any of the configuration files, if you use diacritical marks in the Wi-Fi password, or if you would like to receive system messages (e.g. possible errors) in your own language.<br />
Changes here ''only'' affect the installation process.}}<br />
<br />
By default, the keyboard layout is set to {{ic|us}}. If you have a non-[[Wikipedia:File:KB United States-NoAltGr.svg|US]] keyboard layout, run:<br />
<br />
# loadkeys ''layout''<br />
<br />
...where ''layout'' can be {{ic|fr}}, {{ic|uk}}, {{ic|dvorak}}, {{ic|be-latin1}}, etc. See this [[Wikipedia:ISO 3166-1 alpha-2#Officially assigned code elements|wikipedia article]] for a 2-letter country code list. Use the command {{ic|localectl list-keymaps}} to list all available keymaps.<br />
<br />
If some glyphs of your language's alphabet (e.g. accented and non Latin letters) show up as white squares or as other symbols, you may want to change the console font with one from {{ic|/usr/share/kbd/consolefonts/}}. For example:<br />
<br />
# setfont lat9w-16<br />
<br />
You can run the {{ic|showconsolefonts}} command to display the full contents of the loaded font. Note that the font name is case-sensitive, so type it ''exactly'' as you see it. See [[Fonts#Console fonts]] for more information.<br />
<br />
By default, the language is set to English (US). If you would like to change the language for the install process ''(German, in this example)'', remove the {{ic|#}} in front of the [[locale]] you want from {{ic|/etc/locale.gen}}, along with English (US). Please choose the {{ic|UTF-8}} entries:<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
de_DE.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
# export LANG=de_DE.UTF-8<br />
<br />
=== Establish an internet connection ===<br />
<br />
{{Warning|As of [http://cgit.freedesktop.org/systemd/systemd/tree/NEWS?id&#61;dee4c244254bb49d1ffa8bd7171ae9cce596d2d0 v197], udev no longer assigns network interface names according to the ''wlanX'' and ''ethX'' naming scheme. If you are coming from a different distribution or are reinstalling Arch and not aware of the new interface naming style, please do not assume that your wireless interface is named ''wlan0'', or that your wired interface is named ''eth0''. You can use the command {{ic|ip link}} to discover the names of your interfaces.}}<br />
<br />
{{Note|Since the ISO released on 2014.04 (but maybe even on previous ones) there seems to be a problem in getting an IP address with DHCP if you are using the family of routers "FritzBox!". At this time models 7390[http://unix.stackexchange.com/questions/126526/archlinux-2014-04-64bit-and-connectivity-problem-during-instalation] and 7112[https://unix.stackexchange.com/questions/126694/enabling-wired-internet-connection-with-dhcp-during-arch-linux-installation/126709] seem to have this issue, but other models may be affected. The issue seems to be between the [[dhcpcd]] client and the FritzBox! routers and the way they assign IP addresses. The solution to the problem seems to be as follows: in your FritzBox! settings, manually delete the entry related to the IP address that identifies your machine. Also, disable the option "Assign always the same IP address to this machine". Now restart the DHCP process or simply reboot your computer and you should get an IP address as usual. If it does not work, try also to reboot your FritzBox!. Once your computer gets the IP address, you can re-enable the previously disabled option. }}<br />
<br />
The {{ic|dhcpcd}} network daemon starts automatically during boot and it will attempt to start a wired connection. Try to ping a server to see if a connection was established. For example, Google's webservers:<br />
<br />
{{hc|# ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms}}<br />
<br />
If you get a {{ic|ping: unknown host}} error, first check if there is an issue with your cable or wireless signal strength. If not, you will need to set up the network manually, as explained below. Once a connection is established move on to [[#Prepare the storage drive]].<br />
<br />
==== Wired ====<br />
<br />
Follow this procedure if you need to set up a wired connection via a static IP address.<br />
<br />
First, disable the dhcpcd service which was started automatically at boot:<br />
<br />
# systemctl stop dhcpcd.service<br />
<br />
Identify the name of your Ethernet interface.<br />
<br />
{{hc|# ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000<br />
link/ether 00:11:25:31:69:20 brd ff:ff:ff:ff:ff:ff<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000<br />
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
In this example, the Ethernet interface is {{ic|enp2s0f0}}. If you are unsure, your Ethernet interface is likely to start with the letter "e", and unlikely to be "lo" or start with the letter "w".<br />
<br />
You also need to know these settings:<br />
<br />
* Static IP address.<br />
* Subnet mask.<br />
* Gateway's IP address.<br />
* Name servers' (DNS) IP addresses.<br />
* Domain name (unless you are on a local LAN, in which case you can make it up).<br />
<br />
Activate the connected Ethernet interface (e.g. {{ic|enp2s0f0}}):<br />
<br />
# ip link set enp2s0f0 up<br />
<br />
Add the address:<br />
<br />
# ip addr add ''ip_address''/''mask_bits'' dev ''interface_name''<br />
<br />
For example:<br />
<br />
# ip addr add 192.168.1.2/24 dev enp2s0f0<br />
<br />
For more options, run {{ic|man ip}}.<br />
<br />
Add your gateway like this, substituting your own gateway's IP address:<br />
<br />
# ip route add default via ''ip_address''<br />
<br />
For example:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
Edit {{ic|resolv.conf}}, substituting your name servers' IP addresses and your local domain name:<br />
<br />
{{hc|# nano /etc/resolv.conf|<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com}}<br />
<br />
{{Note|Currently, you may include a maximum of three {{ic|nameserver}} lines. In order to overcome this limitation, you can use a locally caching nameserver like [[dnsmasq]]}}<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Network configuration]] page.<br />
<br />
==== Wireless ====<br />
<br />
Follow this procedure if you need wireless connectivity (Wi-Fi) during the installation process.<br />
<br />
First, identify the name of your wireless interface:<br />
<br />
{{hc|# iw dev|2=<br />
phy#0<br />
Interface wlp3s0<br />
ifindex 3<br />
wdev 0x1<br />
addr 00:11:22:33:44:55<br />
type managed<br />
}}<br />
<br />
In this example, {{ic|wlp3s0}} is the available wireless interface. If you are unsure, your wireless interface is likely to start with the letter "w", and unlikely to be "lo" or start with the letter "e". <br />
<br />
{{Note|If you do not see output similar to this, then your wireless driver has not been loaded. If this is the case, you must load the driver yourself. Please see [[Wireless network configuration]] for more detailed information.}}<br />
<br />
Now use [[netctl]]'s {{ic|wifi-menu}} to connect to a network:<br />
<br />
# wifi-menu wlp3s0<br />
<br />
You should now have a working network connection. If you do not, try [[#Without wifi-menu]] or check the detailed [[Wireless network configuration]] page.<br />
<br />
===== Without wifi-menu =====<br />
<br />
Bring the interface up with:<br />
<br />
# ip link set wlp3s0 up<br />
<br />
To verify that the interface is up, inspect the output of the following command:<br />
<br />
{{hc|# ip link show wlp3s0|<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000<br />
link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
The {{ic|UP}} in {{ic|<BROADCAST,MULTICAST,UP,LOWER_UP>}} is what indicates the interface is up, not the later {{ic|state DOWN}}.<br />
<br />
Most wireless chipsets require firmware in addition to a corresponding driver. The kernel tries to identify and load both automatically. If you get output like {{ic|SIOCSIFFLAGS: No such file or directory}}, this means you will need to manually load the firmware. If unsure, invoke {{ic|dmesg}} to query the kernel log for a firmware request from the wireless chipset. For example, if you have an Intel chipset which requires and has requested firmware from the kernel at boot:<br />
<br />
{{hc|# dmesg <nowiki>|</nowiki> grep firmware|<br />
firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
If there is no output, it may be concluded that the system's wireless chipset does not require firmware.<br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment (on CD/USB stick) '''but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it!''' Package installation is covered later in this guide. Ensure installation of both your wireless module and firmware before rebooting! See [[Wireless network configuration]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset.}}<br />
<br />
Next, scan for available networks using {{ic|iw dev wlp3s0 scan <nowiki>|</nowiki> grep SSID}}, then connect to a network with:<br />
<br />
# wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase "''ssid''" "''psk''")<br />
<br />
You need to replace ''ssid'' with the name of your network (e.g. "Linksys etc...") and ''psk'' with your wireless password, '''leaving the quotes around the network name and password'''.<br />
<br />
Finally, you have to give your interface an IP address. This can be set manually or using dhcp:<br />
<br />
# dhcpcd wlp3s0<br />
<br />
If that does not work, issue the following commands:<br />
<br />
# echo 'ctrl_interface=DIR=/run/wpa_supplicant' > /etc/wpa_supplicant.conf<br />
# wpa_passphrase ''ssid'' ''passphrase'' >> /etc/wpa_supplicant.conf<br />
# ip link set ''interface'' up<br />
# wpa_supplicant -B -D nl80211 -c /etc/wpa_supplicant.conf -i ''interface''<br />
# dhcpcd -A ''interface''<br />
<br />
Setting the interface up at step 3 may not be needed, but does no harm in any case.<br />
<br />
If ''wpa_supplicant'' complains about an unsupported driver at step 4, just leave out the {{ic|-D nl80211}} parameter:<br />
<br />
# wpa_supplicant -B -c /etc/wpa_supplicant.conf -i ''interface''<br />
<br />
==== Analog modem, ISDN, or PPPoE DSL ====<br />
<br />
For xDSL, dial-up, and ISDN connections, see [[Direct Modem Connection]].<br />
<br />
==== Behind a proxy server ====<br />
<br />
If you are behind a proxy server, you will need to export the {{ic|http_proxy}} and {{ic|ftp_proxy}} environment variables. See [[Proxy settings]] for more information.<br />
<br />
=== Prepare the storage drive ===<br />
<br />
{{Warning|Partitioning can destroy data. You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}<br />
{{Note|If you are installing to a USB flash key, see [[Installing Arch Linux on a USB key]].}}<br />
{{Tip|If you want to create any stacked block devices for [[LVM]], [[disk encryption]] or [[RAID]], do it now.}}<br />
<br />
==== Choose a partition table type ====<br />
<br />
You have to choose between [[GUID Partition Table]] (GPT) and [[Master Boot Record]] (MBR), see also [[Partitioning#Choosing between GPT and MBR]].<br />
<br />
* It is recommended to always use GPT for UEFI boot, as some UEFI firmwares do not allow UEFI-MBR boot.<br />
* Some BIOS systems may have issues with GPT. See http://mjg59.dreamwidth.org/8035.html and http://rodsbooks.com/gdisk/bios.html for more info and possible workarounds.<br />
<br />
==== Partitioning tool ====<br />
<br />
Absolute beginners are encouraged to use a graphical partitioning tool. [[GParted]] is a good example, and is [http://gparted.sourceforge.net/livecd.php provided as a live CD]. A drive should first be [[partitioning|partitioned]] and afterwards the partitions should be formatted with a [[File systems|file system]].<br />
<br />
While ''gparted'' may be easier to use, if you just want to create a few partitions on a new disk you can get the job done quickly by just using one of the [[Partitioning#Partitioning tools|fdisk variants]] which are included on the install medium. In the next section short usage instructions for both [[Partitioning#Gdisk usage summary|gdisk]] and [[Partitioning#Fdisk usage summary|fdisk]] follow.<br />
<br />
==== Erase partition table ====<br />
If you want to start from scratch, and do not intend to keep existing partitions, erase the partition table with the following command. This simplifies creating new partitions and avoids problems with converting disks from MBR to GPT and vice versa.<br />
<br />
# sgdisk --zap-all /dev/sda<br />
<br />
==== Partition scheme ====<br />
<br />
You can decide into how many partitions the disk should be split, and for which directory each partition should be used in the system. The mapping from partitions to directories (frequently called 'mount points') is the [[Partitioning#Partition scheme|Partition scheme]]. The simplest, and not a bad choice, is to make just one huge {{ic|/}} partition. Another popular choice is to have a {{ic|/}} and a {{ic|/home}} partition.<br />
<br />
'''Additional required partitions:'''<br />
* If you have a [[Unified Extensible Firmware Interface|UEFI]] motherboard, you will need to create an extra [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]].<br />
* If you have a BIOS motherboard (or plan on booting in BIOS compatibility mode) and you want to setup GRUB on a GPT-partitioned drive, you will need to create an extra [[GRUB#GUID Partition Table (GPT) specific instructions|BIOS Boot Partition]] of size 1 or 2 MiB and {{ic|EF02}} type code. Syslinux does not need one.<br />
* If you have a requirement for a [[Disk encryption]] of the system itself, this must be reflected in your partition scheme. It is unproblematic to add encrypted folders, containers or home directories after the system is installed.<br />
<br />
See [[Swap]] for details if you wish to set up a swap partition or swap file. A swap file is easier to resize than a partition and can be created at any point after installation, but cannot be used with a Btrfs filesystem.<br />
<br />
If you have already created your partitions, proceed to [[#Create filesystems]]. Otherwise, see the following example.<br />
<br />
==== Example ====<br />
<br />
The Arch Linux install media includes the following partitioning tools: {{ic|fdisk}}, {{ic|gdisk}}, {{ic|cfdisk}}, {{ic|cgdisk}} and {{ic|parted}}.<br />
<br />
{{Tip|Use the {{ic|lsblk -f}} or {{ic|lsblk -o NAME,FSTYPE,SIZE,LABEL}} command to list the hard disks attached to your system, along with the sizes of their existing partitions. This will help you to be confident you are partitioning the right disk.}}<br />
<br />
The example system will contain a 15 GB root partition, and a [[Partitioning#/home|home]] partition for the remaining space. Choose either MBR or GPT, as described above. Do not choose both!<br />
<br />
It should be emphasized that partitioning is a personal choice and that this example is only for illustrative purposes. See [[Partitioning]].<br />
<br />
===== Using cgdisk to create GPT partitions =====<br />
<br />
Launch ''cgdisk'' with:<br />
<br />
# cgdisk /dev/sda<br />
<br />
{{Tip|If cgdisk cannot change your disk to GPT, {{pkg|parted}} can.}}<br />
<br />
;Root:<br />
* Choose ''New'' (or press {{ic|N}}) – {{ic|Enter}} for the first sector (2048) – type in {{ic|15G}} – {{ic|Enter}} for the default hex code (8300) – {{ic|Enter}} for a blank partition name.<br />
<br />
;Home:<br />
* Press the down arrow a couple of times to move to the larger free space area.<br />
* Choose ''New'' (or press {{ic|N}}) – {{ic|Enter}} for the first sector – {{ic|Enter}} to use the rest of the drive (or you could type in the desired size; for example {{ic|30G}}) – {{ic|Enter}} for the default hex code (8300) – {{ic|Enter}} for a blank partition name.<br />
<br />
Here is what it should look like:<br />
<br />
Part. # Size Partition Type Partition Name<br />
----------------------------------------------------------------<br />
1007.0 KiB free space<br />
1 15.0 GiB Linux filesystem<br />
2 123.45 GiB Linux filesystem<br />
<br />
Double check and make sure that you are happy with the partition sizes as well as the partition table layout before continuing.<br />
<br />
If you would like to start over, you can simply select ''Quit'' (or press {{ic|Q}}) to exit without saving changes and then restart ''cgdisk''.<br />
<br />
If you are satisfied, choose ''Write'' (or press {{ic|Shift+W}}) to finalize and to write the partition table to the drive. Type {{ic|yes}} and choose ''Quit'' (or press {{ic|Q}}) to exit without making any more changes.<br />
<br />
===== Using fdisk to create MBR partitions =====<br />
{{Note|There is also ''cfdisk'', which is similar in UI to ''cgdisk'', but it currently does not automatically align the first partition properly. That is why the classic ''fdisk'' tool is used here.}}<br />
<br />
Launch ''fdisk'' with:<br />
<br />
# fdisk /dev/sda<br />
<br />
Create the partition table:<br />
<br />
* {{ic|Command (m for help):}} type {{ic|o}} and press {{ic|Enter}}<br />
<br />
Then create the first partition:<br />
<br />
# {{ic|Command (m for help):}} type {{ic|n}} and press {{ic|Enter}}<br />
# Partition type: {{ic|Select (default p):}} press {{ic|Enter}}<br />
# {{ic|Partition number (1-4, default 1):}} press {{ic|Enter}}<br />
# {{ic|First sector (2048-209715199, default 2048):}} press {{ic|Enter}}<br />
# {{ic|Last sector, +sectors or +size{K,M,G,T,P} (2048-209715199....., default 209715199):}} type {{ic|+15G}} and press {{ic|Enter}}<br />
<br />
Then create a second partition:<br />
<br />
# {{ic|Command (m for help):}} type {{ic|n}} and press {{ic|Enter}}<br />
# Partition type: {{ic|Select (default p):}} press {{ic|Enter}}<br />
# {{ic|Partition number (1-4, default 2):}} press {{ic|Enter}}<br />
# {{ic|First sector (31459328-209715199, default 31459328):}} press {{ic|Enter}}<br />
# {{ic|Last sector, +sectors or +size{K,M,G,T,P} (31459328-209715199....., default 209715199):}} press {{ic|Enter}}<br />
<br />
Now preview the new partition table:<br />
<br />
* {{ic|Command (m for help):}} type {{ic|p}} and press {{ic|Enter}}<br />
<br />
{{bc|<br />
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors<br />
Units &#61; sectors of 1 * 512 &#61; 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x5698d902<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 2048 31459327 15728640 83 Linux<br />
/dev/sda2 31459328 209715199 89127936 83 Linux<br />
}}<br />
<br />
Then write the changes to disk:<br />
<br />
* {{ic|Command (m for help):}} type {{ic|w}} and press {{ic|Enter}}<br />
<br />
If everything went well fdisk will now quit with the following message:<br />
{{bc|<br />
The partition table has been altered!<br />
<br />
Calling ioctl() to re-read partition table.<br />
Syncing disks. <br />
}}<br />
<br />
In case this does not work because ''fdisk'' encountered an error, you can use the {{ic|q}} command to exit.<br />
<br />
==== Create filesystems ====<br />
<br />
Simply partitioning is not enough; the partitions also need a [[File systems|filesystem]]. To format the partitions with an ext4 filesystem:<br />
<br />
{{Warning|Double check and triple check that it is actually {{ic|/dev/sda1}} and {{ic|/dev/sda2}} that you want to format. You can use {{ic|lsblk}} to help with this.}}<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda2<br />
<br />
If you have made a partition dedicated to swap (code 82), do not forget to format and activate it with:<br />
<br />
# mkswap /dev/sda''X''<br />
# swapon /dev/sda''X''<br />
<br />
For UEFI, you should format the EFI System Partition (for example /dev/sd''XY'') with:<br />
<br />
# mkfs.fat -F32 /dev/sd''XY''<br />
<br />
=== Mount the partitions ===<br />
<br />
Each partition is identified with a number suffix. For example, {{ic|sda1}} specifies the first partition of the first drive, while {{ic|sda}} designates the entire drive.<br />
<br />
To display the current partition layout:<br />
<br />
# lsblk -f<br />
<br />
{{Note|Do not mount more than one partition to the same directory. And pay attention, because the mounting order is important.}}<br />
<br />
First, mount the root partition on {{ic|/mnt}}. Following the example above (yours may be different), it would be:<br />
<br />
# mount /dev/sda1 /mnt<br />
<br />
Then mount the home partition and any other separate partition ({{ic|/boot}}, {{ic|/var}}, etc), if you have any:<br />
<br />
# mkdir /mnt/home<br />
# mount /dev/sda2 /mnt/home<br />
<br />
In case you have a UEFI motherboard, mount the EFI System Partition to {{ic|/boot}}. Whilst other mountpoints are viable, using {{ic|/boot}} is recommended as explained in the [[EFISTUB]] article.<br />
<br />
# mkdir /mnt/boot<br />
# mount /dev/sd''XY'' /mnt/boot<br />
<br />
=== Select a mirror ===<br />
<br />
You may want to edit the {{ic|mirrorlist}} file and place your preferred mirror first. A copy of this file will be installed on your new system by {{ic|pacstrap}} as well, so it is worth getting it right.<br />
<br />
{{hc|# nano /etc/pacman.d/mirrorlist|<br />
##<br />
## Arch Linux repository mirrorlist<br />
## Sorted by mirror score from mirror status page<br />
## Generated on 2012-MM-DD<br />
##<br />
<br />
<nowiki>Server = http://mirror.example.xyz/archlinux/$repo/os/$arch</nowiki><br />
...}}<br />
<br />
If you want, you can make it the ''only'' mirror available by deleting all other lines, but it is usually a good idea to have a few more, in case the first one goes offline.<br />
<br />
{{Tip|<br />
* Use the [https://www.archlinux.org/mirrorlist/ Mirrorlist Generator] to get an updated list for your country. HTTP mirrors are faster than FTP, because of something called [[Wikipedia:Keepalive|keepalive]]. With FTP, ''pacman'' has to send out a signal each time it downloads a package, resulting in a brief pause. For other ways to generate a mirror list, see [[Mirrors#Sorting mirrors|Sorting mirrors]] and [[Reflector]].<br />
* [https://archlinux.org/mirrors/status/ Arch Linux MirrorStatus] reports various aspects about the mirrors such as network problems with mirrors, data collection problems, the last time mirrors have been synced, etc.}}<br />
<br />
{{Note|<br />
* Whenever in the future you change your mirrorlist, refresh all package lists with {{ic|pacman -Syy}}, to ensure that the package lists are updated consistently. See [[Mirrors]] for more information.<br />
* If you are using an older installation medium, your mirrorlist might be outdated, which might lead to problems when updating Arch Linux (see {{Bug|22510}}). Therefore it is advised to obtain the latest mirror information as described above.<br />
* Some issues have been reported in the [https://bbs.archlinux.org/ Arch Linux forums] regarding network problems that prevent ''pacman'' from updating/synchronizing repositories (see [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] and [https://bbs.archlinux.org/viewtopic.php?id&#61;65728]). When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using "Host interface" instead of "NAT" in the machine properties.}}<br />
<br />
=== Install the base system ===<br />
<br />
The base system is installed using the ''pacstrap'' script. The {{ic|-i}} switch can be omitted if you wish to install every package from the {{Grp|base}} group without prompting. You may also want to include {{Grp|base-devel}}, as you will need these packages should you want to build packages from the [[AUR]] or using the [[ABS]]:<br />
<br />
# pacstrap -i /mnt base base-devel<br />
<br />
{{Note|<br />
* If ''pacstrap'' hangs with {{ic|error: failed retrieving file 'core.db' from mirror... : Connection time-out}}, yet your mirrors are configured correctly, try setting a different [[Resolv.conf|name server]].<br />
* If in the middle of the installation of base packages you get a request to import a PGP key, agree to download the key to proceed. This is likely to happen if the Arch ISO you are using is out of date.<br />
* If ''pacman'' fails to verify your packages, stop the process with {{ic|Ctrl+C}} and check the system time with {{ic|cal}}. If the system date is invalid (e.g. it shows the year 2010), signing keys will be considered expired (or invalid), signature checks on packages will fail and installation will be interrupted. Make sure to correct the system time, using the command {{ic|ntpd -qg}}, and retry running the ''pacstrap'' command. Refer to [[Time]] page for more information on correcting system time.<br />
* If ''pacman'' complains that {{ic|error: failed to commit transaction (invalid or corrupted package)}}, run the following command:<br />
# pacman-key --init && pacman-key --populate archlinux<br />
}}<br />
<br />
This will give you a basic Arch system. Other packages can be installed later using [[pacman]].<br />
<br />
=== Generate an fstab ===<br />
<br />
Generate an [[fstab]] file with the following command. UUIDs will be used because they have certain advantages (see [[fstab#Identifying filesystems]]). If you would prefer to use labels instead, replace the {{ic|-U}} option with {{ic|-L}}:<br />
<br />
# genfstab -U -p /mnt >> /mnt/etc/fstab<br />
# nano /mnt/etc/fstab<br />
<br />
{{Warning|The {{ic|fstab}} file should always be checked after generating it. If you encounter errors running ''genfstab'' or later in the install process, do '''not''' run ''genfstab'' again; just edit the {{ic|fstab}} file.}}<br />
<br />
A few considerations:<br />
<br />
* The last field determines the order in which partitions are checked at start up: use {{ic|1}} for the (non-{{ic|btrfs}}) root partition, which should be checked first; {{ic|2}} for all other partitions you want checked at start up; and {{ic|0}} means 'do not check' (see [[fstab#Field definitions]]).<br />
* All [[btrfs]] partitions should have {{ic|0}} for this field. Normally, you will also want your ''swap'' partition to have {{ic|0}}.<br />
<br />
=== Chroot and configure the base system ===<br />
<br />
Next, [[Change Root|chroot]] into your newly installed system:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
{{Note|Leave out {{ic|/bin/bash}} to chroot into the sh shell.}}<br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system. These can either be created if they do not exist, or edited if you wish to change the defaults.<br />
<br />
Closely following and understanding these steps is of key importance to ensure a properly configured system.<br />
<br />
==== Locale ====<br />
<br />
Locales are used by '''glibc''' and other locale-aware programs or libraries for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. There are two files that need editing: {{ic|locale.gen}} and {{ic|locale.conf}}.<br />
<br />
The {{ic|locale.gen}} file has everything commented out by default. To uncomment a line remove the {{ic|#}} in the front. Using {{ic|UTF-8}} is highly recommended over {{ic|ISO-8859}}:<br />
{{hc|# nano /etc/locale.gen|<br />
...<br />
#en_SG ISO-8859-1<br />
en_US.UTF-8 UTF-8<br />
#en_US ISO-8859-1<br />
...<br />
}}<br />
<br />
Generate the locale(s) specified in {{ic|/etc/locale.gen}}:<br />
<br />
# locale-gen<br />
<br />
{{Note|This will also run with every update of '''glibc'''.}}<br />
<br />
Create the {{ic|/etc/locale.conf}} file substituting your chosen locale:<br />
<br />
# echo LANG=en_US.UTF-8 > /etc/locale.conf<br />
<br />
{{Note|<br />
* The locale specified in the {{ic|LANG}} variable must be uncommented in {{ic|/etc/locale.gen}}.<br />
* The {{ic|locale.conf}} file does not exist by default. Setting only {{ic|LANG}} should be enough as it will act as the default value for all other variables.<br />
}}<br />
<br />
Export substituting your chosen locale:<br />
<br />
# export LANG=en_US.UTF-8<br />
<br />
{{Tip|To use other locales for other {{ic|LC_*}} variables, run {{ic|locale}} to see the available options and add them to {{ic|locale.conf}}. It is not recommended to set the {{ic|LC_ALL}} variable. See [[Locale#Setting the locale system-wide]] for details.}}<br />
<br />
==== Console font and keymap ====<br />
<br />
If you changed the default console keymap and font in [[#Change the language]], you will have to edit {{ic|/etc/vconsole.conf}} ''accordingly'' (create it if it does not exist) to make those changes persist in the installed system, for example:<br />
<br />
{{hc|# nano /etc/vconsole.conf|2=<br />
KEYMAP=de-latin1<br />
FONT=lat9w-16<br />
}}<br />
<br />
{{Warning|If you set {{ic|KEYMAP}} to a different value than the one you initially set with ''loadkeys'', and then you [[#Set the root password]], you may have problems logging into the new system after rebooting, because some keys may be mapped differently between the two layouts.}}<br />
<br />
Note that these settings are only valid for your virtual consoles, not in [[Xorg]]. See [[Fonts#Console fonts]] for more information.<br />
<br />
==== Time zone ====<br />
<br />
Available time zones and subzones can be found in the {{ic|/usr/share/zoneinfo/''Zone''/''SubZone''}} directories.<br />
<br />
To view the available zones, check the directory {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Similarly, you can check the contents of directories belonging to a subzone:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Create a symbolic link {{ic|/etc/localtime}} to your subzone file {{ic|/usr/share/zoneinfo/''Zone''/''SubZone''}} using this command:<br />
<br />
# ln -s /usr/share/zoneinfo/''Zone''/''SubZone'' /etc/localtime<br />
<br />
'''Example:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime<br />
<br />
==== Hardware clock ====<br />
<br />
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.<br />
<br />
You can generate {{ic|/etc/adjtime}} automatically by using one of the following commands:<br />
<br />
* '''UTC''' (recommended): {{Note|Using [[Wikipedia:Coordinated Universal Time|UTC]] for the hardware clock does not mean that software will display time in UTC.}} {{bc|# hwclock --systohc --utc}}<br />
* '''localtime''' (discouraged; used by default in Windows): {{Warning|Using ''localtime'' may lead to several known and unfixable bugs. However, there are no plans to drop support for ''localtime''.}} {{bc|# hwclock --systohc --localtime}}<br />
<br />
==== Kernel modules ====<br />
<br />
{{Tip|This is just an example, you do not need to set it. All needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.}}<br />
<br />
For kernel modules to load during boot, place a {{ic|*.conf}} file in {{ic|/etc/modules-load.d/}}, with a name based on the program that uses them:<br />
<br />
{{hc|# nano /etc/modules-load.d/virtio-net.conf|<br />
# Load 'virtio-net.ko' at boot.<br />
<br />
virtio-net<br />
}}<br />
<br />
If there are more modules to load per {{ic|*.conf}}, the module names can be separated by newlines. A good example are the [[VirtualBox#Installation steps for Arch Linux guests|VirtualBox Guest Additions]].<br />
<br />
Empty lines and lines starting with {{ic|#}} or {{ic|;}} are ignored.<br />
<br />
==== Hostname ====<br />
<br />
Set the [[Wikipedia:Hostname|hostname]] to your liking (e.g. ''arch''):<br />
<br />
# echo ''myhostname'' > /etc/hostname<br />
<br />
Add the same hostname to {{ic|/etc/hosts}}:<br />
<br />
{{hc|# nano /etc/hosts|<br />
#<br />
# /etc/hosts: static lookup table for host names<br />
#<br />
<br />
#<ip-address> <hostname.domain.org> <hostname><br />
127.0.0.1 localhost.localdomain localhost ''myhostname''<br />
::1 localhost.localdomain localhost<br />
<br />
# End of file}}<br />
<br />
=== Configure the network ===<br />
<br />
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described [[#Establish an internet connection|above]], except we are going to make it persistent and automatically run at boot.<br />
<br />
{{Note|<br />
* For more in-depth information on network configration, visit [[Network configuration]] and [[Wireless network configuration]].<br />
* If you would like to use the old interface naming scheme (ie. eth* and wlan*) you can accomplish this by creating an empty file at {{ic|/etc/udev/rules.d/80-net-setup-link.rules}} which will mask the file of the same name located under {{ic|/usr/lib/udev/rules.d}}.<br />
}}<br />
<br />
==== Wired ====<br />
<br />
===== Dynamic IP =====<br />
<br />
; Using dhcpcd<br />
<br />
If you only use a single fixed wired network connection, you do not need a network management service and can simply enable the {{ic|dhcpcd}} service:<br />
<br />
# systemctl enable dhcpcd.service<br />
<br />
{{Note|If it does not work, use: {{ic|# systemctl enable dhcpcd@''interface_name''.service}} }}<br />
<br />
; Using netctl<br />
<br />
Copy a sample profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/ethernet-dhcp my_network<br />
<br />
Edit the profile as needed (update {{ic|Interface}} from {{ic|eth0}} to match network adapter ID as shown by running {{ic|ip link}}):<br />
<br />
# nano my_network<br />
<br />
Enable the {{ic|my_network}} profile:<br />
<br />
# netctl enable my_network<br />
<br />
{{Note|You will get the message "Running in chroot, ignoring request.". This can be ignored for now.}}<br />
<br />
; Using netctl-ifplugd<br />
<br />
{{Warning|You cannot use this method in conjunction with explicitly enabling profiles, such as {{ic|netctl enable ''profile''}}.}}<br />
<br />
Alternatively, you can use {{ic|netctl-ifplugd}}, which gracefully handles dynamic connections to new networks.<br />
<br />
Install {{Pkg|ifplugd}}, which is required for {{ic|netctl-ifplugd}}:<br />
<br />
# pacman -S ifplugd<br />
<br />
Then enable for interface that you want:<br />
<br />
# systemctl enable netctl-ifplugd@''interface''.service<br />
<br />
{{Tip|[[netctl]] also provides {{ic|netctl-auto}}, which can be used to handle wired profiles in conjunction with {{ic|netctl-ifplugd}}.}}<br />
<br />
===== Static IP =====<br />
<br />
; Using netctl<br />
<br />
Copy a sample profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/ethernet-static my_network<br />
<br />
Edit the profile as needed (modify {{ic|Interface}}, {{ic|Address}}, {{ic|Gateway}} and {{ic|DNS}}):<br />
<br />
# nano my_network<br />
<br />
Notice the {{ic|/24}} in {{ic|Address}} which is the [[wikipedia:Classless Inter-Domain Routing#CIDR notation|CIDR notation]] of a {{ic|255.255.255.0}} netmask.<br />
<br />
Enable above created profile to start it at every boot:<br />
<br />
# netctl enable my_network<br />
<br />
; Using systemd-networkd<br />
<br />
See [[systemd-networkd]].<br />
<br />
==== Wireless ====<br />
<br />
{{Note|If your wireless adapter requires a firmware (as described in the above [[#Wireless|Establish an internet connection]] section and also in the article [[Wireless network configuration#Device driver]]), install the package containing your firmware. Most of the time, the {{Pkg|linux-firmware}} package will contain the needed firmware. Though for some devices, the required firmware might be in its own package. For example:<br />
{{bc|# pacman -S zd1211-firmware}}<br />
See [[Wireless network configuration#Installing driver/firmware]] for more info.}}<br />
<br />
Install {{Pkg|iw}} and {{Pkg|wpa_supplicant}} which you will need to connect to a network:<br />
<br />
# pacman -S iw wpa_supplicant<br />
<br />
===== Adding wireless networks =====<br />
<br />
; Using wifi-menu<br />
<br />
Install {{Pkg|dialog}}, which is required for {{ic|wifi-menu}}:<br />
<br />
# pacman -S dialog<br />
<br />
After finishing the rest of this installation and rebooting, you can connect to the network with {{ic|wifi-menu ''interface_name''}} (where {{ic|''interface_name''}} is the interface of your wireless chipset).<br />
<br />
# wifi-menu ''interface_name''<br />
<br />
{{Warning|This must be done '''after''' your reboot when you are no longer chrooted. The process spawned by this command will conflict with the one you have running outside of the chroot. Alternatively, you could just configure a network profile manually using the following templates so that you do not have to worry about using {{ic|wifi-menu}} at all.}}<br />
<br />
; Using manual netctl profiles<br />
<br />
Copy a network profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/wireless-wpa my-network<br />
<br />
Edit the profile as needed (modify {{ic|Interface}}, {{ic|ESSID}} and {{ic|Key}}):<br />
<br />
# nano my-network<br />
<br />
Enable above created profile to start it at every boot:<br />
<br />
# netctl enable my-network<br />
<br />
===== Connect automatically to known networks =====<br />
<br />
{{Warning|You cannot use this method in conjunction with explicitly enabling profiles, such as {{ic|netctl enable ''profile''}}.}}<br />
<br />
Install {{Pkg|wpa_actiond}}, which is required for {{ic|netctl-auto}}:<br />
<br />
# pacman -S wpa_actiond<br />
<br />
Enable the {{ic|netctl-auto}} service, which will connect to known networks and gracefully handle roaming and disconnects:<br />
<br />
# systemctl enable netctl-auto@''interface_name''.service<br />
<br />
{{Tip|[[netctl]] also provides {{ic|netctl-ifplugd}}, which can be used to handle wired profiles in conjunction with {{ic|netctl-auto}}.}}<br />
<br />
==== Analog modem, ISDN or PPPoE DSL ====<br />
<br />
For xDSL, dial-up and ISDN connections, see [[Direct Modem Connection]].<br />
<br />
=== Create an initial ramdisk environment ===<br />
<br />
{{Tip|Most users can skip this step and use the defaults provided in {{ic|mkinitcpio.conf}}. The initramfs image (from the {{ic|/boot}} folder) has already been generated based on this file when the {{Pkg|linux}} package (the Linux kernel) was installed earlier with ''pacstrap''}}<br />
<br />
Here you need to set the right [[Mkinitcpio#HOOKS|hooks]] if the root is on a USB drive, if you use RAID, LVM, or if {{ic|/usr}} is on a separate partition.<br />
<br />
Edit {{ic|/etc/mkinitcpio.conf}} as needed and re-generate the initramfs image with:<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Note|Arch VPS installations on QEMU (e.g. when using {{ic|virt-manager}}) may need {{ic|virtio}} modules in {{ic|mkinitcpio.conf}} to be able to boot.<br />
<br />
{{hc|# nano /etc/mkinitcpio.conf|2=<br />
MODULES="virtio virtio_blk virtio_pci virtio_net"<br />
}}<br />
}}<br />
<br />
=== Set the root password ===<br />
<br />
Set the root password with:<br />
<br />
# passwd<br />
<br />
=== Install and configure a bootloader ===<br />
<br />
==== For BIOS motherboards ====<br />
<br />
For BIOS systems, several boot loaders are available, see [[Boot loaders]] for a complete list. Choose one as per your convenience. Here, two of the possibilities are given as examples:<br />
<br />
* [[Syslinux]] is (currently) limited to loading only files from the partition where it was installed. Its configuration file is considered to be easier to understand. An example configuration can be found in the [[Syslinux#Examples|syslinux]] article.<br />
* [[GRUB]] is more feature-rich and supports more complex scenarios. Its configuration file(s) is more similar to 'sh' scripting language, which may be difficult for beginners to manually write. It is recommended that they automatically generate one.<br />
<br />
===== Syslinux =====<br />
<br />
If you opted for a GUID partition table (GPT) for your hard drive earlier, you need to install the {{Pkg|gptfdisk}} package now for the installation of ''syslinux'' to work:<br />
<br />
# pacman -S gptfdisk<br />
<br />
Install the {{Pkg|syslinux}} package and then use the {{ic|syslinux-install_update}} script to automatically ''install'' the bootloader ({{ic|-i}}), mark the partition ''active'' by setting the boot flag ({{ic|-a}}), and install the ''MBR'' boot code ({{ic|-m}}):<br />
<br />
# pacman -S syslinux<br />
# syslinux-install_update -iam<br />
<br />
After installing Syslinux, configure {{ic|syslinux.cfg}} to point to the right root partition. This step is vital. If it points to the wrong partition, Arch Linux will not boot. Change {{ic|/dev/sda3}} to reflect your root partition ''(if you partitioned your drive as in [[#Prepare the storage drive|the example]], your root partition is {{ic|/dev/sda1}})'':<br />
<br />
{{hc|# nano /boot/syslinux/syslinux.cfg|2=<br />
...<br />
LABEL arch<br />
...<br />
APPEND root='''/dev/sda3''' rw<br />
...<br />
}}<br />
<br />
Do the same for the fallback entry.<br />
<br />
For more information on configuring and using Syslinux, see [[Syslinux]].<br />
<br />
===== GRUB =====<br />
<br />
Install the {{Pkg|grub}} package and then run {{ic|grub-install}} to install the bootloader:<br />
<br />
# pacman -S grub<br />
# grub-install --target=i386-pc --recheck '''/dev/sda'''<br />
<br />
{{Note|<br />
* Change {{ic|/dev/sda}} to reflect the drive you installed Arch on. Do not append a partition number (do not use {{ic|sda''X''}}).<br />
* For GPT-partitioned drives on BIOS motherboards, you also need a "BIOS Boot Partition". See [[GRUB#GUID Partition Table (GPT) specific instructions|GPT-specific instructions]] in the GRUB page.<br />
* A sample {{ic|/boot/grub/grub.cfg}} gets installed as part of the {{Pkg|grub}} package, and subsequent {{ic|grub-*}} commands may not over-write it. Ensure that your intended changes are in {{ic|grub.cfg}}, rather than in {{ic|grub.cfg.new}} or some such file.<br />
}}<br />
<br />
While using a manually created {{ic|grub.cfg}} is absolutely fine, it is recommended that beginners automatically generate one:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, install {{Pkg|os-prober}} ({{ic|pacman -S os-prober}}) before running the next command.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|It is possible that multiple redundant menu entries will be generated. See [[GRUB#Redundant_menu_entries]].}}<br />
<br />
For more information on configuring and using GRUB, see [[GRUB]].<br />
<br />
==== For UEFI motherboards ====<br />
<br />
For UEFI systems, several boot loaders are available, see [[Boot loaders]] for a complete list. Choose one as per your convenience. Here, two of the possibilities are given as examples:<br />
<br />
* [[gummiboot]] is a minimal UEFI Boot Manager which provides a menu for [[EFISTUB]] kernels and other UEFI applications.<br />
* [[GRUB]] is a more complete bootloader, useful if you run into problems with Gummiboot.<br />
<br />
{{Note|For UEFI boot, the drive needs to be GPT-partitioned and an [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]] (512 MiB or larger, gdisk type {{ic|EF00}}, formatted with FAT32) must be present. In the following examples, this partition is assumed to be mounted at {{ic|/boot}}. If you have followed this guide from the beginning, you have already done all of these.}}<br />
<br />
===== Gummiboot =====<br />
<br />
First make sure {{ic|efivars}} is mounted:<br />
<br />
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
<br />
Then install the {{Pkg|gummiboot}} package and run {{ic|gummiboot install}} to install the bootloader to the EFI System Partition:<br />
<br />
# pacman -S gummiboot<br />
# gummiboot install<br />
<br />
{{Warning|Gummiboot and the Linux Kernel will not automatically update if your EFI partition is not mounted at {{ic|/boot}}}}<br />
<br />
You will need to manually create a configuration file to add an entry for Arch Linux to the gummiboot manager. Create {{ic|/boot/loader/entries/arch.conf}} and add the following contents, replacing {{ic|/dev/sdaX}} with your '''root''' partition, usually {{ic|/dev/sda2}}:<br />
<br />
{{hc|# nano /boot/loader/entries/arch.conf|2=<br />
title Arch Linux<br />
linux /vmlinuz-linux<br />
initrd /initramfs-linux.img<br />
options root='''/dev/sdaX''' rw<br />
}}<br />
<br />
For more information on configuring and using gummiboot, see [[gummiboot]].<br />
<br />
===== GRUB =====<br />
<br />
First make sure {{ic|efivars}} is mounted:<br />
<br />
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
<br />
Then install the {{Pkg|grub}} and {{Pkg|efibootmgr}} packages and run {{ic|grub-install}} to install the bootloader:<br />
<br />
# pacman -S grub efibootmgr<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck<br />
<br />
Next, while using a manually created {{ic|grub.cfg}} is absolutely fine, it is recommended that beginners automatically generate one:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, install {{Pkg|os-prober}} before running the next command. However ''os-prober'' is not known to properly detect UEFI OSes.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For more information on configuring and using GRUB, see [[GRUB]].<br />
<br />
=== Unmount the partitions and reboot ===<br />
<br />
Exit from the chroot environment:<br />
<br />
# exit<br />
<br />
Since the partitions are mounted under {{ic|/mnt}}, use the following command to unmount them:<br />
<br />
# umount -R /mnt<br />
<br />
Reboot the computer:<br />
<br />
# reboot<br />
<br />
{{Tip|Be sure to remove the installation media, otherwise you will boot back into it.}}<br />
<br />
== Post-installation ==<br />
<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready to be built into whatever you wish or require for your purposes. You are now ''strongly'' advised to read [[General recommendations#System administration]] and [[General recommendations#Package management]].<br />
<br />
See the rest of the [[General recommendations]] article for post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
For a list of applications that may be of interest, see [[List of applications]].</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Alad&diff=319604User talk:Alad2014-06-13T20:46:12Z<p>Trusktr: </p>
<hr />
<div>I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide" [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:41, 13 June 2014 (UTC)<br />
<br />
I'm trying to figure out how to fix it. Sorry! This is a learning experience. [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:46, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginner%27s_guide&diff=319599Beginner's guide2014-06-13T20:44:35Z<p>Trusktr: Redirected page to Beginner's Guide</p>
<hr />
<div>#REDIRECT [[Beginner's Guide]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginners%27_Guide&diff=319597Beginners' Guide2014-06-13T20:43:42Z<p>Trusktr: Undo revision 319589 by Trusktr (talk)</p>
<hr />
<div>#REDIRECT [[Beginner's Guide]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Alad&diff=319596User talk:Alad2014-06-13T20:41:40Z<p>Trusktr: Created page with "I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :( I was trying to make it "Beginner's Guide" ~~~~"</p>
<hr />
<div>I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide" [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:41, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Trusktr&diff=319595User talk:Trusktr2014-06-13T20:41:16Z<p>Trusktr: /* Redirect */</p>
<hr />
<div>Thank you for your recent contributions to the wiki. However, please remember to write objectively at all times. Avoid claims such as "method X is easier/better than Y." Instead, provide reasons why one user may consider method X over Y and vice versa; let the user decide how to manage their own system. Maintain a formal tone. Please avoid slang and emoticons in wiki articles. Thanks,<br />
<br />
-- [[User:Pointone|pointone]] 20:01, 30 August 2010 (EDT)<br />
<br />
Thanks pointone, I'm glad to be able to contribute. II will edit my additions so that they are not biased as you've suggested.<br />
<br />
[[User:Trusktr|Trusktr]] 01:59, 31 August 2010 (EDT)<br />
<br />
== MATE edits ==<br />
Home page of environment refers to it as "MATE". Was it renamed to lowercase? Also you have broken i18n by replacing name in template. --[[User:AlexanderR|AlexanderR]] 13:43, 2 May 2012 (UTC)<br />
<br />
== Redirect ==<br />
<br />
What's up with those Beginner's guide/guidee redirects? :-/ --[[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:40, 13 June 2014 (UTC)<br />
<br />
I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide". [[User:Trusktr|Trusktr]] ([[User talk:Trusktr|talk]]) 20:41, 13 June 2014 (UTC)</div>Trusktrhttps://wiki.archlinux.org/index.php?title=User_talk:Trusktr&diff=319594User talk:Trusktr2014-06-13T20:41:06Z<p>Trusktr: </p>
<hr />
<div>Thank you for your recent contributions to the wiki. However, please remember to write objectively at all times. Avoid claims such as "method X is easier/better than Y." Instead, provide reasons why one user may consider method X over Y and vice versa; let the user decide how to manage their own system. Maintain a formal tone. Please avoid slang and emoticons in wiki articles. Thanks,<br />
<br />
-- [[User:Pointone|pointone]] 20:01, 30 August 2010 (EDT)<br />
<br />
Thanks pointone, I'm glad to be able to contribute. II will edit my additions so that they are not biased as you've suggested.<br />
<br />
[[User:Trusktr|Trusktr]] 01:59, 31 August 2010 (EDT)<br />
<br />
== MATE edits ==<br />
Home page of environment refers to it as "MATE". Was it renamed to lowercase? Also you have broken i18n by replacing name in template. --[[User:AlexanderR|AlexanderR]] 13:43, 2 May 2012 (UTC)<br />
<br />
== Redirect ==<br />
<br />
What's up with those Beginner's guide/guidee redirects? :-/ --[[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:40, 13 June 2014 (UTC)<br />
<br />
I'm sorry, I was trying to change the capitalization of the title, but I've made a mess. :(<br />
<br />
I was trying to make it "Beginner's Guide".</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Talk:Beginners%27_Guide&diff=319591Talk:Beginners' Guide2014-06-13T20:37:55Z<p>Trusktr: Trusktr moved page Talk:Beginners' guide to Talk:Beginners' Guide over redirect</p>
<hr />
<div>#REDIRECT [[Talk:Beginner's guide]]</div>Trusktrhttps://wiki.archlinux.org/index.php?title=Beginners%27_Guide&diff=319589Beginners' Guide2014-06-13T20:37:55Z<p>Trusktr: Trusktr moved page Beginners' guide to Beginners' Guide over redirect</p>
<hr />
<div>#REDIRECT [[Beginner's guide]]</div>Trusktr