https://wiki.archlinux.org/api.php?action=feedcontributions&user=Iv597&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:53:58ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Mac&diff=391413Mac2015-08-17T01:47:25Z<p>Iv597: Cleaned up trackpad/keyboard related bits on 2015 rMBP 12,x models</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[ja:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Related articles start}}<br />
{{Related|Installation guide}}<br />
{{Related|Beginners' guide}}<br />
{{Related|General recommendations}}<br />
{{Related|MacBook4,2 (late 2008)}}<br />
{{Related|MacBook5,2 (early-mid 2009)}}<br />
{{Related|MacBookPro7,1}}<br />
{{Related|MacBookPro8,1/8,2/8,3 (2011)}}<br />
{{Related|MacBookPro9,2 (Mid-2012)}}<br />
{{Related|MacBookPro10,x}}<br />
{{Related|MacBookPro11,x}}<br />
{{Related|iMac Aluminum}}<br />
{{Related|Apple Fusion Drive}}<br />
{{Related articles end}}<br />
<br />
Installing Arch Linux on a MacBook (Air/Pro) is quite similar to installing it on any other computer. However, due to the specific hardware configuration on a MacBook, there are a few deviations and special considerations which warrant a separate guide. For more background information, please see the [[Installation guide]], [[Beginners' guide]] and [[UEFI]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. Please see 'related' pages (on the top right of this page) for model-specific tips and troubleshooting.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Updating OS X|Update OS X]]''': It always helps to start from a clean, backed up, and up-to-date install of OS X.<br />
# '''[[#Partitions|Partition]]''': Resizing or deleting the OS X partition to create partitions for Arch Linux.<br />
# '''[[#Setup bootloader|Setup bootloader]]''': Making sure that the new partition is bootable.<br />
# '''[[#Installation|Install Arch Linux]]''': Actually installing Arch Linux.<br />
# '''[[#Post-installation|Post-installation]]''': MacBook-specific configuration.<br />
<br />
== Updating OS X ==<br />
<br />
{{Note|If you uninstalled OS X or want to reinstall it, do that first. [http://www.apple.com Apple] has great instructions.}}<br />
In OS X, '''install every update''' (in the App Store). '''Reboot''' your computer, and then '''update again''' to make sure that you installed everything.<br />
<br />
* If you plan to remove OS X completely, make backups of these files, which you will need in Linux for adjusting the [[#Color Profile|color profile]]:<br />
{{Note|It is advisable to keep OS X, because the firmware can only be updated using OS X.}}<br />
<br />
/Library/ColorSync/Profiles/Displays/<FILES HERE><br />
<br />
You will also need the following file for iSight functionality:<br />
{{Note|This does not apply to devices using the FaceTime HD webcam (MacBookAir5,1/5,2/6,1/6,2), because the webcam is not yet supported by the Linux kernel.}}<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
* If you plan to dual boot and want to keep OS X, continue to [[#Partitions]]<br />
<br />
== Partitions ==<br />
<br />
The next step in the installation is to re-partition the hard drive. If OS X was installed using the typical procedure, then your drive should have a GPT format and the following partitions:<br />
<br />
* '''EFI''': a 200 MB partition at the beginning of the disk. It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''.<br />
* '''OS X''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
* '''Recovery''': A recovery partition (only for OS X 10.7+).<br />
<br />
{{Note|If your hardware includes a Fusion Drive you might have a look at the [[Apple Fusion Drive]] page.}}<br />
<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* Single boot: [[#Arch Linux only]]<br />
* Dual boot: [[#OS X with Arch Linux]] ''(recommended so you can still return to OS X when needed)''<br />
* Triple boot: [[#OS X, Windows XP, and Arch Linux triple boot]]<br />
<br />
----<br />
<br />
=== Arch Linux only ===<br />
<br />
This situation is the easiest to deal with. Partitioning is the same as any other hardware that Arch Linux can be installed on.<br />
<br />
The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in OS X before continuing further. The MacBook firmware relies on the value in OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machine's firmware unless you use an external drive to boot OS X.<br />
You can boot in EFI mode (recommended) or bios-compatibility mode, if in doubt choose EFI.<br />
<br />
==== Option 1: EFI (recommended) ====<br />
<br />
* Run '''cgdisk''' ({{Pkg|gptfdisk}} package).<br />
* Create the necessary partitions.<br />
<br />
{{Note|<br />
* The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]]. You'll need a swap partition/file if you expect to [[Suspend and hibernate|Hibernate]] your machine in future.<br />
* For more information on partitioning, see [[Beginners' guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].<br />
* As of Aug 2014 {{pkg|refind-efi}} has a bug that does not allow to run {{ic|refind-install}} if EFI partition is mounted to {{ic|/boot}}. Other bootloaders (like {{pkg|gummiboot}}) have no such problem and thus there is no need to split {{ic|/boot/efi}} from {{ic|/boot}}.<br />
}}<br />
Simple example (no LVM, crypto):<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 /boot 100MiB ext2 boot<br />
/dev/sda3 - adjust swap swap<br />
/dev/sda4 / 10GiB ext4 root<br />
/dev/sda5 /home remain. ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''parted'''. The simplest way is to change the partition table to '''msdos''' and then partition as normal. GRUB is compatible with GPT.<br />
<br />
* Create the necessary partitions.<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
=== OS X with Arch Linux ===<br />
<br />
The easiest way to partition your hard drive, so that OS X and Arch Linux will co-exist, is to use partitioning tools in OS X and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility.app''' (located in {{ic|/Applications/Utilities}})<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''Volume scheme'''.<br />
<br />
* Decide how much space you wish to have for your OS X partition, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, in the size box, type the smaller size to which you want to resize your OS X partition, and click '''Apply'''. This will create a new partition out of the empty space. You will delete this partition later.<br />
<br />
{{Note|If you wish to have a shared partition between OS X and Arch Linux, then additional steps will need to happen here. Please see [[#HFS partition sharing]].}}<br />
<br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
{{Note|If you have any problems, try using the [http://gparted.sourceforge.net/ gparted] live CD (i.e. ''instead'' of using Disk Utility and/or cgdisk). It is capable of shrinking the OS X partition and creating Linux partitions ready for installation.}}<br />
<br />
* Boot the Arch installation [[Beginners'_guide#Prepare_the_latest_installation_medium|LiveCD]] or [[USB flash installation media|LiveUSB]] by holding down the alt key '''during boot'''. Follow '''one''' of the procedures below according to your choice of boot method.<br />
<br />
==== Option 1: EFI ====<br />
<br />
* Run '''cgdisk'''<br />
<br />
* Delete the partition you made in Disk Utility.app and create the necessary partitions for Arch Linux. OS X likes to see a 128 MiB gap after partitions, so when you create the first partition after the last OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. A simple example (no LVM, crypto):<br />
{{Note|<br />
* The swap partition is optional on machines with 4GB of RAM or more. A '''[[Swap#Swap file|swap file]]''' can be created later.<br />
* The easiest dual-boot option is to install rEFInd from inside OS X, to its root directory (default for install.sh). Following that, copy the driver folder from the installation tarball into the new rEFInd location, and uncomment the lines "scan_all_linux_kernels" and "also_scan_dirs" options in refind.conf. Configuration of boot options can then be done from a refind_linux.conf in Arch's /boot directory.<br />
* If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use OS X to format it in Disk Utility.app afterwards). Follow the GRUB EFI install procedure, and mount your {{ic|/boot/efi}} directory to the hfs+ partition you created. Finally, finish up again in OS X by blessing the partition. This will set GRUB as the default boot option (holding alt at startup goes to the mac boot options screen still. See http://mjg59.dreamwidth.org/7468.html)<br />
* OS X's EFI partition can be shared with Arch Linux, making the creation of an additional EFI partition dedicated to arch completely optional<br />
}}<br />
{{Note|For more information on partitioning, see [[Partitioning]]}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 10GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[#Installation]]<br />
<br />
==== Option 2: BIOS-compatibility ====<br />
<br />
* Run '''parted''' as root.<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain /boot. If you are not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the "Manually configure block devices..." option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which GRUB will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y. Reboot.<br />
<br />
* Done, you can continue with [[#Installation]].<br />
<br />
=== OS X, Windows XP, and Arch Linux triple boot ===<br />
<br />
This may not work for everyone but it has been successfully tested on a MacBook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in OS X, use the formatter on windows XP, install XP and then finish with Arch Linux tools.<br />
<br />
{{Warning|It is highly recommended that this only be attempted after a clean install of OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In OS X, run '''Disk Utility''' (located in {{ic|/Applications/Utilities}}).<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your OS X partition, how much for XP, and how much for Arch Linux. Remember that a typical installation of OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OS X 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OS X)<br />
:*sda2 (OS X install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note|Using this method you may not be able to have a shared partition between OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as GRUB). Download and install rEFIt [[http://refit.sourceforge.net/]]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
<br />
cd /efi/refit<br />
./enable.sh<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OS X installation CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run {{ic|# /arch/setup}}.<br />
<br />
* Follow the install as normal but note that you will have to tell that arch installer to mount sda3 as the root partition and format it as ext3, there will not be a /boot or swap partition so ignore those warnings.<br />
<br />
* At this point, if you are dual booting, you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done! You can continue to [[#Installation]] but make sure you read [[#Booting directly from GRUB]] for the stage "* (for booting with EFI) After the install boot loader stage, exit the installer and install GRUB."<br />
<br />
== Setup bootloader ==<br />
<br />
If you are going for an Arch Linux-only setup, installing the bootloader is no different than on any other machine: Install [[gummiboot]], [[rEFInd]] or other bootloader of your choice.<br />
<br />
If, on the other hand, you are dual/triple booting, then read on.<br />
<br />
{{Out of date | Section that describes bootloader setup for dual/triple boot should be revised and re-structured into more readable way}}<br />
{{Tip|rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[#rEFIt]]. }}<br />
<br />
<br />
=== Installing GRUB to EFI partition directly ===<br />
<br />
* If you would like to use GRUB as your main bootloader and use the "boot while holding the Alt/Option key" method to go back to OS X rather than using alternatives such as rEFIt (http://refit.sourceforge.net/, mentioned previously in [[#BIOS-compatibility]] and [[#OS X, Windows XP, and Arch Linux triple boot]]) then you must install {{Pkg|grub}} to your Mac's '''already-existing''' EFI partition (see below). <br />
<br />
{{Note| These instructions are known to work on a MacBook Pro (Early 2011). Please read the procedure carefully '''as well as the details following it'''.}}<br />
<br />
{{Note| With a new MacBook Pro (Mid 2014), this procedure worked only after installing the<br />
{{Pkg|efibootmgr}} package.}}<br />
<br />
'''Procedure''':<br />
<br />
* Install {{Pkg|grub}}<br />
<br />
* Make a directory named {{ic|efi}} in {{ic|/boot}} <br />
<br />
* Mount the '''already-existing''' EFI partition on your Mac to this {{ic|/boot/efi}} directory<br />
<br />
* Install GRUB to this directory<br />
<br />
* Make a directory named {{ic| locale}} in {{ic| /boot/grub}}<br />
<br />
* Copy {{ic| grub.mo}} from {{ic| /usr/share/locale/en\@quot/LC_MESSAGES/}} to {{ic| /boot/grub/locale}} <br />
<br />
* Generate a configuration for GRUB<br />
<br />
* Done! GRUB will now start on reboot and you can boot into your newly installed Arch Linux.<br />
<br />
* Remember to hold ALT/Option key '''while''' starting your computer if you want to boot back into OS X.<br />
<br />
'''Details (quoted from [[GRUB_EFI_Examples#M5A97]]):'''<br />
<br />
Finish the standard Arch install procedures, making sure that you install {{Pkg|grub}} and partition your boot hard disk as GPT.<br />
<br />
From [[GRUB#Install_to_UEFI_system_partition]]:<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Where X is your boot hard disk and Y is the efi partition you created earlier.<br />
<br />
Install GRUB UEFI application to and its modules to {{ic|/boot/grub/x86_64-efi}} using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Generate a configuration for GRUB<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Using blessing ===<br />
<br />
It is possible to boot directly from GRUB in EFI mode without using rEFIt through what is known as "blessing" after placing GRUB on a '''separate partition'''. These instructions are known to work on a MacBook7,1. It is advisable to host GRUB on either a FAT32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in {{ic|/efi/grub}} on an existing OS X partition:<br />
# bless --folder /efi/grub --file /efi/grub/grub.efi<br />
<br />
=== Compilation ===<br />
<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
== Installation ==<br />
<br />
{{Note|This section is only required if you want to have OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[#Post-installation]].}}<br />
<br />
* Boot from the Arch Linux install CD, from the latest [[Archboot]] iso (unofficial), or from a [[USB flash installation media#Using manual formatting|manually created]] bootable USB drive.<br />
{{Note|<br />
* On a MacBookPro7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation guide#Configure_the_system|Installation Guide, 9 Configure the system]].<br />
* Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Proceed through the installation as described in the [[Installation guide]] '''except''' in the following areas:<br />
** In the [[Installation guide#Prepare Hard Drive|prepare hard drive]] stage, do only the [[Installation guide#Manually configure block devices, filesystems and mountpoints|set filesystem mountpoints]] step, taking care to assign the correct partitions. Partitions have already been created if you followed [[#Partition]]<br />
** '''(for booting with EFI''') After the [[Installation guide#Install Bootloader|install boot loader]] stage, exit the installer and install [[GRUB]].<br />
** '''(for booting with BIOS-compatibility)''' In the [[Installation guide#Install Bootloader|install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** '''(for booting with BIOS-compatibility)''' Also in the [[Installation guide#Install Bootloader|install boot loader]] stage, install GRUB on whatever partition that {{ic|/boot}} is on. {{Warning|Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Installation guide#Configure System|configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
== Post-installation ==<br />
<br />
{{Style|Duplicated information, does not comply with [[Help:Style]].}}<br />
<br />
See [[General recommendations]] for system management directions and post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the {{Pkg|xf86-video-intel}} driver. Intel-based MacBooks work out-of-the-box.<br />
<br />
* If it returns '''nVidia''', read [[NVIDIA]].<br />
<br />
* Otherwise if it returns '''ATI''' or '''AMD''', read [[ATI]].<br />
<br />
===== NVIDIA note =====<br />
<br />
{{Tip|MBP 6.2 - With the proprietary [[NVIDIA]] drivers, support for [[NVIDIA#Enabling Pure Video HD (VDPAU/VAAPI)|PureVideo HD]] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the {{AUR|nvidia-bl}} package.<br />
<br />
{{Tip|<br />
* If backlight control does not work after installing nvidia-bl, you should [[Kernel modules#Blacklisting|blacklist]] apple_bl kernel module.<br />
* Alternatively, you can choose to use the {{AUR|pommed-light}} package. If you do so, you may wish to change the step settings in {{ic|/etc/pommed.conf.mactel}} to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== MacBookPro5,5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install {{AUR|nvidia-275xx}} and {{AUR|nvidia-utils-275xx}}, and possibly {{AUR|lib32-nvidia-utils-275xx}} if you are on x86_64 system and want 32-bits support.<br />
<br />
MacBookPro5,5 has an NVIDIA 9400m graphics card. This problem might apply to other devices as well.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OS X is included in the {{AUR|xf86-input-multitouch-git}} package. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as {{AUR|xf86-input-mtrack-git}}. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a MacBook7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
To disable tap-to-click (that is, to press down to click) by default, add the following to your mtrack configuration section<br />
<br />
Option "TapButton1" "0" <br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
<br />
'''Natural scrolling:''' To configure natural two finger scrolling similar to [http://www.apple.com/au/osx/what-is/gestures.html#gallery-gestures-scroll OS X], refer to [[Touchpad Synaptics#Natural scrolling]]. If you are using GNOME, it will override these settings - in this case refer to [[GNOME#Natural_scrolling_touchpad]].<br />
<br />
If you are using {{AUR|xf86-input-mtrack-git}}, you can simply swap the scroll up and scroll down buttons (along with the scroll left and scroll right):<br />
{{hc|/etc/X11/xorg.conf.d/10-mtrack.conf|<br />
...<br />
Option "ScrollUpButton" "5"<br />
Option "ScrollDownButton" "4"<br />
Option "ScrollLeftButton" "7"<br />
Option "ScrollRightButton" "6"<br />
...}}<br />
<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on MacBookPro5,5:''' I found it is much simpler to use the {{Pkg|xf86-input-synaptics}} in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. {{Pkg|gpointing-device-settings}} also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
'''For some users, the two-finger right-click may not work correctly and trackpad may also become less responsive after these settings. For me, removing the 'AreaLeftEdge' and 'AreaRightEdge', solved that problem.'''<br />
'''OS X like MultiTouch Gestures''' ''currently broken due to newer synaptic drivers!'' For users looking to add more of OS X's multitouch gestures to Arch, [https://github.com/iberianpig/xSwipe xSwipe] is a highly customisable, light weight perl script, which does just that. Once installed and configured (see xSwipe wiki on Github) I would recommend adding xSwipe as a [[Autostarting|start up item]].<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboards work by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install the {{AUR|pommed}} package.<br />
<br />
Edit the {{ic|/etc/pommed.conf}} according to your hardware on MacBook, building<br />
it from {{ic|/etc/pommed.conf.mac}} or {{ic|/etc/pommed.conf.ppc}} example files.<br />
<br />
Note that you can also run it without a configuration file, the defaults may work for you. Then enable and start pommed [[Systemd]] service.<br />
<br />
systemctl enable pommed<br />
systemctl start pommed<br />
<br />
{{Tip|if you are using Gnome or KDE you can easily configure ''3rd level functionality'', ''multimedia key'', etc. in Keyboard Preferences.}}<br />
<br />
{{Note|See the [[Xorg input hotplugging]] page for other configuration information.}}<br />
<br />
===== Keyboard Backlight =====<br />
<br />
The keyboard backlight is controlled by {{ic|/sys/class/leds/smc::kbd_backlight}}. Write the desired value to {{ic|brightness}} in that directory.<br />
<br />
You may also use {{AUR|kbdlight}} to control keyboard backlight though scripts or by running it via [[sxhkd]]. It has the advantage of allowing keyboard light-level changes without being root.<br />
<br />
====== NVIDIA note ======<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the {{AUR|nvidia-bl}} package and insert<br />
<br />
find . -name "*" -exec sed -i 's/mbp_backlight/nvidia_backlight/' '{}' \;<br />
<br />
into the second line of the pommed PKGBUILD build() function and remake the package. From [https://bbs.archlinux.org/viewtopic.php?id=105091 this forum post].<br />
<br />
Another possible solution is to modify the pommed PKGBUILD build():<br />
<br />
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;<br />
<br />
If the previous does not work try the following,<br />
<br />
run nvidia-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
Save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD Ubuntu MacBookPro5,5]<br />
<br />
=== Wi-Fi ===<br />
<br />
Different MacBook models have different wireless cards.<br />
<br />
You can easily check what card do your MacBook have by:<br />
<br />
# lspci | grep Network<br />
<br />
* If you have an Atheros card, all should work out-of-the-box.<br />
<br />
* If you have a Broadcom card, follow the [[Broadcom BCM4312]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [https://backports.wiki.kernel.org/index.php/Documentation/compat-drivers compat-drivers]<br />
<br />
{{Note|If your connection frequently drops, you may have to turn off Wi-Fi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file {{ic|/etc/pm/wireless}} with the lines:<br />
#!/bin/sh<br />
iwconfig wlp2s0 power off<br />
}}<br />
<br />
=== Power management ===<br />
<br />
[[Powerdown]] is a very simple to set up set of scripts what will maximize your battery duration. A MacBook Air 2013 with powerdown provides abour 11 hours of light usage with just powerdown installed.<br />
All the usual [[power management]] recomendations apply as well.<br />
<br />
==== Suspend and Hibernate ====<br />
<br />
Suspending (suspend to ram) and hibernating (suspend to disk) work fine out of the box:<br />
<br />
systemctl suspend<br />
<br />
Issues were reported where the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
See [[Suspend and hibernate]] for details on how to configure hibernation. Noticably, you'll need a swap partition or file (see the mentioned article for further instructions).<br />
<br />
If after suspend laptop is woken up after few seconds, may help to disable all stuff in /proc/acpi/wakeup, exclude LID0:<br />
# echo XHC1 > /proc/acpi/wakeup<br />
$ cat /proc/acpi/wakeup<br />
Device S-state Status Sysfs node<br />
P0P2 S3 *disabled<br />
EC S3 *disabled<br />
HDEF S3 *disabled pci:0000:00:1b.0<br />
RP01 S3 *disabled pci:0000:00:1c.0<br />
RP02 S3 *disabled pci:0000:00:1c.1<br />
RP03 S3 *disabled pci:0000:00:1c.2<br />
ARPT S4 *disabled pci:0000:03:00.0<br />
RP05 S3 *disabled pci:0000:00:1c.4<br />
RP06 S3 *disabled pci:0000:00:1c.5<br />
SPIT S3 *disabled<br />
XHC1 S3 *disabled pci:0000:00:14.0<br />
ADP1 S3 *disabled<br />
LID0 S3 *enabled<br />
And for permanent disabling:<br />
$ cat /etc/udev/rules.d/90-xhc_sleep.rules <br />
<br />
# disable wake from S3 on XHC1<br />
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"<br />
<br />
=== Light sensor ===<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
<br />
{{Tip| If using [[ALSA]], the internal speaker might not be disabled when using the headphone jack. To solve this, enable "Auto-mute" using {{ic|alsamixer}}}}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your {{ic|/etc/modprobe.d/50-sound.conf}} or {{ic|/etc/modprobe.d/modprobe.conf}} appending this line:<br />
<br />
options snd_hda_intel model=intel-mac-auto<br />
<br />
This should automatically specify the codec in your MacBook. Alternatively, for MacBookPro5,X, you can use:<br />
<br />
options snd_hda_intel model=mb5<br />
<br />
(note that the jack output is controlled with "HP").<br />
<br />
If you have an iMac8,1, you should instead use<br />
<br />
options snd-hda-intel model=mbp3 position_fix=2<br />
<br />
You can try to specify other options, that depend on your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
Bluetooth should work out-of-the box. See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== Webcam ===<br />
<br />
==== iSight ====<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the Linux UVC driver natively. '''MBP 6,2+ (Kernel ~2.6.37+) iSight works out of the box''' without the need to use firmware from OS X. Only use {{ic|isight-firmware-tools}} if it doesn't work normally.}}<br />
<br />
iSight webcams on MacBooks or pre 6,2 MacBook Pros (6,2 came out around 2010) require the Apple's proprietary firmware that cannot be redistributed. It must be extracted from OS X and loaded onto Arch.<br />
<br />
You will need to install {{AUR|isight-firmware-tools}} to extract the firmware. This package also includes a udev rule and ELF binary that are necessary, even once you have extracted the firmware file into {{ic|/lib/firmware/isight.fw}}, for the file to be loaded every time you boot your computer (namely {{ic|/etc/udev/rules.d/isight.rules}} which uses {{ic|/usr/lib/udev/ift-load}}).<br />
<br />
Instructions:<br />
<br />
First you need to get the firmware out of a particular file located on your OS X install. It is located in {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport}}.<br />
<br />
{{ Tip | The {{ic|AppleUSBVideoSupport}} file from a OS X 10.6 (Snow Leopard) installation may not work properly. If possible, use the file from OS X 10.5 or earlier.}}<br />
<br />
To mount the OS X drive if multi-booting:<br />
<br />
# sudo mkdir /media/OSX<br />
# sudo mount -t hfsplus /dev/sda2 /media/OSX<br />
<br />
Then, install the {{AUR|isight-firmware-tools}} package.<br />
<br />
Locate the {{ic|AppleUSBVideoSupport}} file in the OS X directory listed above. Either copy it over to your Arch system (Any OS X installation should do, such as an iMac, not just one specific to your system) or, if multi-booting, mount the OS X drive and navigate to the directory. (On 10.7 (Lion) the directory is {{ic|/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS}}.) In that directory you can go ahead and extract the driver:<br />
<br />
# ift-extract --apple-driver AppleUSBVideoSupport<br />
<br />
When it's done, check that the firmware has been found:<br />
<br />
# ls /lib/firmware/isight.fw<br />
<br />
Once successful, completely '''SHUTDOWN''' your Mac and start it back up again (to clear the hardware state of the webcam). Do ''not'' reboot.<br />
<br />
It should be automatically loaded at boot; if it isn't you can load the '''uvcvideo''' module [[Kernel modules|manually or load it at boot]].<br />
<br />
You can use many applications to test the webcam:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format {{ic|shot\d\d\d\d.png}} and are reported in the standard output.<br />
<br />
==== Facetime HD ====<br />
The Facetime HD webcam (included on 2013 MBAs onwards) [http://mactaris.blogspot.co.uk/2013/07/webcam-settings-20-will-support.html is no longer UVC device], and therefore, does not work out of the box. It is actually a PCIE device. While a [https://github.com/patjak/bcwc_pcie bcwc_pcie] driver is being developed, it will probably take some time before it is ready. See also [https://bugzilla.kernel.org/show_bug.cgi?id=71131 Linux bug #71131] and [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1276811 Ubuntu bug #1276711].<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install {{Pkg|lm_sensors}}. See the [[Lm sensors]] page for more information.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from OS X.<br />
<br />
First, install the {{AUR|xcalib}} package.<br />
<br />
Second copy pre-saved color profiles placed in {{ic|/Library/ColorSync/Profiles/Displays/}} on OS X partition to {{ic|~/colorprofiles/}} for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (non-Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{Tip|Also OS X allows to save current color profile from ''Displays > Color'' section of the ''Mac OS System Preferences'', in this case file is saved to {{ic|/Users/<username>/Library/ColorSync/Profiles}}.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{Note|Previous command set the color profile only for the current session; this mean that you must run it every time you login in your system. For automating it you can execute the command by '''Autostart Application''', concording with your DE (or add the command to your login manager's initialization script, e.g. /etc/gdm/Init/Default).}}<br />
<br />
=== Apple Remote ===<br />
<br />
First, to correctly install and configure the '''lirc''' software that control IR see [[LIRC]] wiki.<br />
<br />
Then make LIRC use {{ic|/dev/usb/hiddev0}} (or {{ic|/dev/hiddev0}}) by editing {{ic|/etc/conf.d/lircd}}. Here is how mine look:<br />
<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
LIRC_DEVICE="/dev/usb/hiddev0"<br />
LIRC_DRIVER="macmini"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"<br />
<br />
Use '''irrecord''' (available when installing '''lirc''') to create a configuration file matching your remote control signals (alternatively, you can try to use the {{ic|lircd.conf}} below):<br />
<br />
# irrecord -d /dev/usb/hiddev0 -H macmini output_conf_file<br />
<br />
Start '''lircd''' and use '''irw''' to check if it works.<br />
<br />
Example of an {{ic|/etc/lirc/lircd.conf}}:<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
=== HFS partition sharing ===<br />
<br />
First, install the {{AUR|hfsprogs}} package. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
# mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
=== HFS+ Partitions ===<br />
<br />
HFS+ partitions, now the default in OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using the OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
==== In OS X ====<br />
<br />
{{Note|It is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
===== Step 1: change UID and GID(s) =====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
# If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.<br />
# Navigate to ''/users/<new user name>'' where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
# Navigate to {{ic|/groups/<new user name>}}, automatically saving the changes you have made so far.<br />
<br />
{{Note|If you get an error message that the transaction is not allowed, log out and log back in.}}<br />
<br />
'''''Leopard'''''<br />
<br />
In Leopard, the '''NetInfo Manager''' application is not present. A different set of steps is required for UID synchronization:<br />
<br />
# Open '''System Preferences'''.<br />
# Click on '''Users & Groups'''.<br />
# Unlock the pane if not already done so.<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
# Write down the value of the '''User ID''' field, you will need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).<br />
<br />
===== Step 2: change "Home" permissions =====<br />
<br />
# Open up '''Terminal''' in the {{ic|/Applications/Utilities}} folder.<br />
<br />
# Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.<br />
<br />
# find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
==== In Arch ====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with OS X's home, by modify entries of {{ic|/etc/fstab}}.<br />
<br />
=== Avoid long EFI wait before booting ===<br />
<br />
If your MacBook spends 30 seconds with "white screen" before booting you need to tell the firmware where is the booting partition.<br />
<br />
Boot OS X, if do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal), or another MacBook with OS X (connect the two computers via firewire or thunderbolt, start the other MacBook keeping pressed T, boot your MacBook keeping pressed Options).<br />
<br />
Either way, once you got a OS X terminal running on your MacBook you need to execute, as root, a different command if the boot partition is EFI or it is not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215 and https://support.apple.com/kb/HT1533 .<br />
<br />
=== Mute startup chime ===<br />
<br />
If you forgot to mute before installing, you can still mute again if you have a OS X install disk. Boot from it, select language, then click ''Utilities > Terminal'', and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
=== kworker using high CPU ===<br />
Sometime with the addition of Yosemite, some users found that kworker CPU usage will spike, as disccused [https://bbs.archlinux.org/viewtopic.php?id=171883&p=11 here]. This is sometimes the result of runaway ACPI interrupts.<br />
<br />
To check and see, you can count the number of recent ACPI interrupts and see if any of them are out of control.<br />
<br />
grep . -r /sys/firmware/acpi/interrupts/<br />
<br />
<br />
If you see that one particular interrupt is out of control (possibly GPE66), i.e., registering hundreds of thousands of lines, you can try disabling it (replace XX with the runaway interrupt):<br />
<br />
<br />
echo "disable" > /sys/firmware/acpi/interrupts/gpeXX<br />
<br />
<br />
Disabling random ACPI interrupts could cause all kinds of problems, so do this at your own risk. If this fixes the problem, there is discussion about how to make a systemd service that automatically disables an interrupt at every boot [https://bbs.archlinux.org/viewtopic.php?pid=1488371 here].<br />
<br />
== rEFIt ==<br />
<br />
{{Note|<br />
* You probably want to have a look at [http://www.rodsbooks.com/refind/ rEFInd], which is some type of successor of rEFIt.<br />
* This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.<br />
}}<br />
<br />
For more see, [http://refit.sourceforge.net/myths/ rEFIt myths].<br />
<br />
In OS X, download the ".dmg" from [http://refit.sourceforge.net/ rEFIt Homepage] and install it.<br />
<br />
{{Note|If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.}}<br />
<br />
Open up '''Terminal''' and enter:<br />
<br />
cd /efi/refit;<br />
./enable.sh<br />
<br />
=== Problems with rEFIt ===<br />
<br />
If you experience problems after the install of Arch or rEFIt, especially is the right OS is not showing up to boot to or if it dumps you at a GRUB prompt stuck like the following:<br />
<br />
GRUB>_<br />
<br />
Then have a look at this link:<br />
<br />
http://mac.linux.be/content/problems-refit-and-grub-after-installation<br />
<br />
It can give you a basic idea on how to boot off the Arch live cd, mount the problem Arch install, chroot, use gptsync, and reinstall GRUB. This is probably for more advanced users who can translate the commands from a debian system to an Arch system and also apply it to the partitions on their machine. Be careful not to install GRUB in the wrong spot.<br />
<br />
If you need a copy of gptsync you can wget it from here:<br />
http://packages.debian.org/sid/gptsync<br />
or try these, for 64 bit:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
<br />
and for i386:<br />
<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
<br />
since they are .deb packages you will need the program {{AUR|deb2targz}}.<br />
<br />
==== Mavericks upgrade breaks Arch boot option ====<br />
For some multi-boot users who utilize a separate Linux boot partition, the OS X Mavericks upgrade may overwrite the boot partition with Apple's own recovery boot filesystem. This breaks the Arch Linux boot option in rEFIt/rEFInd. The best way to proceed in this situation is to abandon a separate boot partition and use the EFI system partition (ESP) to install the bootloader of your choice. It is also recommended that you use rEFInd instead of rEFIt as development on the latter has halted.<br />
<br />
Assuming grub2 as the bootloader:<br />
<br />
Use the Arch LiveCD to boot to a shell and [[Change root|chroot]] to your broken Arch Linux environment.<br />
<br />
Mount the ESP on /boot.<br />
<br />
Edit the fstab and remove the old boot partition and make ESP the new boot partition. Now mount the ESP as the new /boot parition.<br />
# mount -a<br />
<br />
[[install|Reinstall]] {{pkg|linux}}.<br />
<br />
Create a new initramfs and vmlinuz in /boot.<br />
# mkinitcpio -p linux<br />
<br />
Install grub.<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --recheck --debug<br />
<br />
Create a new grub.cfg file.<br />
# grub-mkconfig -o /boot/EFI/grub/grub.cfg<br />
<br />
Make sure that grub.cfg is in the same directory as grubx64.efi.<br />
<br />
Generate a new refind_linux.conf file in /boot simply by running mkrlconf.sh which comes with rEFInd.<br />
<br />
Exit the chroot environment.<br />
<br />
Reboot. You should see a new entry for Arch Linux in rEFInd and it should boot to your Arch Linux installation.<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook ===<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified_Extensible_Firmware_Interface#Remove_UEFI_boot_support_from_ISO]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified_Extensible_Firmware_Interface#Create_UEFI_bootable_USB_from_ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot/EFI<br />
<br />
The bootloader in use was [http://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. Usually it is simply done by copying rEFInd:<br />
<br />
cp -vr /usr/share/refind/drivers_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/tools_ia32 /boot/EFI/refind/<br />
cp -vr /usr/share/refind/fonts /boot/EFI/refind/<br />
cp -vr /usr/share/refind/icons /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind_ia32.efi /boot/EFI/refind/<br />
cp -v /usr/share/refind/refind.conf-sample /boot/EFI/refind/refind.conf<br />
cp -v /usr/share/refind/refind_linux.conf-sample /boot/refind_linux.conf<br />
<br />
{{Note|I'm using the 32bit version of Arch and refind, since the EFI of the old MacBooks is 32bit. I'm not sure about 32bit rEFInd booting a 64bit Arch...}}<br />
<br />
The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You cannot therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get {{AUR|mactel-boot}}. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling:<br />
<br />
hfs-bless /boot/EFI/refind/refind_ia32.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seems a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
{{Note|In the refind_linux.conf you add any kernel option you may want as long as you use the EFI stub of your kernel. In refind.conf you adjust your needs for the bootloader itself, like menu entries. If you use them (menu entries), rEFInd should not look for these EFI stub kernels itself, so blacklist the directories used in here, like {{ic|/boot/}}.}}<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image:<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/...' directory and assumes an efi kernel even without the extension '.efi'. If you do not want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [http://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
# dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro with Retina display ===<br />
<br />
==== Early 2015 13"/15" - Version 12,x/11,4+ ====<br />
<br />
===== Wireless =====<br />
The {{ic|brcmfmac}} driver is working (with some issues) out of the box as of 2015-05-02.<br />
* 5GHz is not working. <br />
* There seems to be an issue which might lead to a kernel oops. See [http://www.spinics.net/lists/linux-wireless/msg136089.html this] post for further information and a patch which seems to fix the problem.<br />
<br />
For Network controller BCM43602 14e4:43ba "Broadcom Corporation Device 43ba (rev 01)", on MacBookPro12,1 (output of "sudo dmidecode -s system-product-name"):<br />
* you need kernel version 3.17+ See [http://linuxwireless.org/en/users/Drivers/brcm80211/ this driver page] for details.<br />
* the kernel oops / freeze appeared - [http://www.spinics.net/lists/linux-wireless/msg136092.html This patch] does fix (as far as I could test) the problem that appeared when running multiple (in my case 6) concurrent downloads. This patch is included in kernel 4.0.5 :)<br />
* But there is another problem : Even with the patch applied I ran in another kernel (version 4.0.4) freeze triggered by the brcmfmac kernel module ! - See [https://bugzilla.kernel.org/show_bug.cgi?id=100201 this new bug report].<br />
<br />
===== Bluetooth =====<br />
Bluetooth is not working at all.<br />
# hcitool dev<br />
Devices:<br />
<br />
===== Keyboard & Touchpad =====<br />
Haptic feedback works out of the box due to the touchpad's built-in firmware. (Kernels 4.2-rc4 and lower)<br />
<br />
As of 4.2-rc5 the touchpad and keyboard are working. You can install this kernel version using the {{AUR|linux-mainline}} package.<br />
<br />
The following config is necessary on some systems to enable trackpad movement on 4.2+ kernels, avoiding an issue where the trackpad could be clicked, but the cursor could not be moved:<br />
<br />
# /etc/X11/xorg.conf.d/60-magictrackpad.conf<br />
Section "InputClass"<br />
Identifier "Trackpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
EndSection<br />
<br />
Further, some US/ANSI keyboards suffer from an issue where the tilde key (~, the key vertically between Esc and Tab) registers as < and >. The following config file fixes this issue.<br />
<br />
# /etc/modprobe.d/hid_apple.conf<br />
options hid_apple iso_layout=0<br />
<br />
See [https://bugzilla.kernel.org/show_bug.cgi?id=96771 this kernel bugzilla] for more details and the relevant patches for earlier kernels.<br />
<br />
===== Graphics =====<br />
For Dual Graphics see [https://wiki.archlinux.org/index.php/MacBookPro11,x#Graphics this section on the 11,3] <br />
For 8086:162b "Intel Corporation Broadwell-U Integrated Graphics (rev 09)" intel Iris 6100, on MacBookPro12,1 (output of "sudo dmidecode -s system-product-name"):<br />
* acpi_backlight=vendor with kernel 4.0.4 as kernel parameter is necessary to help fixing fn+brightness not working in X because of a ghost acpi_video0 brightness control. See [https://bugzilla.kernel.org/show_bug.cgi?id=100041 this bug report], and [https://bugzilla.kernel.org/attachment.cgi?id=180311&action=diff&context=patch&collapsed=&headers=1&format=raw the working patch], confirmed with kernel 4.0.4, that fixes the problem (so no acpi_backlight=vendor or video.* parameter necessary anymore to get working brightness controls).<br />
* i915.enable_ips=0 is necessary with kernel 4.0.4, as there is an issue on my MacBookPro12,1 (output of "sudo dmidecode -s system-product-name") that makes the ips - intermediate pixel storage (primarily a power saving feature) cause /flickering/ when mode switching (to tty console).<br />
* i915.lvds_downclock=1 ("Use panel (LVDS/eDP) downclocking for power savings"), sounds good, but will do nothing (because the MacBook has an eDP panel! there's a new auto-downclock for edp in recent kernels and it's enabled by default if available :), so don't use - recommendation from irc #intel-gfx)<br />
* intel_iommu=igfx_off if you have GPU HANG: ecode 8:0:0x85dffffb, in X [1737] blah-blah in dmesg and GPU hangs all the time during OpenGL operations.<br />
<br />
===== Apple Thunderbolt 2 Gigabit Ethernet Dongle =====<br />
on MacBookPro12,1 (output of "sudo dmidecode -s system-product-name") there is a bug (in kernel 4.0.4) in that the dongle gets recognized on boot-up and works just fine, but is not hotpluggable, so when unplugged it does not get recognized / work at all when replugged. See the following kernel bug report: https://bugzilla.kernel.org/show_bug.cgi?id=100191<br />
<br />
==== 2012 - 2014 models ====<br />
<br />
* [[MacBookPro11,x]] (Late 2013—Mid 2014)<br />
* [[MacBookPro10,x]] (Mid 2012—Early 2013)<br />
<br />
=== MacBook Air===<br />
<br />
==== Early 2014 11" - Version 6,1 ====<br />
This is almost the same as the 2013 version, where the only known difference is a slightly faster processor. The version numbers have not been changed since the 2013 version.<br />
<br />
It works excellently after following the instructions for the MBA 2013 13" here and in the forum thread.<br />
Bluetooth, which has been reported not working for some people with the 2013 version, works without trouble for the 2014 version, although it should be excactly the same.<br />
<br />
{{Note| Unless you have a local repository on a USB disk, you need a USB to ethernet adaptor or a USB wireless adaptor supported natively by the kernel to easily install Arch Linux, since you have to install the {{AUR|broadcom-wl-dkms}} package to make the internal wireless adaptor work.}}<br />
<br />
Unresolved issues:<br />
<br />
- There is no driver for the webcam yet.<br />
- rEFInd uses 30 seconds to start booting. Using the bless trick stops rEFInd from loading, and it has to be re-installed.<br />
<br />
==== Mid 2013 13" - Version 6,2 ====<br />
[https://bbs.archlinux.org/viewtopic.php?id=165899 Dedicated forum thread]<br />
===== Installing and booting =====<br />
Booting from a normal 2013.6 USB key works fine, but I could not seem to get either GRUB or Syslinux working.<br />
<br />
I was able to boot by first installing Arch Linux following the MacBook guide at the wiki (having a separate FAT32 /boot partition). Skip the bootloader installation. <br />
<br />
Installing [http://www.rodsbooks.com/refind/getting.html rEFInd] from OS X (important!) and installing the EFI stub loader made me able to boot fine.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=165710 Dedicated thread].<br />
<br />
{{Note| Installing [http://www.rodsbooks.com/refind/getting.html rEFInd] from Linux (or from OS X, but to the esp) also works fine}}<br />
<br />
===== Arch Only Installation =====<br />
This method works without rEFInd and uses grub to boot EFI. Partition as follows:<br />
<br />
/dev/sda1 200M Microsoft basic data<br />
/dev/sda2 256M Linux filesystem<br />
/dev/sda3 4G Linux swap<br />
/dev/sda4 108.6G Linux filesystem<br />
<br />
sda1 can also be a HFS+ partition for EFI. This example chooses to use FAT32 (vfat). Although swap is optional, it is required for hibernation. Instead of sda4 for root and home, an alternative partition scheme would be to make sda4 as root and sda5 as home.<br />
<br />
Format and mount:<br />
<br />
mkfs.vfat -F 32 /dev/sda1<br />
mkfs.ext2 /dev/sda2<br />
mkswap /dev/sda3<br />
swapon /dev/sda3<br />
mkfs.ext4 /dev/sda4<br />
<br />
mount /dev/sda4 /mnt<br />
mkdir /mnt/boot<br />
mount/dev/sda2 /mnt/boot<br />
mkdir /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
<br />
Finish the installation according to the [https://wiki.archlinux.org/index.php/Beginners'_Guide#Select_a_mirror Beginner's Guide] and skip anything after the bootloader. After you have generated your initramfs and set root passwd follow below to setup grub:<br />
<br />
pacman -S grub efibootmgr<br />
mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug<br />
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi}}<br />
<br />
Now you can exit/unmount/reboot:<br />
exit<br />
umount -R /mnt<br />
reboot<br />
<br />
===== Stability problems =====<br />
{{Note| Passing {{ic|<nowiki>libata.force=1:noncq</nowiki>}} to the kernel parameters solves the problem.}}<br />
This is the big worry for me. Every now and then my system hangs for a brief moment and everything involving net or disk access just hangs there for a while and then it seems to work. <br />
So far it only seems to happen when I run something disk- or CPU-intensive. Also had an occassion when I could not start X and just got this repeating all over my screen:<br />
<br />
ata1.00: failed command: WRITE FPDMA QUEUED<br />
ata1.00: cmd 61/08:f0:10:8c:c2/00:00:0b:00:00/40 tag 30 ncq 4096 out<br />
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)<br />
ata1.00: status: { DRDY }<br />
<br />
On the next attempt it worked fine.<br />
I did SMART short and long tests on my disk and they returned fine:<br />
<br />
[http://pastebin.com/vRE4T2Ld smartctl -a]<br />
<br />
There are some messages in my boot that indicate this could be disk and/or ACPI related.<br />
<br />
These are with 2013-06 ISO, 3.9.7-1 2013 x86_64 kernel.<br />
<br />
[http://pastebin.com/mjTJaPFa journalctl -b]<br />
Seems to only work with the headphone jack, not with the speakers.<br />
<br />
[http://pastebin.com/SdAcHuKh dmesg]<br />
<br />
===== Marvell ATA suspend bugs =====<br />
If you have 2013 MacBook Air with a Marvell 128 gig drive, you might get the following ata errors instead after pm-suspend/resumes:<br />
<br />
ata1: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen<br />
ata1: irq_stat 0x00400000, PHY RDY changed<br />
ata1: SError: { PHYRdyChg }<br />
ata1: hard resetting link<br />
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: unexpected _GTF length (8)<br />
ata1.00: configured for UDMA/33<br />
ata1: EH complete<br />
<br />
Try what Patrick and Tejun figured out on the [https://bugzilla.kernel.org/show_bug.cgi?id=62351 linux bug]. I followed what Patrick describes with sata_alpm, and I haven't seen the issue since.<br />
<br />
===== Suspend/Resume =====<br />
Brightness is either 0% or 100% after resuming from suspend. Until the kernel is fixed, use patjak's fix by installing {{AUR|mba6x_bl-dkms}}. Patjak's github is at [https://github.com/patjak/mba6x_bl].<br />
===== WiFi =====<br />
WiFi does not work out of the box. Install {{AUR|broadcom-wl-dkms}} to connect to a network. <br />
<br />
===== Touchpad =====<br />
Since 3.10.3 kernel touchpad works perfectly with {{Pkg|xf86-input-synaptics}}.<br />
<br />
===== Audio =====<br />
As of Linux 3.12, sound works out of the box. If you do not get sound with only {{pkg|alsa-utils}}, you may need to create a /etc/asound.conf with below entries:<br />
<br />
defaults.pcm.card 1<br />
defaults.pcm.device 0<br />
defaults.ctl.card 1<br />
<br />
==== Mid 2012 13" — version 5,2 ====<br />
<br />
Kernel panics using default boot media under arch kernel 3.5. Adding <code>intremap=off</code> fixes this. Additionally, there are problems loading the <code>applesmc</code> module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
==== Mid 2012 11.5" — Version 5,1 ====<br />
<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove {{Pkg|xf86-input-synaptics}} and install {{AUR|mtrack-git}}. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
===== Installing using the Archboot 2012.06 image =====<br />
<br />
Several people have reported problems installing Arch Linux on the MBA version 5,2 (See [https://bbs.archlinux.org/viewtopic.php?id=144089 problems booting Arch Linux on a MacBook Air Mid 2012]). A common problem is that the screen is not detected and therefore goes black when the installer boots. To fix this problem one has to select the normal install (Not the LTS) during boot and press tab to edit the boot flags. Then add noapic flag to the boot line. This should fix the screen going black. Install the system as you normally would. It may help later in the configuration process if the support packages are installed already at this stage.<br />
<br />
When the install has finished again add the noapic flag to the GRUB boot line (if you use GRUB) and also add i915.diescreaming=1 (or perhaps i915.die). This should keep the screen from going black when booting the new system. After you enter the system the wireless driver should be loaded. If you installed the support packages during installation you should have the wifi-menu command. Run it and select the network you want to use. One could also use wpa_supplicant but wifi-menu is quite fast to use at this stage. Now you are ready to upgrade the system. As of writing there have been a lot of changes to Arch Linux since the 2012.06 image of Archboot was released ([https://www.archlinux.org/news/filesystem-upgrade-manual-intervention-required-1/ filesystem] and [https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ glibc]). Therefore the upgrade process can be a bit difficult. The current solution has sucessfully upgraded a standart archboot version to a up-to-date version as of October 2012 and this step should be obsolete in future releases of archboot.<br />
<br />
First ignore the new "big" changes to Arch Linux,<br />
<br />
pacman -Suy --ignore glibc,libarchive,curl,filesystem <br />
<br />
If this only upgrades pacman then run the command again. Remember to make sure that pacman is ignoring the packages you do not want upgraded now. Otherwise you may break the system and have to reinstall! Now upgrade to the new filesystem,<br />
<br />
pacman -S filesystem --force<br />
<br />
As described in [[DeveloperWiki:usrlib|Glibc upgrade guide]] there may be conflicts with installed packages that require the /lib directory. Follow the guide and remove any packages that use /lib. The stock 3.4.2 kernel from Archboot should be on this list so first upgrade this,<br />
<br />
pacman -S linux<br />
<br />
This may give some errors saying that the system may not boot because of missing modules. Ignore this warning for now. The stock install may also contain gcc in the /lib directory so also remove this if needed and any other packages that have conflicts. Now Glibc should be the only package in /lib so run the system upgrade and accept all changes, <br />
<br />
pacman -Su<br />
<br />
Finally reinstall the kernel so that it can find the correct modules.<br />
<br />
Now this command should not give any errors like last time. You can also reinstall gcc at this point. After a rebooted the system should startup and the new kernel should have fixed the problem with the screen going black. If want to boot Xorg then you may need to remove the i915.diescreaming=1 line from GRUB. If not then attach a external screen and try to fix the problem that way. Some people have reported commands that may help on the [https://bbs.archlinux.org/viewtopic.php?id=144089 forum].<br />
<br />
==== Mid 2011 — version 4,x ====<br />
<br />
Works out-of-the-box since kernel 3.2. It is recommended to use [[Archboot]], install [[GRUB]] and use EFI.<br />
<br />
==== Early 2008 — version 1,1 ====<br />
<br />
Everything works out of the box though you will need {{Pkg|b43-fwcutter}} (or simply {{AUR|b43-firmware}}) for the wireless adapter to work.<br />
<br />
Since this model has only one USB port, you may find it easiest to install Arch with a powered USB hub. Plug a USB network adapter (wireless or ethernet adapter to plug into a USB port) and your Arch installation media into the USB hub.<br />
<br />
If you can't get any result by scanning wireless network after boot, unload modules <code>b43</code> and <code>ssb</code> and load them again:<br />
<br />
rmmod ssb<br />
rmmod b43<br />
modprobe b43<br />
<br />
There is a good chance you will find what's wrong with DMA from the dmesg log.<br />
<br />
Even if you can scan wireless networks after reloading the modules, it's still possible that you will only be able to connect to some networks, but not all of them. According to a more detailed discussion here: http://crunchbang.org/forums/viewtopic.php?id=17368, adding <code>pio=1,qos=0</code> options to the b43 module can solve this problem.<br />
<br />
I tested this for a 13' MacBookAir1,1 with a BCM4321 chipset, and it works.<br />
<br />
== See also ==<br />
* '''MacBook Air'''<br />
** [http://dabase.com/blog/Macbook_Air_Early_2014_Archlinux/ Macbook Air Early 2014 — dabase.com]<br />
** [http://www.frankshin.com/installing-archlinux-on-macbook-air-2013/ Installing Archlinux on Macbook Air 2013 — Frank Shin]<br />
** [http://blog.panks.me/posts/2013/06/arch-linux-installation-with-os-x-on-macbook-air-dual-boot/ Arch Linux Installation with OS X on Macbook Air (Dual Boot) — Pankaj Kumar]<br />
** [http://ryangehrig.com/index.php/arch-linux-on-macbook-air-2013/ Arch Linux – MacBook Air 2013 — Ryan Gehrig]<br />
** [http://www.nico.schottelius.org/blog/macbook-air-42-archlinux/ Installing Linux on a Macbook Air (4,2) — Nico Schottelius]<br />
** [http://www.dm9.se/?p=398 Arch linux single, pure efi boot on the macbook air3,1/3,2 — DIMENSION9]<br />
* '''MacBook Pro'''<br />
** http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-pro/<br />
** http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
** http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/<br />
** http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html</div>Iv597https://wiki.archlinux.org/index.php?title=Lenovo_IdeaPad_Yoga_2_Pro&diff=309808Lenovo IdeaPad Yoga 2 Pro2014-04-09T22:11:31Z<p>Iv597: /* Touchscreen button */</p>
<hr />
<div>{{Deletion|unnecessary article}}<br />
<br />
[[Category:Lenovo]]<br />
<br />
=Boot, UEFI=<br />
By default, the device boots in UEFI mode. UEFI and Legacy modes both seem to work fine, though UEFI is little more tricky to set up.<br />
<br />
=USB subsystem=<br />
syslog <br />
usb 2-7: unable to read config index 0 descriptor/start -71<br />
<br />
after login to a shell, it is good to<br />
~# dmesg -D<br />
or you will find it hard to work.<br />
<br />
on Gentoo, my syslog fills with <br />
Dec 5 08:40:44 localhost kernel: [ 290.632613] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.735110] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.837534] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.940070] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 291.042570] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
at a rate of at least 10 lines a second..<br />
<br />
=Hardware Keys / User Input=<br />
To access boot menu or BIOS settings, you must use the alternate power button, next to the standard one.<br />
<br />
No keypad available at all.<br />
<br />
==Keyboard special keys==<br />
BIOS has a setting to flip the behavior of the FN key.<br />
<br />
fn+F1 XF86AudioMute<br />
fn+F2 XF86AudioLowerVolume<br />
fn+F3 XF86AudioRaiseVolume<br />
fn+F4 Alt_L+<F4><br />
fn+F5 <F5><br />
fn+F6 n/a<br />
fn+F7 n/a<br />
fn+F8 Alt_L+Tab<br />
fn+F9 n/a?<br />
fn+F10 super_L+p<br />
fn+F11 XF86MonBrightnessDown<br />
fn+F12 XF86MonBrightnessUp<br />
<br />
==Hardware keys on right side==<br />
From hinge to front:<br />
XF86AudioRaiseVolume<br />
XF86AudioLowerVolume<br />
Super_L+o<br />
<br />
==Touchscreen==<br />
Touchscreen USB device seems to come and go if the 'usbtouchscreen' module is not loaded.<br />
<br />
===Touchscreen button===<br />
Super_L, but a fake one! `key_down` and `key_up` are generated simultaneously on touch release.<br />
<br />
The haptic feedback (vibration) when touching the Windows button is currently not controllable via software.<br />
<br />
{{Tip|If you are using gnome-shell, you might want to use '''touchegg-svn''' from AUR, instead of '''touchegg''', as touchegg-svn fixes issues related to gnome-shell desktop and upper pane.}}<br />
<br />
=ACPI=<br />
I modified ''/etc/acpi/default.sh'' to allow for some debugging and additional features (see below):<br />
#!/bin/sh<br />
set $*<br />
group=${1%%/*}<br />
device=$2<br />
id=$3<br />
value=$4<br />
log_unhandled() {<br />
logger "ACPI event unhandled: $*"<br />
}<br />
case "$group" in<br />
button)<br />
case "$action" in<br />
power)<br />
/etc/acpi/actions/powerbtn.sh<br />
;;<br />
lid)<br />
/etc/acpi/actions/lid.sh<br />
;;<br />
*) log_unhandled $* ;;<br />
esac<br />
;;<br />
ac_adapter)<br />
case "$value" in<br />
*) log_unhandled $* ;;<br />
esac<br />
;;<br />
*) echo $* > /dev/tty5<br />
log_unhandled $* ;;<br />
esac<br />
<br />
<br />
==Touchpad==<br />
The touchpad sends random input from time to time, especially when lid is closed. If you like your computer to keep running when the lid is closed, you may want to disable the touchpad with ACPI events:<br />
;/etc/acpi/actions/lid.sh<br />
#!/bin/bash<br />
export DISPLAY=:0<br />
if grep closed /proc/acpi/button/lid/LID0/state<br />
then<br />
synclient TouchpadOff=1 2>/dev/tty5 && echo "lid closed, disabling touchpad" >/dev/tty5<br />
else<br />
synclient TouchpadOff=0 2>/dev/tty5 && echo "lid open, eênabling touchpad" >/dev/tty5<br />
fi<br />
Of course, the echo statement is optional and for debug purposes.<br />
<br />
==Backlight==<br />
"old" (ref needed) kernels require boot argument<br />
acpi_backlight=vendor<br />
<br />
Screen backlight brightness can be set with<br />
echo $VAL > /sys/class/backlight/intel_backlight/brightnes<br />
with $VAL between 0 and 937<br />
<br />
==Battery==<br />
Battery info can be accessed with<br />
ls /sys/class/power_supply/BAT1/*<br />
Unfortunately, the values obtained there have no units (older Lenovo products had rates in mA, battery voltage, etc.)<br />
<br />
=Graphics=<br />
<br />
Steam crashes trying to run games complaining about missing i965 module. It seems some applications treat it as accelerated, and some do not.<br />
<br />
Resolution seems to be not so well supported by some desktop environments/window managers. XFCE and fvwm seem to work fine.<br />
<br />
Users may wish to boost font-sizes, as the HiDPI screen can be hard to read in some settings.<br />
<br />
=Rotation/Conversion=<br />
<br />
You can easily rotate screen with xrandr, however it does not rotate touchscreen/touchpad input which makes it fairly awkward to use. There is a [https://github.com/wolneykien/xrandr-align project] attempting to address this. Keyboard hardware-disables in tablet mode, but touchpad is still active which needs to be addressed. No ACPI or keycode signals appear to be emitted for the various screen rotation states.<br />
<br />
=Network=<br />
Network is known to cause trouble. You may want to run this on boot:<br />
~# rfkill unblock wlan<br />
There may be an issue with the network drivers on x86_64, which is then so unstable it becomes unusable.<br />
<br />
It may help to unload/blacklist the 'ideapad_laptop' module (especially if you use NetworkManager to handle your wireless).<br />
<br />
You might still want to disable power saving on the card:<br />
<br />
/etc/udev/rules.d/80-iwlwifi.rules<br />
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="<your_mac_address>", RUN+="/usr/bin/iw dev %k set power_save off"<br />
<br />
=See also=<br />
* The LinLap site has some good information - see [[http://www.linlap.com/lenovo_ideapad_yoga_2_pro]]<br />
* a good [http://keithcu.com/wordpress/?p=3270 Review of Arch Linux on a HiDPI Lenovo Yoga 2 Pro] by KeithCU with useful comments</div>Iv597https://wiki.archlinux.org/index.php?title=Lenovo_IdeaPad_Yoga_2_Pro&diff=309807Lenovo IdeaPad Yoga 2 Pro2014-04-09T22:10:41Z<p>Iv597: Purging commentary (partially?) because this isn't a blog, and fixing grammar that stuck out to me.</p>
<hr />
<div>{{Deletion|unnecessary article}}<br />
<br />
[[Category:Lenovo]]<br />
<br />
=Boot, UEFI=<br />
By default, the device boots in UEFI mode. UEFI and Legacy modes both seem to work fine, though UEFI is little more tricky to set up.<br />
<br />
=USB subsystem=<br />
syslog <br />
usb 2-7: unable to read config index 0 descriptor/start -71<br />
<br />
after login to a shell, it is good to<br />
~# dmesg -D<br />
or you will find it hard to work.<br />
<br />
on Gentoo, my syslog fills with <br />
Dec 5 08:40:44 localhost kernel: [ 290.632613] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.735110] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.837534] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 290.940070] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
Dec 5 08:40:44 localhost kernel: [ 291.042570] xhci_hcd 0000:00:14.0: ep 0x81 - asked for 15360 bytes, 15117 bytes untransferred<br />
at a rate of at least 10 lines a second..<br />
<br />
=Hardware Keys / User Input=<br />
To access boot menu or BIOS settings, you must use the alternate power button, next to the standard one.<br />
<br />
No keypad available at all.<br />
<br />
==Keyboard special keys==<br />
BIOS has a setting to flip the behavior of the FN key.<br />
<br />
fn+F1 XF86AudioMute<br />
fn+F2 XF86AudioLowerVolume<br />
fn+F3 XF86AudioRaiseVolume<br />
fn+F4 Alt_L+<F4><br />
fn+F5 <F5><br />
fn+F6 n/a<br />
fn+F7 n/a<br />
fn+F8 Alt_L+Tab<br />
fn+F9 n/a?<br />
fn+F10 super_L+p<br />
fn+F11 XF86MonBrightnessDown<br />
fn+F12 XF86MonBrightnessUp<br />
<br />
==Hardware keys on right side==<br />
From hinge to front:<br />
XF86AudioRaiseVolume<br />
XF86AudioLowerVolume<br />
Super_L+o<br />
<br />
==Touchscreen==<br />
Touchscreen USB device seems to come and go if the 'usbtouchscreen' module is not loaded.<br />
<br />
===Touchscreen button===<br />
Super_L, but a fake one! `key_down` and `key_up` are generated simultaneously on touch release.<br />
<br />
The haptic feedback (vibration) when touching the Windows button is currently not controllable via software.<br />
<br />
{{Tip|If you are using gnome-shell, you might want to use '''touchegg-svn''' from AUR, instead of '''touchegg''', as touchegg-svn fixes issues related to gnome-shell desktop and upper pane.}}<br />
<br />
=ACPI=<br />
I modified ''/etc/acpi/default.sh'' to allow for some debugging and additional features (see below):<br />
#!/bin/sh<br />
set $*<br />
group=${1%%/*}<br />
device=$2<br />
id=$3<br />
value=$4<br />
log_unhandled() {<br />
logger "ACPI event unhandled: $*"<br />
}<br />
case "$group" in<br />
button)<br />
case "$action" in<br />
power)<br />
/etc/acpi/actions/powerbtn.sh<br />
;;<br />
lid)<br />
/etc/acpi/actions/lid.sh<br />
;;<br />
*) log_unhandled $* ;;<br />
esac<br />
;;<br />
ac_adapter)<br />
case "$value" in<br />
*) log_unhandled $* ;;<br />
esac<br />
;;<br />
*) echo $* > /dev/tty5<br />
log_unhandled $* ;;<br />
esac<br />
<br />
<br />
==Touchpad==<br />
The touchpad sends random input from time to time, especially when lid is closed. If you like your computer to keep running when the lid is closed, you may want to disable the touchpad with ACPI events:<br />
;/etc/acpi/actions/lid.sh<br />
#!/bin/bash<br />
export DISPLAY=:0<br />
if grep closed /proc/acpi/button/lid/LID0/state<br />
then<br />
synclient TouchpadOff=1 2>/dev/tty5 && echo "lid closed, disabling touchpad" >/dev/tty5<br />
else<br />
synclient TouchpadOff=0 2>/dev/tty5 && echo "lid open, eênabling touchpad" >/dev/tty5<br />
fi<br />
Of course, the echo statement is optional and for debug purposes.<br />
<br />
==Backlight==<br />
"old" (ref needed) kernels require boot argument<br />
acpi_backlight=vendor<br />
<br />
Screen backlight brightness can be set with<br />
echo $VAL > /sys/class/backlight/intel_backlight/brightnes<br />
with $VAL between 0 and 937<br />
<br />
==Battery==<br />
Battery info can be accessed with<br />
ls /sys/class/power_supply/BAT1/*<br />
Unfortunately, the values obtained there have no units (older Lenovo products had rates in mA, battery voltage, etc.)<br />
<br />
=Graphics=<br />
<br />
Steam crashes trying to run games complaining about missing i965 module. It seems some applications treat it as accelerated, and some do not.<br />
<br />
Resolution seems to be not so well supported by some desktop environments/window managers. XFCE and fvwm seem to work fine.<br />
<br />
Users may wish to boost font-sizes, as the HiDPI screen can be hard to read in some settings.<br />
<br />
=Rotation/Conversion=<br />
<br />
You can easily rotate screen with xrandr, however it does not rotate touchscreen/touchpad input which makes it fairly awkward to use. There is a [https://github.com/wolneykien/xrandr-align project] attempting to address this. Keyboard hardware-disables in tablet mode, but touchpad is still active which needs to be addressed. No ACPI or keycode signals appear to be emitted for the various screen rotation states.<br />
<br />
=Network=<br />
Network is known to cause trouble. You may want to run this on boot:<br />
~# rfkill unblock wlan<br />
There may be an issue with the network drivers on x86_64, which is then so unstable it becomes unusable.<br />
<br />
It may help to unload/blacklist the 'ideapad_laptop' module (especially if you use NetworkManager to handle your wireless).<br />
<br />
You might still want to disable power saving on the card:<br />
<br />
/etc/udev/rules.d/80-iwlwifi.rules<br />
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="<your_mac_address>", RUN+="/usr/bin/iw dev %k set power_save off"<br />
<br />
=See also=<br />
* The LinLap site has some good information - see [[http://www.linlap.com/lenovo_ideapad_yoga_2_pro]]<br />
* a good [http://keithcu.com/wordpress/?p=3270 Review of Arch Linux on a HiDPI Lenovo Yoga 2 Pro] by KeithCU with useful comments</div>Iv597https://wiki.archlinux.org/index.php?title=Acer_C710_Chromebook&diff=266024Acer C710 Chromebook2013-07-12T20:59:17Z<p>Iv597: Rewrote a huge chunk of the page. More straightforward wording, more details, etc. etc. The diff will probably speak for itself.</p>
<hr />
<div>[[Category:Acer]]<br />
The following is a work in progress guide to getting Arch working on the $200 Acer C7 [[Chromebook]].<br />
<br />
For now you'll need a second computer already running *nix. If you're already running ChrUbuntu on your C7 then you can just skip to creating your own Arch image.<br />
<br />
== Installing Arch onto an Acer C7 Chromebook ==<br />
At present, Arch runs well on the C7, however most testing has been done with stock i686 ChromeOS kernels. "Patches welcome" when it comes to x86_64 Chromium kernels or completely custom ones.<br />
<br />
{{Warning|'''*BACK UP YOUR DATA.*'''}}<br />
<br />
Seriously. All of it. Somewhere *other* than on the device - the entire data partition will be purged a couple times over during the install process. USB keys, Google Drive, printed paper messages stored in bottles, something.<br />
<br />
=== Enabling Dev Mode ===<br />
First step is to enable Dev mode on the system so we can run some unsigned code. '''This will wipe all your data!'''<br />
<br />
To enter Dev Mode: <br />
* Press hold down the {{Keypress|Esc+F3 (Refresh)}} keys, and press the {{Keypress|Power}} button.<br />
::This enters recovery mode,<br />
* Now press {{Keypress|Ctrl+d}} (there's no prompt). It will ask you to confirm, then the system will reboot into dev-mode.<br />
::Dev Mode will always show the scary boot screen and you'll need to press {{Keypress|Ctrl+d}} or wait 30 seconds to continue booting.<br />
<br />
{{Note|If you ever need to hard reset, press the {{Keypress|Esc+F3 (Refresh)}} combo. This will hard reset the system much like the small reset buttons on the front of tower PCs. The same warnings as on towers apply - the OS has no chance to save itself from this, and data loss is possible. You've been warned.}}<br />
<br />
See Also: [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook]<br />
<br />
=== Install ChrUbuntu ===<br />
While it sounds completely backwards to install Ubuntu on our Chromebook just to install Arch, at present it's the most automated and safe way. Scripts are in work-in-progress stages to try mashing the ChrUbuntu installer with [https://github.com/tokland/arch-bootstrap arch-bootstrap]; stay tuned for details if they arrive.<br />
<br />
* After enabling dev mode on your Chromebook, boot to the ChromeOS setup screen. Set keyboard layout, language, and connect to a network. Do *not* log in to an account.<br />
* Press {{Keypress|Ctrl+Alt+F2}} and login as "chronos"<br />
* Type "bash" and hit {{Keypress|Enter}}<br />
* Run "curl -L -O goo.gl/s9ryd"<br />
* Run "sudo bash ./s9ryd"<br />
::Here is where you set the partition sizing for what will eventually be your Arch install. For example, I told the script "90", so Arch would be using the majority of my 128GB M4 SSD<br />
* Wait for the system reboot<br />
* Wait 3-5 minutes for the system "repair" job to run<br />
* Reset keyboard layout, language, and reconnect to a network. Still don't log in to an account.<br />
* {{Keypress|Ctrl+Alt+F2}} again, log in as "chronos" again<br />
* Type "bash" and hit {{Keypress|Enter}}<br />
* Run "curl -L -O goo.gl/s9ryd" again<br />
* Run "sudo bash ./s9ryd" again<br />
* Let Ubuntu's installer do its thing. You'll get asked a few setup-related questions along the way, it's safe to just hit {{Keypress|Enter}} for everything as we'll never let Ubuntu see light of day.<br />
* While that installs, let's install Arch on our spare *nix box!<br />
{{Note|When the installer finishes, it will ask you to press {{Keypress|Enter}} to reboot. DO NOT DO THIS. Instead hit {{Keypress|Ctrl+C}} to drop back to a shell. You have been warned.}}<br />
<br />
==== Create Image File ====<br />
* First we need to create an Arch Image to do things with. This can be done an any *nix box.<br />
# truncate -s 1G arch.img<br />
<br />
==== Convert Image To A Partition ====<br />
* Convert image to a ext4 filesystem.<br />
# mkfs.ext4 -m 1 arch.img<br />
* Mount image to install to<br />
# mkdir /mnt/arch_install<br />
# mount arch.img /mnt/arch_install<br />
<br />
==== Install Arch onto this new image ====<br />
At this point, run through the [https://wiki.archlinux.org/index.php/Installation_Guide Installation Guide] as you normally would. I strongly recommend doing this from a system with the Arch install scripts package installed; while this is a doable process with misc. *nix systems (many of such processes are well documented here on the Wiki), it's going to be much smoother with the install scripts.<br />
<br />
For example,<br />
# pacstrap /mnt/arch_install base base-devel --arch i686<br />
{{Note|The `--arch i686` part is important if you're on an x86_64 system. As ChrUbuntu does not support 64 bit with the C7 currently, our C7 will be forced to run i686 Arch}}<br />
<br />
When setting up fstab, you'll need to mount "/dev/sda7" at "/". UUIDs aren't really an option here as data is about to get sorted all over the place.<br />
<br />
=== Copy Arch Image To C7 ===<br />
Here's where things start to become a mess. By now you should have a ready-to-go Ubuntu install that you did not reboot into yet (meaning you're back at the bash shell in ChromeOS), and a ready-to-go Arch install on the arch.img file. You'll need to find a way to get this arch.img file to the Chromebook - be it a USB HDD, uploading it somewhere, SSHFS, whatever, make it happen.<br />
<br />
* Copy the Arch image to the Chromebook.<br />
* Run "mkdir mnt mnt2 mnt3 backup"<br />
* If your Arch image is on a USB key or drive, run "mount /dev/sdb1 mnt" (replacing /dev/sdb1 with the identifier of your USB drive according to ChromeOS). Then run "mount mnt/arch.img mnt2" (replacing arch.img with the name of your Arch image).<br />
* Otherwise, I'm assuming your Arch image was downloaded to the Chromebook somehow. So run "mount /path/to/arch.img mnt2"<br />
* Run "mount /dev/sda7 mnt3". This will mount Ubuntu's root at mnt3.<br />
* Run "cp -a mnt3/lib/{firmware,modules} backup/". This will copy all firmware and kernel modules, which we'll need to successfully boot Arch.<br />
* Run "cp -a mnt3/etc/modprobe.d/*.conf backup/". This will save all module configs.<br />
* Run "rm -rf mnt3/*"<br />
{{Warning|Make 100% certain you typed "mnt3/*" and not some other mountpoint or you may toast your USB stick or Arch install.}}<br />
* Run "cp -a mnt2/* mnt3/". This will copy your Arch install off to what was Ubuntu's root directory.<br />
* Run "cp -a backup/*.conf mnt3/etc/modprobe.d/". This will restore module configs.<br />
* Run "cp -a backup/modules/* mnt3/lib/modules/". This will restore kernel modules.<br />
* Run "cp -a backup/firmware mnt3/lib/". This will restore kernel firmwares.<br />
* "umount" mnt3, mnt2, and mnt. In that order.<br />
* Reboot and enjoy your Arch install! Note that ChrUbuntu's installer only told cgpt to boot to the Linux partition one time, so if anything is hosed, a reboot will send you back to ChromeOS. If all went well and you are happy with everything, you can reboot to ChromeOS, drop to the {{Keypress|Ctrl+Alt+F2}} console, and run a `sudo cgpt add -i 6 -P 5 -S 1 /dev/sda` to make the Chromebook always boot Arch.<br />
<br />
== See also ==<br />
* [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook Developer information on Official site]<br />
* [http://chromeos-cr48.blogspot.com/2013/05/chrubuntu-one-script-to-rule-them-all_31.html ChrUbuntu script used in the installation, has useful tips on cgpt commands in case they are needed.]</div>Iv597https://wiki.archlinux.org/index.php?title=Arch_Linux_on_a_VPS&diff=239598Arch Linux on a VPS2012-12-09T02:15:15Z<p>Iv597: Added OnePound - I've had my VPS stable for 5 months there, so I guess I'll throw a mention.</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[Category:Virtualization]]<br />
{{Article summary start}}<br />
{{Article summary text|This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Comprehensive Server Guide}}<br />
{{Article summary end}}<br />
From [[Wikipedia:Virtual private server]]:<br />
<br />
:''Virtual private server (VPS) is a term used by Internet hosting services to refer to a virtual machine. The term is used for emphasizing that the virtual machine, although running in software on the same physical computer as other customers' virtual machines, is in many respects functionally equivalent to a separate physical computer, is dedicated to the individual customer's needs, has the privacy of a separate physical computer, and can be configured to run server software.''<br />
<br />
==Providers that offer Arch Linux==<br />
<br />
{{Warning|We cannot vouch for the honesty or quality of any provider. Please conduct due diligence before ordering.}}<br />
{{Note|This list is for providers with a convenient Arch Linux image. Using Arch on other providers is probably possible, but would require loading custom ISOs or disk images or [[Installation Chroot|installing under chroot]].}}<br />
<br />
{| border="1"<br />
! Provider !! Arch Release !! Virtualization !! Locations !! Notes<br />
|-<br />
| [http://123systems.net 123 Systems] || 2010.05 i686/x86_64 || OpenVZ || Dallas, TX || Arch available as a selection upon reinstall. Very old (2.6.18-308) kernel - See [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|OpenVZ troubleshooting]].<br />
|-<br />
| [http://afterburst.com/ Afterburst] || 2010.05 i686/x86_64 || OpenVZ || Miami (USA), Falkenstein (Germany) || Formerly FanaticalVPS, kernel version depends on what node your VPS is on, the ones in Miami are fine (2.6.32-042stab062.2) but some of the ones in Germany require a [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|custom glibc]].<br />
|-<br />
| [http://alienvps.com/ AlienVPS] || 2010.05 || Xen, KVM || Los Angeles, New York ||<br />
|-<br />
| [https://www.clodo.ru/ Clodo.ru] || 2011.?? || Xen || Moscow || Can pay per hour. Lists an invalid release version of the installer.<br />
|-<br />
| [http://en.edis.at/ Edis] || 2011.08 i686/x86_64 || vServer, KVM || Austria, Chile, Germany, France, Hong Kong, Italy, Iceland, Poland, Sweden, Switzerland, Spain, UK, USA ||<br />
|-<br />
| [http://eoreality.net/ EOReality] || (?) i686/x86_64 || OpenVZ || Chicago || Need to use special glibc-vps repo for this provider . See [[Virtual_Private_Server#OpenVZ:_kernel_too_old_for_glibc|OpenVZ troubleshooting]] for instructions. You will also need to remove heimdal.<br />
|-<br />
| [https://www.directvps.nl/ DirectVPS] || 2012.09 x86_64 || Xen || Amsterdam, Rotterdam || <br />
|-<br />
| [http://generation-host.com Generation-Host] || 2012.07 || Xen || Chicago IL, Clifton NJ and Toronto ON Canada ||<br />
|-<br />
| [https://www.gigatux.com/virtual.php GigaTux] || 2011.08 x86_64 || Xen || Chicago, Frankfurt, Israel, London, San Jose ||<br />
|-<br />
| [http://www.vr.org/ Host Virtual] || 2011.08 || Xen || Amsterdam, Chennai (Madras), Chicago, Dallas, Hong Kong, London, Los Angeles, New York, Paris, Reston, San Jose ||<br />
|-<br />
| [https://hostigation.com/ Hostigation] || 2010.05 i686 || OpenVZ, KVM || Charlotte, Los Angeles || You can [[Migrating Between Architectures Without Reinstalling|migrate to x86_64]].<br />
|-<br />
| [http://www.intovps.com IntoVPS] || 2012.05 i686/x86_64 || OpenVZ || Amsterdam, Bucharest, Dallas, Fremont, London ||<br />
|-<br />
| [https://www.linode.com Linode.com] || 2012.07 || Xen || Atlanta, Dallas, Fremont, London, Newark, Tokyo || Uses a custom kernel; do not install the {{pkg|linux}} package.<br />
|-<br />
| [http://lylix.net/home Lylix] || 2007.08 || ? || ? ||<br />
|-<br />
| [http://www.nodedeploy.com Node Deploy] || ? || OpenVZ, KVM || LA, Germany || unmanaged, solusvm server manager<br />
|-<br />
| [http://netcup.de Netcup] || 2011.10 x86_64 || vServer || Germany || beta, uses custom Kernel (2.6.36) with no direct iptables access<br />
|-<br />
| [http://onepoundwebhosting.co.uk OnePoundWebHosting] || 2012.09 x86_64 || Xen || UK ||<br />
|-<br />
| [http://openvz.ca/ OpenVZ.ca] || 2010.05 i686/x86_64 || OpenVZ || Canada ||<br />
|-<br />
| [https://www.proplay.biz/ proPlay.de] || 2011.10 i686/x86_64 || OpenVZ, KVM || Germany ||<br />
|-<br />
| [http://www.rackspace.com/cloud/cloud_hosting_products/servers/ Rackspace Cloud] || 2011.10 || Xen || Chicago, Dallas, London, Hong Kong || Can pay per hour.<br />
|-<br />
| [http://www.ramhost.us RamHost.us] || 2009.10 || OpenVZ, KVM || Atlanta, England, Germany, Los Angeles ||<br />
|-<br />
| [http://www.tilaa.nl/ Tilaa] || 2012.04 i686/x86_64 || KVM || Amsterdam ||<br />
|-<br />
| [https://www.transip.nl/ TransIP] || 2011.08 || KVM || Amsterdam ||<br />
|-<br />
| [http://www.xenvz.co.uk/ XenVZ] || 2009.12 x86_64 || OpenVZ, Xen || UK? ||<br />
|-<br />
| [http://www.virpus.com/ Virpus] || 2010.05 x86_64 || OpenVZ, Xen || Kansas City ||<br />
|-<br />
| [http://www.vmline.pl/ Vmline] || 2012.08.04-dual.iso || Xen-HVM || Poland - Kraków || [http://www.s-net.pl/en/ S-Net] reseller. It's probably imposible to install i686 due to lack of xen_netfront and xen_blkfront modules ||<br />
|-<br />
| [https://vps6.net/ VPS6.NET] || 2010.05 i686/x86_64 OpenVZ, 2012.01 x86_64 Xen || OpenVZ, Xen || Germany, Romania, Turkey, USA ||<br />
|-<br />
| [http://www.uk2.net/ UK2.net] || 2010.05 i686/x86_64 || Xen || United Kingdom || Appears to use a custom kernel; do not install the {{pkg|linux}} package.<br />
|}<br />
<br />
==Installation==<br />
<br />
===KVM===<br />
{{Expansion|Are there instructions specific to VPSes?}}<br />
See [[KVM#Preparing an (Arch) Linux guest]].<br />
<br />
===OpenVZ===<br />
{{Expansion|Move some of the [[#Troubleshooting]] instructions here.}}<br />
<br />
===Xen===<br />
{{Expansion|Are there instructions specific to VPSes?}}<br />
See [[Xen#Arch as Xen guest (PVHVM mode)]] and/or [[Xen#Arch as Xen guest (PV mode)]].<br />
<br />
==Troubleshooting==<br />
===OpenVZ: kernel too old for glibc===<br />
Are you on a virtual private server (VPS) with an old kernel & broke your system? Are you using OpenVZ?<br />
<br />
Check your kernel version with:<br />
<br />
{{bc|uname -r}}<br />
<br />
If your kernel is older than 2.6.32, you will need a custom version of glibc ([https://www.archlinux.org/news/minimum-kernel-requirement-2632/ because of dependencies in glibc]).<br />
<br />
Arch Template Used: https://dev.archlinux.org/~ibiru/openvz/2010.05/arch-2010.05-i686-minimal.tar.gz<br />
<br />
{{Note|for installs that have not been updated to glibc-2.16, it will save you lots of time and prevent major breakage to do:<br />
pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686/glibc-2.16.0-101-i686.pkg.tar.xz<br />
or<br />
pacman -U https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64/glibc-2.16.0-101-x86_64.pkg.tar.xz<br />
Add a single "-d" if needed. ''The instructions below assume that this has been done.''<br />
}}<br />
<br />
<br />
Following similar instructions from [[DeveloperWiki:usrlib]].<br />
<br />
Try doing the following to fix it:<br />
<br />
1) Edit {{ic|/etc/pacman.conf}} and add the following repository '''ABOVE [core]''':<br />
<br />
for 32-bit:<br />
<br />
{{bc|<nowiki>[glibc-vps]<br />
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/i686</nowiki>}}<br />
<br />
for 64-bit:<br />
<br />
{{bc|<nowiki>[glibc-vps]<br />
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64</nowiki>}}<br />
<br />
2) Then run {{ic|pacman -Syy}} followed by {{ic|pacman -Syu}}. You will be notified to upgrade pacman first.<br />
<br />
3) Upgrade the [[pacman]] database by running {{ic|pacman-db-upgrade}} as root.<br />
<br />
4) Edit {{ic|/etc/pacman.conf.pacnew}} (new pacman config file) and add the following repository '''ABOVE [core]''':<br />
<br />
{{bc|<nowiki>[glibc-vps]<br />
Server = https://dev.archlinux.org/~ibiru/openvz/glibc-vps/$arch</nowiki>}}<br />
<br />
5) Replace {{ic|/etc/pacman.conf}} with {{ic|/etc/pacman.conf.pacnew}} (run as root):<br />
<br />
{{bc|mv /etc/pacman.conf.pacnew /etc/pacman.conf}}<br />
<br />
6) Upgrade your whole system with new packages again {{ic|pacman -Syu}}<br />
<br />
If you get the following or similar error:<br />
{{bc|initscripts: /etc/profile.d/locale.sh exists in filesystem}}<br />
<br />
Simply delete that file (e.g., {{ic|rm -f /etc/profile.d/locale.sh}}), then run {{ic|pacman -Syu}} again.<br />
<br />
<br />
If you get the following or similar error:<br />
{{bc|filesystem: /etc/mtab exists in filesystem}}<br />
<br />
Run {{ic|pacman -S filesystem --force}}<br />
<br />
<br />
If you get the following or similar error:<br />
{{bc|libusb-compat: /usr/bin/libusb-config exists in filesystem}}<br />
<br />
Run {{ic|pacman -S libusb}} and then {{ic|pacman -S libusb-compat}}<br />
<br />
7) Before rebooting, you need to [[pacman|install]] the {{Pkg|makedev}} package by running {{ic|pacman -S makedev}}.<br />
<br />
8) Add MAKEDEV to {{ic|/etc/rc.local}}:<br />
<br />
{{bc|/usr/sbin/MAKEDEV tty<br />
/usr/sbin/MAKEDEV pty}}<br />
<br />
9) Edit {{ic|/etc/inittab}}, comment out the following lines (otherwise you will see errors in {{ic|/var/log/errors.log}}):<br />
<br />
{{bc|#c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux<br />
#c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux<br />
#c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux<br />
#c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux<br />
#c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux<br />
#c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux}}<br />
<br />
10) To enable the use of the {{ic|hostname}} command, [[pacman|install]] the package {{Pkg|inetutils}} from the [[Official Repositories|official repositories]]. <br />
<br />
11) Remove disabling of SysRq key since this is blocked by OpenVZ and causes errors<br />
<br />
Edit {{ic|/etc/sysctl.conf}}, comment out the following line:<br />
{{bc|1=#kernel.sysrq = 0}}<br />
<br />
12) Save and reboot.<br />
<br />
Enjoy & thank ioni if you happen to be in #archlinux<br />
<br />
===Moving your VPS from network configuration in rc.conf to netcfg (tested with OpenVZ)===<br />
<br />
1) Install netcfg<br />
<br />
{{bc|pacman -S netcfg}}<br />
<br />
2) Create a netcfg configuration file {{ic|/etc/network.d/venet}}<br />
<br />
{{bc|1=CONNECTION='ethernet'<br />
DESCRIPTION='VPS venet connection'<br />
INTERFACE='venet0'<br />
IP='static'<br />
IPCFG=(<br />
#IPv4 address<br />
'addr add xxx.xxx.xxx.xxx/32 broadcast 0.0.0.0 dev venet0'<br />
#IPv4 route<br />
'route add default dev venet0'<br />
#IPv6 address<br />
'addr add xxxx:xx:xx::x/128 dev venet0'<br />
#IPv6 route<br />
'-6 route add default dev venet0'<br />
)<br />
DNS=('xxx.xxx.xxx.xxx' 'xxx.xxx.xxx.xxx')}}<br />
<br />
3) Edit your netcfg main conf file {{ic|/etc/conf.d/netcfg}}<br />
<br />
{{bc|1=NETWORKS=(venet)<br />
WIRED_INTERFACE="venet0"}}<br />
<br />
4) Try your new setup<br />
<br />
{{bc|rc.d stop network && ip addr flush venet0 && netcfg venet}}<br />
<br />
Your VPS should still be connected and have its IP addresses set correctly. (Check with {{ic|ip a}})<br />
<br />
DO NOT proceed to next step if this isn't the case.<br />
<br />
5) Make your new setup survive reboots<br />
<br />
In the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, replace {{ic|network}} with {{ic|net-profiles}}.<br />
<br />
Remove all networking information that is in {{ic|/etc/rc.conf}}.<br />
{{bc|reboot}}<br />
<br />
===Moving your VPS from initscripts to systemd===<br />
<br />
This is very similar to a regular arch system, except you probably don't have access to your kernel line.<br />
<br />
1) Move from network in rc.conf to netcfg (see above).<br />
<br />
2) Install systemd<br />
<br />
{{bc|pacman -S systemd}}<br />
<br />
2 bonus for OpenVZ) Remove kernel core dump pattern since this is blocked by OpenVZ and causes errors<br />
<br />
Edit {{ic|/usr/lib/sysctl.d/coredump.conf}}, comment out the following line:<br />
{{bc|#kernel.core_pattern&#61;&#124;/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e}}<br />
<br />
3) Move all configuration from {{ic|/etc/rc.conf}} (except the {{ic|DAEMONS}} array) to its appropriate location.<br />
<br />
See [https://wiki.archlinux.org/index.php/Systemd#Native_configuration Native configuration] and [https://wiki.archlinux.org/index.php/Rc.conf rc.conf] for details.<br />
<br />
Now your {{ic|/etc/rc.conf}} should only contain the {{ic|DAEMONS}} array.<br />
<br />
4) Install systemd-sysvcompat<br />
<br />
{{bc|pacman -S systemd-sysvcompat}}<br />
<br />
It will ask to replace sysvinit, say yes.<br />
<br />
{{bc|reboot}}<br />
<br />
5) Move daemons from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}} to {{ic|systemd}}<br />
<br />
See the [https://wiki.archlinux.org/index.php/Systemd#Moving_away_from_the_DAEMONS_array guide] and the [https://wiki.archlinux.org/index.php/Daemons_List daemons list].<br />
<br />
If your {{ic|DAEMONS}} array is now empty, skip next step.<br />
<br />
6) Moving rc.d daemons with no systemd support, example: {{ic|vzquota}}<br />
<br />
Create a custom systemd service file for vzquota: {{ic|/etc/systemd/system/newvzquota.service}}:<br />
{{bc|1=[Unit]<br />
Description=Setup vzquota on VPS<br />
ConditionFileIsExecutable=/etc/rc.d/vzquota<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/etc/rc.d/vzquota start<br />
ExecStop=/etc/rc.d/vzquota stop<br />
TimeoutSec=0<br />
StandardInput=tty<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
{{Note|It is recommended to choose a .service file name that is different from the name of the daemon, because systemd might try to call the LEGACY scripts with the old name.}}<br />
<br />
Enable this service:<br />
{{bc|systemctl enable newvzquota.service}}<br />
<br />
Remove {{ic|vzquota}} from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}<br />
<br />
Repeat this step to remove all daemons from {{ic|/etc/rc.conf}}.<br />
<br />
7) Removing {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}}<br />
<br />
Write [https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files custom .service files] to replace functionality in {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}}. You can take a look at {{ic|/usr/lib/systemd/system/rc-local.service}} and {{ic|/usr/lib/systemd/system/rc-local-shutdown.service}} for inspiration.<br />
<br />
8) Removing {{ic|initscripts}}<br />
<br />
Your {{ic|/etc/rc.conf}} file must look like this:<br />
{{bc|1=DAEMONS=()}}<br />
and {{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}} must now be empty.<br />
<br />
Uninstall {{ic|initscripts}}<br />
{{bc|pacman -R initscripts}}<br />
<br />
{{bc|reboot}}<br />
<br />
===SSH fails: PTY allocation request failed on channel 0===<br />
<br />
Some VPSes have an outdated {{ic|rc.sysinit}}. You may be able to login via serial console or with<br />
<br />
{{bc|> ssh root@broken.server '/bin/bash -i'}}<br />
<br />
Then run the following:<br />
<br />
{{bc|# mv /etc/rc.sysinit.pacnew /etc/rc.sysinit<br />
# reboot}}<br />
<br />
Once it’s working, you should be able to comment out the {{ic|udevd_modprobe}} line in {{ic|rc.sysinit}} to save a bit of RAM the next time you reboot.<br />
<br />
If the above doesn’t work, take a look at<br />
http://fsk141.com/fix-pty-allocation-request-failed-on-channel-0.</div>Iv597https://wiki.archlinux.org/index.php?title=Git&diff=214033Git2012-07-22T19:27:54Z<p>Iv597: Syntax change for rc.d'ing git-daemon</p>
<hr />
<div>[[Category:Version Control System]]<br />
[[zh-CN:Git]]<br />
{{Article summary start}}<br />
{{Article summary text|Installing and using the Git VCS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Super Quick Git Guide}}: Generally about contributing to pacman, although it still serves as a practical Git tutorial<br />
{{Article summary wiki|Gitweb}}<br />
{{Article summary wiki|Cgit}}<br />
{{Article summary wiki|Subversion}}<br />
{{Article summary wiki|Concurrent Versions System}}<br />
{{Article summary link|GitHub|https://github.com/}}<br />
{{Article summary end}}<br />
<br />
[http://git-scm.com/ Git] is the version control system (VCS) coded by Linus Torvalds (the creator of the Linux kernel) after being criticized for using the proprietary BitKeeper with the Linux kernel. Git is now used to maintain sources for the Linux kernel as well as thousands of other projects, including [[Pacman]], Arch's package manager.<br />
<br />
There is extensive documentation, including guides and tutorials, available from the [http://git-scm.com/documentation official web site].<br />
<br />
==Installation==<br />
{{Pkg|git}} can be installed with [[pacman]] from the [extra] repository. If you care about using Git with other VCS software, mail servers, or using Git's GUI pay close attention to the optional dependencies.<br />
<br />
Bash completion (e.g. hitting {{keypress|Tab}} to complete commands you are typing) should work if you:<br />
{{bc|source /usr/share/git/completion/git-completion.bash}}<br />
Alternatively, you can install the {{Pkg|bash-completion}} package to load the completions automatically for new shells.<br />
<br />
If you want to use Git's built-in GUI (eg. {{Ic|gitk}} or {{Ic|git gui}}) you should install the {{Pkg|tk}} package or you will get a rather cryptic message:<br />
{{bc|/usr/bin/gitk: line 3: exec: wish: not found.}}<br />
<br />
== Configuration ==<br />
Git reads its configuration from a few INI type configuration files. In each git repository {{ic|.git/config}} is used for configuration options specific to that repository. Per-user ("global") configuration in {{ic|$HOME/.gitconfig}} is used as a fall-back from the repository configuration. You can edit the files directly but the preferred method is to use the git-config utility. For example,<br />
$ git config --global core.editor "nano -w"<br />
adds {{Ic|<nowiki>editor = nano -w</nowiki>}} to the {{Ic|<nowiki>[core]</nowiki>}} section of your {{ic|~/.gitconfig}} file.<br />
<br />
The [http://schacon.github.com/git/git-config.html man page for the git-config] utility has a fairly long list of variables which can be set.<br />
<br />
Here are some more basic configurations you will probably want:<br />
$ git config --global user.name "Firstname Lastname"<br />
$ git config --global user.email "your_email@youremail.com"<br />
$ git config --global color.ui true<br />
<br />
==Cheatsheet==<br />
Parts from everywhere, much from the wonderful tutorial here: http://schacon.github.com/git/gittutorial.html<br />
<br />
Additionally see [[Super Quick Git Guide]].<br />
<br />
Pull the network scripts with<br />
git clone <nowiki>git://projects.archlinux.org/netcfg.git</nowiki><br />
Update an existing clone<br />
git pull origin<br />
Commit changes<br />
git commit -a -m "changelog message"<br />
To create a new branch<br />
git branch somebranch<br />
Change to a different branch<br />
git checkout differentbranch<br />
Merge a branch to current active branch<br />
git merge somebranch<br />
Delete a branch<br />
git branch -d somebranch<br />
Push a local branch or tag to a remote repository<br />
git push REMOTENAME BRANCHNAME<br />
Delete a branch or tag in a remote repository<br />
git push REMOTENAME :BRANCHNAME<br />
Diff between two branches<br />
git diff master..somebranch<br />
Diff between two commit IDs (found in git log)<br />
git diff e9780c7cba2855350e914fde227a79bb63c1351d..8b014e40346b38b3b9bfc41359b4e8a68e804c0d<br />
Diff between the last two commits<br />
git diff HEAD^ HEAD<br />
Patchset between two branches (follows same syntax as git diff afaik)<br />
git format-patch master..somebranch<br />
Or better: http://wiki.winehq.org/GitWine#head-f7a29e7ed999b5924748a60c5a1cd4a019032d26<br />
git format-patch -o out origin<br />
Set [[nano]] as default editor<br />
git config --global core.editor "nano -w"<br />
<br />
==Git Prompt==<br />
The Git package comes with a Bash completion file. This file, also contains the necessary functions to provide git information on your Bash or zsh shell prompt. To enable it add {{Ic|$(__git_ps1 " (%s)")}} to you PS1 variable.<br />
* For Bash:<br />
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '<br />
* For zsh:<br />
PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '<br />
<br />
The {{Ic|%s}} is replaced by the current branch name. The git information is displayed only if you are navigating in a git repository. You can enable extra information by setting and exporting certain variables to a non-empty value as shown in the following table:<br />
<br />
{| border="1"<br />
|+<br />
! Variable !! Information<br />
|-<br />
| GIT_PS1_SHOWDIRTYSTATE || '''*''' for unstaged and '''+''' for staged changes<br />
|-<br />
| GIT_PS1_SHOWSTASHSTATE || '''$''' if something is stashed<br />
|-<br />
| GIT_PS1_SHOWUNTRACKEDFILES || '''%''' if there are untracked files<br />
|}<br />
<br />
In addition you can set the {{Ic|GIT_PS1_SHOWUPSTREAM}} variable to {{Ic|"auto"}} in order to see {{Ic|'''<'''}} if you are behind upstream, {{Ic|'''>'''}} if you are ahead and {{Ic|'''<>'''}} if you have diverged.<br />
<br />
{{Note|If you do not use Bash completion, consider sourcing {{ic|/usr/share/git/completion/git-completion.bash}} in your {{ic|~/.bashrc}}/{{ic|~/.zshrc}}}}<br />
<br />
{{Note|If you experience that {{Ic|$(__git_ps1)}} return {{Ic|((unknown))}} then there's a {{Ic|.git}} folder in your current directory which doesn't contain any repository, and therefore Git does not recognize it. This can for example happen if you for some reason mistake Git's config-file to be {{Ic|~/.git/config}} instead of {{Ic|~/.gitconfig}}.}}<br />
<br />
==Transfer Protocols==<br />
===Smart HTTP===<br />
Since version 1.6.6 git is able to use the HTTP(S) protocol as efficiently as SSH or GIT by utilizing the git-http-backend. Furthermore it is not only possible to clone or pull from repositories, but also to push into repositories over HTTP(S).<br />
<br />
The setup for this is rather simple as all you need to have installed is the Apache web server (with mod_cgi, mod_alias, and mod_env enabled) and of course, git:<br />
# pacman -S apache git<br />
<br />
Once you have your basic setup up and running, add the following to your Apache's config usually located at {{ic|/etc/httpd/conf/httpd.conf}}:<br />
<Directory "/usr/lib/git-core*"><br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
SetEnv GIT_PROJECT_ROOT /srv/git<br />
SetEnv GIT_HTTP_EXPORT_ALL<br />
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/<br />
<br />
The above example config assumes that your git repositories are located at {{ic|/srv/git}} and that you want to access them via something like <nowiki>http(s)://your_address.tld/git/your_repo.git</nowiki>. Feel free to customize this to your needs.<br />
<br />
{{Note|Of course you have to make sure that your Apache can read and write (if you want to enable push access) on your git repositories.}}<br />
<br />
For more detailed documentation, visit the following links:<br />
* http://progit.org/2010/03/04/smart-http.html<br />
* https://www.kernel.org/pub/software/scm/git/docs/v1.7.10.1/git-http-backend.html<br />
<br />
===Git SSH===<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in {{ic|~/.ssh}}) and copy its content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open {{ic|~/.ssh/authorized_keys}} in your favorite editor, and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
<pre style='overflow:auto'><br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
</pre><br />
Now you can checkout your git repository this way (change where needed. Here it is using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by {{keypress|Enter}}. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
====Specifying a non-standard port====<br />
Connecting on a port other than 22 can be configured on a per-host basis in {{ic|/etc/ssh/ssh_config}} or {{ic|~/.ssh/config}}. To set up ports for a repository, specify the path in {{ic|.git/config}} using the port number ''N'' and the '''absolute path''' ''/PATH/TO/REPO'':<br />
ssh://user@example.org:N/PATH/TO/REPO<br />
Typically the repository resides in the home directory of the user which allows you to use tilde-expansion. Thus to connect on port N=443,<br />
url = git@example.org:repo.git<br />
becomes:<br />
url = ssh://git@example.org:443/~git/repo.git<br />
<br />
===Git Daemon===<br />
{{Note|The git daemon only allows read access. For write access see [[#Git SSH]].}}<br />
This will allow URLs like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon {{ic|/etc/conf.d/git-daemon.conf}} (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
# rc.d start git-daemon<br />
<br />
To run the git-daemon every time at boot, just append {{Ic|git-daemon}} to {{Ic|DAEMONS}} line in [[rc.conf]].<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=== GIT repositories rights ===<br />
To restrict read/write access, you can simply use Unix rights, see http://sitaramc.github.com/gitolite/doc/overkill.html<br />
<br />
For a fine-grained rights access, see [[gitolite]] and [[gitosis]]<br />
<br />
==See also==<br />
* [http://git-scm.com/book Pro Git book]<br />
* [http://gitref.org/ Git Reference]<br />
* https://www.kernel.org/pub/software/scm/git/docs/<br />
* https://help.github.com/</div>Iv597