https://wiki.archlinux.org/api.php?action=feedcontributions&user=LinuxChristian&feedformat=atomArchWiki - User contributions [en]2024-03-28T19:12:45ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Mac&diff=226876Mac2012-10-04T21:48:59Z<p>LinuxChristian: More descriptive title</p>
<hr />
<div>[[Category:Apple]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary end}}<br />
<br />
Installing Arch Linux on a MacBook 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 [[Official Arch Linux Install Guide]], [[Beginners Guide]], [[Beginners Guide Appendix]], and [[Post Installation Tips]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. If you have a Macbook5,2 (Polycarbonate, Non-Unibody) and are having additional issues, please see [[Macbook5,2]] for additional help.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Installation of Mac OS X and Firmware Update | Install Mac OS X]]''': Regardless of the desired end-configuration, it helps to start from a clean install of OS X.<br />
# '''[[#Installation of Mac OS X and Firmware Update | Firmware Update]]''': This should help reduce errors and provide newer features for the hardware.<br />
# '''[[#Partitions | Partition]]''': This step either resizes or deletes the OS X partition and creates partitions for Arch Linux.<br />
# '''[[#Installation | Install Arch Linux]]''': The actual installation procedure.<br />
# '''[[#Post-Install Configuration | Post-Install Configuration]]''': MacBook specific configuration.<br />
<br />
{{ Tip | rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[MacBook#rEFIt|rEFIt]]. }}<br />
<br />
==Installation of Mac OS X and Firmware Update==<br />
<br />
[http://www.apple.com Apple] already has excellent instructions for installing Mac OS X. Follow their instructions. Finally, once OS X is installed, go to:<br />
<br />
Apple Menu --> Software Update<br />
<br />
And update all software. Once this has run, you will need to reboot your computer. Do this, and then run '''Software Update''' again to check to make sure that all updates have been installed.<br />
<br />
{{Note | Sometimes '''Software Update''' may not pick up all the firmware updates available for your computer. However, you can try to search this upgrades directly into the Apple's Support site.}}<br />
<br />
If you are not going to have Mac OS X installed, make backups of these files:<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
You will need this file later for iSight functionality.<br />
<br />
{{bc|/Library/ColorSync/Profiles/Displays/<FILES HERE>}}<br />
<br />
You will need the file(s) here for adjusting the [[#Color_Profile | color profile]].<br />
<br />
==Partitions==<br />
<br />
The next step in the installation is to re-partition the hard drive. If Mac OS X was installed using the typical procedure, then your drive should have a GPT format and the following partitions:<br />
<br />
* '''EFI''': a 200 MB partition at the beginning of the disk.It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''.<br />
* '''Mac OS X''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
* '''Recovery''': A recovery partition (only for Mac OS X 10.7+).<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* [[#Arch Linux Only | Arch Linux Only]] for single boot.<br />
* [[#Mac OS X with Arch Linux | Mac OS X with Arch Linux]] for dual boot.<br />
<br />
If you do not know which option to pick, we recommend the dual boot so you can still return to Mac OS X whenever you want.<br />
<br />
===Arch Linux Only===<br />
<br />
This situation is the easiest to deal with. Mostly, partitioning is the same as any other hardware that Arch Linux can be installed on. The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in Mac OS X before continuing further. The MacBook firmware relies on the value in Mac OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machines firmware unless you use an external drive to boot Mac OS X.<br />
You can boot in EFI mode (recommended) or bios-compatibility mode, if in doubt choose EFI.<br />
<br />
====EFI====<br />
*'''This requires GRUB 2 to work'''<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''cgdisk''' (gptfdisk package).<br />
* Create the necessary partitions.<br />
<br />
Simple example (no LVM, crypto):<br />
{{Note | The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].}}<br />
{{Note | For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].}}<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 [[MacBook#Installation | installation]]<br />
<br />
====BIOS-compatibility====<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. If you decide to use the GPT format, GRUB will not be able to recognize the partitioning scheme. GRUB2 is compatible with GPT.<br />
<br />
* Create the necessary partitions.<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
===Mac OS X with Arch Linux===<br />
<br />
The easiest way to partition your hard drive, so that Mac OS X and Arch Linux will co-exist, is to use partitioning tools in Mac 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 Mac OS X. Using these methods on a pre-existing system may have undesired results.}}<br />
<br />
{{Note | If you have any problems, try using [http://gparted.sourceforge.net/ gparted] (i.e. ''instead'' of using Disk Utility and/or cgdisk). It is capable of shrinking the OS X partition and creating Linux partitions ready for installation. }}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility.app''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''Volume scheme'''.<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, type the new (smaller) size for the Mac OS X partition in the size box and click '''Apply'''. This will create a new partition out of the empty space. You will delete this partition later.<br />
<br />
{{Note | if you wish to have a shared partition between Mac OS X and Arch Linux, then additional steps will need to happen here. Please see [[#Shared Partition|Shared Partition]].}}<br />
<br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* Boot the Arch install CD by holding down the alt key during Boot. Follow one of the procedures below according to your choice of boot-method.<br />
====EFI====<br />
* Run '''cgdisk'''<br />
<br />
* Delete the partition you made in Disk Utility.app and create the necessary partitions for Arch Linux. Mac OS X likes to see a 128MiB gap after partitions, so when you create the first partition after the last Mac OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. A simple example (no LVM, crypto):<br />
{{Note | The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].}}<br />
{{Note | If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use mac osx to format it in Disk Utility.app afterwards). Follow the grub efi install procedure, and mount your /boot/efi directory to the hfs+ partition you created. Finally, finish up again in mac osx 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)}}<br />
{{Note | For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 10GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
====BIOS-compatibility====<br />
* Run '''parted'''<br />
# parted<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain /boot. If you're not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the "Manually configure block devices..." option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which grub will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
===Mac OS X, Windows XP, & Arch Linux Triple boot===<br />
<br />
This may not work for everyone but it has been successfully tested on a Macbook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in Mac OS X, use the formatter on windows XP install CP, and then finish with Arch Linux tools.<br />
<br />
{{Warning | It is highly recommended that this only be attempted after a clean install of Mac OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, how much fo XP, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OSX 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OSX)<br />
:*sda2 (OSX install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note | Using this method you may not be able to have a shared partition between Mac OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as Grub). Download and install rEFIt [[http://refit.sourceforge.net/]]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
{{bc|<br />
cd /efi/refit<br />
./enable.sh<br />
}}<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OSX install CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run /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! Please continue to [[MacBook#Installation | installation]]<br />
<br />
==Booting Directly from GRUB==<br />
It is possible to boot directly from GRUB2 in efi mode without using refit. These instructions are known to work on a Macbook 7,1. It is advisable to host GRUB on either a fat32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in /efi/grub on an existing OS X partition:<br />
sudo bless --folder /efi/grub --file /efi/grub/grub.efi<br />
===Compilation===<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
===Example grub.cfg===<br />
{{out of date|reason=kernel26}}<br />
Note that there may be a better method for loading Windows.<br />
{{bc|1=<br />
set debug=video<br />
insmod efi_gop<br />
<br />
menuentry "Arch Linux EFI" {<br />
set root=(hd0,3)<br />
#search --set -f /boot/vmlinuz26-efi-physical<br />
#loadbios /boot/vbtrace_bios.bin /boot/int10.bin<br />
linux /boot/vmlinuz26-efi-physical root=/dev/sda3 reboot=pci resume=/dev/sda3 resume_offset=151552<br />
initrd /boot/kernel26-efi-physical.img<br />
}<br />
<br />
menuentry "MacOSX" {<br />
set root=(hd0,2)<br />
# Search the root device for Mac OS X's loader.<br />
#search --set -f /usr/standalone/i386/boot.efi<br />
# Load the loader.<br />
chainloader /usr/standalone/i386/boot.efi<br />
}<br />
<br />
menuentry "Windows 7" {<br />
appleloader HD<br />
}<br />
<br />
menuentry "Boot from CD" {<br />
appleloader CD<br />
}<br />
<br />
menuentry "Boot from USB" {<br />
appleloader USB<br />
}<br />
}}<br />
<br />
==Installation==<br />
{{ Note | This section is only required if you want to have Mac OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[MacBook#Post-Install Configuration | post install]].}}<br />
<br />
* Boot from the Arch Linux install CD or the latest [[Archboot]] iso (unofficial) depending on your needs.<br />
{{Note | Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Log in as '''root'''<br />
<br />
{{Note | If you want to do a netinstall rather than installing the possibly outdated packages on the iso and depend on a wireless network that is encrypted, you should change to a free tty and connect manually before proceeding, see [[Beginners_Guide#Setup wireless in the live environment (optional)|Beginners_Guide]]}}<br />
<br />
* Run the Arch installer:<br />
<br />
/arch/setup<br />
<br />
* Proceed through the installation as described in the [[Official Arch Linux Install Guide]] '''except''' in the following areas:<br />
** In the [[Official Arch Linux Install Guide#Prepare Hard Drive | prepare hard drive]] stage, do only the [[Official Arch Linux Install Guide#Manually configure block devices, filesystems and mountpoints | set filesystem mountpoints]] step, taking care to assign the correct partitions. Partitions have already been created if you followed [[Macbook#Partition]]<br />
** '''(for booting with EFI''') After the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, exit the installer and install GRUB2, see [[GRUB2#During Arch Linux installation]].<br />
** '''(for booting with BIOS-compatibility)''' In the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** '''(for booting with BIOS-compatibility)''' Also in the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, install GRUB on whatever partition that {{ic|/boot}} is on. {{Warning | Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Official Arch Linux Install Guide#Configure System | configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
# reboot<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting Mac OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
=== Additional steps for Arch Linux only install===<br />
{{ Note | Do this after you tested that your setup is working. This procedure has been tested on a MacBook 4,1 with an msdos partition table. It may not work on newer versions. Please update if it works for you.}}<br />
* In order for Linux to boot up straight away, you will have to tell the firmware that your /boot partition is bootable, or you will always have to hold down the option (alt) key whenever you want to start up your computer.<br />
* In order to do this you will need the original Mac OS X install disk<br />
* Boot into it (you may need to hold the option (alt) key during boot again to access it)<br />
** Open Terminal.app (found under the Utilities menu in the menu bar), and type:<br />
# diskutil list<br />
** Find the device name of your /boot partition (this is your root (/) partition, if you don't have it separate). The format should be /dev/disk0sX, where X is a number from 1 to infinity<br />
** If using EFI type (replace X with the appropriate number):<br />
#bless --folder=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
# bless --mount=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
** If using BIOS-compatibility type (replace X with the appropriate number):<br />
# bless --device /dev/disk0sX --setBoot --legacy --verbose<br />
* Remove the installation disk and restart your computer<br />
* After a few seconds of grey screen, your boot loader screen should appear automatically.<br />
<br />
==Post-Install Configuration==<br />
<br />
=== Xorg ===<br />
<br />
Install and configure Xorg by following the [[Xorg]] article.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the '''xf86-video-intel''' driver. You can install it by typing<br />
<br />
# pacman -S xf86-video-intel<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 [https://wiki.archlinux.org/index.php/NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29 Pure Video HD] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the [https://aur.archlinux.org/packages.php?ID=25467 nvidia-bl] package found in the [[AUR]].<br />
<br />
{{Tip|If backlight control doesn't work after installing nvidia-bl, you should [[Kernel modules#Blacklisting|blacklist]] apple_bl kernel module.}}<br />
<br />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [https://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
===== MacbookPro 5.5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install [https://aur.archlinux.org/packages.php?ID=52283 nvidia-275xx] and [https://aur.archlinux.org/packages.php?ID=52285 nvidia-utils-275xx ] from [[AUR]], and possibly [https://aur.archlinux.org/packages.php?ID=52284 lib32-nvidia-utils-275xx] if you are on x86_64 system and want 32-bits support.<br />
<br />
MacbookPro 5.5 has an NVIDIA 9400m graphics card. This problem might apply to other devices as well.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OSX can be installed from the AUR: [https://aur.archlinux.org/packages.php?ID=46339 xf86-input-multitouch-git]. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as [https://aur.archlinux.org/packages.php?ID=48505 xf86-input-mtrack-git]. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a Macbook 7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook 2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on Macbook Pro(5,5):''' I found it is much simpler to use the xf86-input-synaptics[http://www.archlinux.org/packages/extra/x86_64/xf86-input-synaptics/] in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. Gsynaptics[http://www.archlinux.org/packages/community/i686/gsynaptics/] also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboard works by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install [https://aur.archlinux.org/packages.php?ID=14833 pommed] from the [[AUR]].<br />
<br />
Edit the '''/etc/pommed.conf''' according to your hardware on MacBook, building<br />
it from '''/etc/pommed.conf.mac''' or '''/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<br />
<br />
Put '''pommed''' at the end in your '''DAEMONS''' array in your '''/etc/rc.conf'''<br />
<br />
finally reboot your pc.<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 />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the [https://aur.archlinux.org/packages.php?ID=25467 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-utilities, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD ubuntu macbook pro 5,5] <br />
<br />
=== Wifi ===<br />
{{ Tip | MBP 6.2: since kernel 2.6.32.35-1 this works out of the box }}<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 all should works-out-of-the-box.<br />
<br />
* instead if you have a Broadcom follow the [[Broadcom BCM4312]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [http://wireless.kernel.org/en/users/Download compat-wireless]<br />
<br />
''Note'': if your connection frequently drops, you may have to turn off wifi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file /etc/pm/wireless with the lines {{bc|#!/bin/sh<br />
/sbin/iwconfig wlan0 power off}}<br />
<br />
=== Power management ===<br />
<br />
==== Laptop-mode-tools ====<br />
<br />
Because the MacBook is obviously a laptop, you may wish to control its power management features using something like [[Laptop Mode Tools]].<br />
<br />
However, Laptop Mode Tools is known to disable the keyboard in console mode after being idle for a few seconds (does not happen when using X). If this happens to you set <br />
<br />
CONTROL_USB_AUTOSUSPEND=0<br />
<br />
in {{ic|/etc/laptop-mode/conf.d/usb-autosuspend.conf}}. See this [https://bbs.archlinux.org/viewtopic.php?pid=984831 forum thread] for the original workaround.<br />
<br />
==== Suspend to RAM (kernel suspend) ====<br />
<br />
Suspend (the kernel suspend) should work out of the box (I had a problem in which the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
For a macbook2,1 (bought in 2007) s2ram works using <br />
s2ram -f -a 3 <br />
To make it work with kde4 you have to create a file named "config" into /etc/pm/config.d containing<br />
SLEEP_MODULE="uswsusp"<br />
S2RAM_OPTS="-f -a 3"<br />
<br />
For a MacBook Pro 3,1 (bought in 2008), the following command should work, both in X and in a console:<br />
s2ram -f -a 1<br />
<br />
Note: If you use pm-utils suspending lead (at least for me) disk freeze. Try changing /etc/pm/config.d/module to<br />
SLEEP_MODULE=tuxonice<br />
<br />
For a macbook5.5, s2ram may work using (be sure to run it in X)<br />
s2ram -f -p -m<br />
<br />
==== Suspend to disk (hibernate) ====<br />
{{Merge|Swap#Swap file|These part is duplication of Swap file section in Swap. Should check and merge it to Swap.}}<br />
Hibernate should work if you have a swap partition. If you opted for a swap file because of the MBR limitation to 4 primary partitions, you can still get hibernate functionality by following these instructions (this is mostly taken from http://ubuntuforums.org/showthread.php?t=1042946):<br />
<br />
* Create a swapfile (here 2G = bs*count):<br />
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2M<br />
It is recommended, but not necessary, to create the swapfile on a newly created partition, so that fragmentation is minimum.<br />
# chmod 600 swapfile <br />
# mkswap swapfile <br />
mkswap: swapfile: warning: don't erase bootbits sectors<br />
on whole disk. Use -f to force.<br />
Setting up swapspace version 1, size = 2097148 KiB<br />
no label, UUID=6bf46166-4f9e-433a-aac1-91cb3f5cf8ba<br />
# <br />
Note that we will not use this UUID later.<br />
* Add the swapfile in fstab:<br />
/swapfile none swap sw 0 0<br />
* Determine the UUID of partition on which the swapfile is (/sbin/blkid is provided by util-linux-ng)<br />
# blkid -g<br />
# blkid<br />
/dev/sda4: UUID="388014d3-1d18-4ca0-980e-ef2f9fdebde4" TYPE="ext3" <br />
388014d3-1d18-4ca0-980e-ef2f9fdebde4 is the number we are looking for.<br />
* Determine the physical offset of the swapfile:<br />
$ sudo filefrag -v /swapfile | head<br />
Filesystem type is: ef53<br />
Filesystem cylinder groups is approximately 132<br />
File size of /swapfile is 2147483648 (524288 blocks, blocksize 4096)<br />
ext logical physical expected length flags<br />
0 0 24576 12 merged<br />
1 12 24589 24587 1024 merged<br />
2 1036 25615 25612 1024 merged<br />
3 2060 26640 26638 1024 merged<br />
4 3084 27665 27663 1024 merged<br />
5 4108 28690 28688 1024 merged<br />
$ <br />
Here, 24576 is the number we want.<br />
* Edit /boot/grub/menu.lst and add:<br />
resume=/dev/disk/by-uuid/388014d3-1d18-4ca0-980e-ef2f9fdebde4 resume_offset=24576<br />
to your kernel stanza options (or use the kopt method as in the post). Note that the "resume=UUID=" actually did not work for me. I had to use the /dev/disk/by-uuid syntax.<br />
<br />
Note: "ro" has to be at the end of the line, like this:<br />
kernel /boot/vmlinuz-linux root=/dev/sda4 '''resume=/dev/sda4 resume_offset=24576''' ro<br />
* Nothing to do with update-grub nor mkinitcpio.<br />
* Reboot once<br />
* Try to hibernate<br />
<br />
=== Sound ===<br />
{{ Tip | MBP 5.5: since kernel 2.6.32 this works out of the box - just unmute the front speakers and store the sound level }}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your '''/etc/modprobe.d/50-sound.conf''' or '''/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 />
{{ Note | you can try to specify other options, agree with in your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
{{Note|Bluetooth should work out-of-the box. The hid2hci utility is used by default since bluez 4.91}}<br />
<br />
See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== iSight ===<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the '''Linux UVC driver''' natively. MBP 6.2+ (Kernel ~2.6.37+) iSight works out of the box without the need to use firmware from OS X. }}<br />
<br />
You can use many applications to test the camera:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format shot\d\d\d\d.png and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install and configure '''lm_sensors'''.<br />
See [[Lm sensors]] page.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from Mac OS.<br />
<br />
First, install [https://aur.archlinux.org/packages.php?ID=10969 xcalib] from the [[AUR]].<br />
<br />
Second copy pre-saved color profiles placed in '''/Library/ColorSync/Profiles/Displays/''' on Mac OS partition to '''~/colorprofiles/''' for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (not Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{ Tip | also Mac OS allows to save current color profile from '''Displays -> Color''' section of the '''Mac OS System Preferences''', in this case file is saved to '''/Users/<username>/Library/ColorSync/Profiles'''.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{ Warning | 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 />
{{ Note | see '''xcalib''' man pages for further information.}}<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 '''/dev/usb/hiddev0''' (or '''/dev/hiddev0''') by editing '''/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 lircd.conf below):<br />
<br />
sudo 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 '''/etc/lirc/lircd.conf''':<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
===HFS Partition Sharing===<br />
<br />
First, we need [https://aur.archlinux.org/packages.php?ID=6709 hfsprogs] package from AUR. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
sudo mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
===HFS+ Partitions===<br />
<br />
HFS+ partitions, now the default in Mac OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using Mac OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
====In OS X====<br />
<br />
{{Note | it is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
=====Step 1: Change UID and GID(s)=====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
<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 />
<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 />
<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
<br />
# Navigate to ''/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 />
<br />
# Click on '''Accounts'''.<br />
<br />
# Unlock the pane if not already done so.<br />
<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
<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 ''/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 />
sudo find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
====In Arch====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with Mac OS's home, by modify entries of the famous ''/etc/fstab'' file.<br />
<br />
=== Avoid long EFI wait before GRUB ===<br />
If your Macbook spends 30 seconds with "white screen" before GRUB shows, try booting from your Mac OS X install DVD, select language, then click Utilities->Terminal, and enter<br />
<br />
# bless --device /dev/disk0s1 --setBoot --legacy<br />
<br />
(given that if your GRUB is on sda1, /dev/disk0s2 if it is on sda2, etc). Via https://bbs.archlinux.org/viewtopic.php?pid=833215 <br />
<br />
=== Mute startup chime ===<br />
If you forgot to mute before installing, you can still mute again if you have a Mac OS X Install disk. Boot from it, select language, then click Utilities->Terminal, and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
==rEFIt==<br />
<br />
{{Note | this is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.}}<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; ./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 />
{{bc|<br />
GRUB>_<br />
}}<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 />
{{bc|<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
}}<br />
<br />
and for i386:<br />
{{bc|<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
}}<br />
<br />
since they are .deb packages you will need the program deb2targz<br />
<br />
pacman -S deb2targz<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook Pro ===<br />
<br />
==== 10,1 ====<br />
<br />
* [[MacBookPro Retina]].<br />
<br />
=== MacBook Air===<br />
==== Mid 2012 13" - Version 5,2 ====<br />
Kernel panics using default boot media under arch kernel 3.5. Adding 'intremap=off' fixes this. Additionally, there are problems loading the 'applesmc' module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
===== Installing using the Archboot 2012.06 image =====<br />
Several people have reported problems installing Arch Linux on the MBA version 5,2 (See [https://bbs.archlinux.org/viewtopic.php?id=144089 problems booting archlinux on a MacBook Air Mid 2012]). A common problem is that the screen is not detected and therefore goes black when the installer boots. To fix this problem one has to select the normal install (Not the LTS) during boot and press tab to edit the boot flags. Then add noapic flag to the boot line. This should fix the screen going black. Install the system as you normally would. It may help later in the configuration process if the support packages are installed already at this stage.<br />
<br />
When the install has finished again add the noapic flag to the grub2 boot line (if you use grub2) and also add i915.diescreaming=1 (or perhaps i915.die). This should keep the screen from going black when booting the new system. After you enter the system the wireless driver should be loaded. If you installed the support packages during installation you should have the wifi-menu command. Run it and select the network you want to use. One could also use wpa_supplicant but wifi-menu is quite fast to use at this stage. Now you are ready to upgrade the system. As of writing there have been a lot of changes to Archlinux since the 2012.06 image of Archboot was released ([https://www.archlinux.org/news/filesystem-upgrade-manual-intervention-required-1/ filesystem] and [https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ glibc]). Therefore the upgrade process can be a bit difficult. The current solution has sucessfully upgraded a standart archboot version to a up-to-date version as of October 2012 and this step should be obsolete in future releases of archboot.<br />
<br />
First ignore the new "big" changes to Arch Linux,<br />
<br />
pacman -Suy --ignore glibc,libarchive,curl,filesystem <br />
<br />
If this only upgrades pacman then run the command again. Remember to make sure that pacman is ignoring the packages you don't want upgraded now. Otherwise you may break the system and have to reinstall! Now upgrade to the new filesystem,<br />
<br />
pacman -S filesystem --force<br />
<br />
As described here ([https://wiki.archlinux.org/index.php/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 />
pacman -S linux<br />
<br />
Now this command shouldn't give any errors like last time. You can also reinstall gcc at this point. After a rebooted the system should startup and the new kernel should have fixed the problem with the screen going black. If want to boot Xorg then you may need to remove the i915.diescreaming=1 line from GRUB2. 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 />
Works out-of-the-box since kernel 3.2. It is recommended to use [[Archboot]], install [[GRUB2]] and use EFI.<br />
<br />
== See also ==<br />
<br />
* http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-pro/<br />
* http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
* http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/<br />
* http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Mac&diff=226875Mac2012-10-04T21:47:55Z<p>LinuxChristian: Upgrade guide to Archboot 2012.06</p>
<hr />
<div>[[Category:Apple]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary end}}<br />
<br />
Installing Arch Linux on a MacBook 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 [[Official Arch Linux Install Guide]], [[Beginners Guide]], [[Beginners Guide Appendix]], and [[Post Installation Tips]]. This guide contains installation-instructions that can be used on any Apple computer whose hardware is supported by the Linux kernel. If you have a Macbook5,2 (Polycarbonate, Non-Unibody) and are having additional issues, please see [[Macbook5,2]] for additional help.<br />
<br />
== Overview ==<br />
<br />
Specifically, the procedure for installing Arch Linux on a MacBook is:<br />
<br />
# '''[[#Installation of Mac OS X and Firmware Update | Install Mac OS X]]''': Regardless of the desired end-configuration, it helps to start from a clean install of OS X.<br />
# '''[[#Installation of Mac OS X and Firmware Update | Firmware Update]]''': This should help reduce errors and provide newer features for the hardware.<br />
# '''[[#Partitions | Partition]]''': This step either resizes or deletes the OS X partition and creates partitions for Arch Linux.<br />
# '''[[#Installation | Install Arch Linux]]''': The actual installation procedure.<br />
# '''[[#Post-Install Configuration | Post-Install Configuration]]''': MacBook specific configuration.<br />
<br />
{{ Tip | rEFIt is a popular bootloader for EFI-firmware computers (including Macs). It can be installed at any time during the installation. For instructions, please see [[MacBook#rEFIt|rEFIt]]. }}<br />
<br />
==Installation of Mac OS X and Firmware Update==<br />
<br />
[http://www.apple.com Apple] already has excellent instructions for installing Mac OS X. Follow their instructions. Finally, once OS X is installed, go to:<br />
<br />
Apple Menu --> Software Update<br />
<br />
And update all software. Once this has run, you will need to reboot your computer. Do this, and then run '''Software Update''' again to check to make sure that all updates have been installed.<br />
<br />
{{Note | Sometimes '''Software Update''' may not pick up all the firmware updates available for your computer. However, you can try to search this upgrades directly into the Apple's Support site.}}<br />
<br />
If you are not going to have Mac OS X installed, make backups of these files:<br />
<br />
/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport<br />
<br />
You will need this file later for iSight functionality.<br />
<br />
{{bc|/Library/ColorSync/Profiles/Displays/<FILES HERE>}}<br />
<br />
You will need the file(s) here for adjusting the [[#Color_Profile | color profile]].<br />
<br />
==Partitions==<br />
<br />
The next step in the installation is to re-partition the hard drive. If Mac OS X was installed using the typical procedure, then your drive should have a GPT format and the following partitions:<br />
<br />
* '''EFI''': a 200 MB partition at the beginning of the disk.It is often read as '''msdos''' or '''FAT''' by some partitioning tools and usually labeled ''#1''.<br />
* '''Mac OS X''': the ''(HFS+)'' partition that should take up all of the remaining disk space. Usually labeled ''#2''.<br />
* '''Recovery''': A recovery partition (only for Mac OS X 10.7+).<br />
How to partition depends on how many operating systems you want install. The following options will be explained:<br />
<br />
* [[#Arch Linux Only | Arch Linux Only]] for single boot.<br />
* [[#Mac OS X with Arch Linux | Mac OS X with Arch Linux]] for dual boot.<br />
<br />
If you do not know which option to pick, we recommend the dual boot so you can still return to Mac OS X whenever you want.<br />
<br />
===Arch Linux Only===<br />
<br />
This situation is the easiest to deal with. Mostly, partitioning is the same as any other hardware that Arch Linux can be installed on. The only special consideration is the MacBook firmware boot sound. To ensure that this sound is off: '''mute''' the volume in Mac OS X before continuing further. The MacBook firmware relies on the value in Mac OS X, if available. Note that if you choose to get rid of the OS X partition, there is no easy way to update your machines firmware unless you use an external drive to boot Mac OS X.<br />
You can boot in EFI mode (recommended) or bios-compatibility mode, if in doubt choose EFI.<br />
<br />
====EFI====<br />
*'''This requires GRUB 2 to work'''<br />
* Boot installation medium and switch to a free tty.<br />
* Run '''cgdisk''' (gptfdisk package).<br />
* Create the necessary partitions.<br />
<br />
Simple example (no LVM, crypto):<br />
{{Note | The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].}}<br />
{{Note | For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].}}<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 [[MacBook#Installation | installation]]<br />
<br />
====BIOS-compatibility====<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. If you decide to use the GPT format, GRUB will not be able to recognize the partitioning scheme. GRUB2 is compatible with GPT.<br />
<br />
* Create the necessary partitions.<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
===Mac OS X with Arch Linux===<br />
<br />
The easiest way to partition your hard drive, so that Mac OS X and Arch Linux will co-exist, is to use partitioning tools in Mac 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 Mac OS X. Using these methods on a pre-existing system may have undesired results.}}<br />
<br />
{{Note | If you have any problems, try using [http://gparted.sourceforge.net/ gparted] (i.e. ''instead'' of using Disk Utility and/or cgdisk). It is capable of shrinking the OS X partition and creating Linux partitions ready for installation. }}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility.app''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''Volume scheme'''.<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, depending on the number of software applications and files.<br />
<br />
* Finally, type the new (smaller) size for the Mac OS X partition in the size box and click '''Apply'''. This will create a new partition out of the empty space. You will delete this partition later.<br />
<br />
{{Note | if you wish to have a shared partition between Mac OS X and Arch Linux, then additional steps will need to happen here. Please see [[#Shared Partition|Shared Partition]].}}<br />
<br />
* If the above completed successfully, then you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* Boot the Arch install CD by holding down the alt key during Boot. Follow one of the procedures below according to your choice of boot-method.<br />
====EFI====<br />
* Run '''cgdisk'''<br />
<br />
* Delete the partition you made in Disk Utility.app and create the necessary partitions for Arch Linux. Mac OS X likes to see a 128MiB gap after partitions, so when you create the first partition after the last Mac OS X-partition, type in '''+128M''' when cgdisk asks for the first sector for the partition. A simple example (no LVM, crypto):<br />
{{Note | The swap partition is optional, on machines with a RAM of size 4GB or more, good performance can be expected without a swap partition. Also, a '''swap file''' can be created later, see [[Swap#Swap file|Swap file]].}}<br />
{{Note | If you want to be able to boot GRUB from the Apple boot loader, you can create a small hfs+ partition (for convenience, use mac osx to format it in Disk Utility.app afterwards). Follow the grub efi install procedure, and mount your /boot/efi directory to the hfs+ partition you created. Finally, finish up again in mac osx 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)}}<br />
{{Note | For more information on partitioning, see [[Beginners'_Guide#Partitioning hard disks: General information|Partitioning hard disks: General information]].}}<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 - 100MiB hfs+ Boot Arch Linux from the Apple boot loader (optional)<br />
/dev/sda5 /boot 100MiB boot boot<br />
/dev/sda6 - ? swap swap (optional)<br />
/dev/sda7 / 10GiB ext4 root<br />
/dev/sda8 /home remaining ext4 home<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
====BIOS-compatibility====<br />
* Run '''parted'''<br />
# parted<br />
<br />
* Delete the empty space partition and partition the space as you would for any other installation. Note that MBR is limited to 4 primary partitions (including the efi partition). That leaves 2 primary partitions for arch. One strategy is to have a system and home partition, and use a swap file (I have not tried to use logical partitions). Another is to dedicate one partition to a shared partition (see below).<br />
<br />
* Next, create new filesystems on those partitions which need them, especially the partition which will contain /boot. If you're not sure how to do this using {{ic|mkfs.ext2}} (or whatever), run {{ic|/arch/setup}} and work through until you get to Prepare Hard Drive and use the "Manually configure block devices..." option, then exit the installer. This is necessary so that rEFIt will set the right partition type in the MBR in the next step (without an existing filesystem, it seems to ignore the partition type set by parted), without which grub will refuse to install to the right partition.<br />
<br />
* At this point you should reboot your computer and have rEFIt fix the partition tables on your hard drive. (If you do not do this, you may have to reinstall GRUB later on in order to have your Mac recognize the Linux partition.) When you are into the rEFIt menu, select '''update partition table''', then press Y.<br />
# reboot<br />
<br />
* Done, you can continue to [[MacBook#Installation | installation]]<br />
<br />
===Mac OS X, Windows XP, & Arch Linux Triple boot===<br />
<br />
This may not work for everyone but it has been successfully tested on a Macbook from late 2009.<br />
<br />
The easiest way to partition your hard drive, so that all these operating systems can co-exist, is to use disk utility in Mac OS X, use the formatter on windows XP install CP, and then finish with Arch Linux tools.<br />
<br />
{{Warning | It is highly recommended that this only be attempted after a clean install of Mac OS X. Using these methods on a pre-existing system may have undesired results. At least back your stuff up with timemachine or clonezilla before you begin.}}<br />
<br />
'''Procedure''':<br />
* In Mac OS X, run '''Disk Utility''' (located in /Applications/Utilities)<br />
<br />
* Select the drive to be partitioned in the left-hand column (not the partitions!). Click on the '''partition''' tab on the right.<br />
<br />
* Select the volume to be resized in the '''volume scheme.'''<br />
<br />
* Decide how much space you wish to have for your Mac OS X partition, how much fo XP, and how much for Arch Linux. Remember that a typical installation of Mac OS X requires around 15-20 GiB, and XP about the same, depending on the number of software applications and files. Something like OSX 200Gb, XP 25Gb, Arch 25Gb should be fine.<br />
<br />
* Put your decisions into action by pressing the + button and adding the new partitions, Label them as you like and make sure that your XP partition is the last one on the disk and is formatted for FAT32. It is probably best to have Arch formatted in HFS format as to not confuse you later, it will be reformatted anyway.<br />
<br />
So in linux terms your partitions will be something like:<br />
<br />
:*sda (disk)<br />
:*sda1 (Mac boot partition - you cannot see this one in OSX)<br />
:*sda2 (OSX install in HFS+)<br />
:*sda3 (Arch install temporarly in HFS)<br />
:*sda4 (XP install in FAT32)<br />
<br />
* Finally, click '''apply'''. This will create a new partition out of the empty space.<br />
<br />
{{Note | Using this method you may not be able to have a shared partition between Mac OS X and Arch Linux, this is because the mac will only allow for 4 active partitions. You will however be able to mount a HFS partition in Arch for one workaround. There are other workarounds possible also.}}<br />
<br />
* If the above completed successfully, you can continue. If not, then you may need to fix your partitions from within Mac OS X first.<br />
<br />
* You will not be needing boot camp this way, the program rEFIt is much more flexible (though not as flexible as Grub). Download and install rEFIt [[http://refit.sourceforge.net/]]<br />
<br />
* Go into a terminal in OS X and perform the following, this will enable the rEFIt boot manager. <br />
{{bc|<br />
cd /efi/refit<br />
./enable.sh<br />
}}<br />
<br />
* Reboot to check the rEFIt is working, it should appear on boot. When it comes up go to the rEFIt partition manager and agree to the changes.<br />
<br />
* Put your XP install CD and boot it with rEFIt - You may have to reboot a few times until it is recognized by the boot loader. Install XP and once it is installed use the OSX install CD to get your drivers running nicely in XP.<br />
** Note: when installing XP make sure you select your XP partition and format it again inside the XP installer. If you do not reformat it will not work.<br />
<br />
* Boot the Arch install CD, log in as root and run /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! Please continue to [[MacBook#Installation | installation]]<br />
<br />
==Booting Directly from GRUB==<br />
It is possible to boot directly from GRUB2 in efi mode without using refit. These instructions are known to work on a Macbook 7,1. It is advisable to host GRUB on either a fat32 or HFS+ partition, but ext2 or ext3 may also work. GRUB's appleloader command does not currently work with the 7,1, but support can be added with the patch available [https://savannah.gnu.org/bugs/index.php?33185 here].<br />
<br />
After the GRUB install is in the desired location, the firmware needs to be instructed to boot from that location. This can be done from either an existing OS X install or an OS X install disk. The following command assumes that the GRUB install is in /efi/grub on an existing OS X partition:<br />
sudo bless --folder /efi/grub --file /efi/grub/grub.efi<br />
===Compilation===<br />
Some models may need EFI_ARCH set to i386.<br />
bzr branch --revision -2 bzr://bzr.savannah.gnu.org/grub/trunk/grub grub<br />
cd grub<br />
./autogen.sh<br />
patch -p1 < appleloader_macbook_7_1.patch<br />
export EFI_ARCH=x86_64<br />
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix=""<br />
make<br />
cd grub-core<br />
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot<br />
cp grub.efi *.mod *.lst yourinstalllocation<br />
<br />
===Example grub.cfg===<br />
{{out of date|reason=kernel26}}<br />
Note that there may be a better method for loading Windows.<br />
{{bc|1=<br />
set debug=video<br />
insmod efi_gop<br />
<br />
menuentry "Arch Linux EFI" {<br />
set root=(hd0,3)<br />
#search --set -f /boot/vmlinuz26-efi-physical<br />
#loadbios /boot/vbtrace_bios.bin /boot/int10.bin<br />
linux /boot/vmlinuz26-efi-physical root=/dev/sda3 reboot=pci resume=/dev/sda3 resume_offset=151552<br />
initrd /boot/kernel26-efi-physical.img<br />
}<br />
<br />
menuentry "MacOSX" {<br />
set root=(hd0,2)<br />
# Search the root device for Mac OS X's loader.<br />
#search --set -f /usr/standalone/i386/boot.efi<br />
# Load the loader.<br />
chainloader /usr/standalone/i386/boot.efi<br />
}<br />
<br />
menuentry "Windows 7" {<br />
appleloader HD<br />
}<br />
<br />
menuentry "Boot from CD" {<br />
appleloader CD<br />
}<br />
<br />
menuentry "Boot from USB" {<br />
appleloader USB<br />
}<br />
}}<br />
<br />
==Installation==<br />
{{ Note | This section is only required if you want to have Mac OS X installed along with Arch Linux. If not, follow the steps in the official install guide, then skip to [[MacBook#Post-Install Configuration | post install]].}}<br />
<br />
* Boot from the Arch Linux install CD or the latest [[Archboot]] iso (unofficial) depending on your needs.<br />
{{Note | Some MacBook users report strange keyboard output such as long delays and character doubling. To fix this problem, boot with the following options: arch noapic irqpoll acpi&#61;force}}<br />
<br />
* Log in as '''root'''<br />
<br />
{{Note | If you want to do a netinstall rather than installing the possibly outdated packages on the iso and depend on a wireless network that is encrypted, you should change to a free tty and connect manually before proceeding, see [[Beginners_Guide#Setup wireless in the live environment (optional)|Beginners_Guide]]}}<br />
<br />
* Run the Arch installer:<br />
<br />
/arch/setup<br />
<br />
* Proceed through the installation as described in the [[Official Arch Linux Install Guide]] '''except''' in the following areas:<br />
** In the [[Official Arch Linux Install Guide#Prepare Hard Drive | prepare hard drive]] stage, do only the [[Official Arch Linux Install Guide#Manually configure block devices, filesystems and mountpoints | set filesystem mountpoints]] step, taking care to assign the correct partitions. Partitions have already been created if you followed [[Macbook#Partition]]<br />
** '''(for booting with EFI''') After the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, exit the installer and install GRUB2, see [[GRUB2#During Arch Linux installation]].<br />
** '''(for booting with BIOS-compatibility)''' In the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, edit the menu.lst file and add '''reboot=pci''' to the end of the '''kernel''' lines, for example: {{bc|1=kernel /vmlinuz26 root=/dev/sda5 ro reboot=pci}} This will allow your MacBook to reboot correctly from Arch.<br />
** '''(for booting with BIOS-compatibility)''' Also in the [[Official Arch Linux Install Guide#Install Bootloader | install boot loader]] stage, install GRUB on whatever partition that {{ic|/boot}} is on. {{Warning | Do not install GRUB onto ''/dev/sda'' !!! Doing so is likely to lead to an unstable post-environment.}}<br />
** In the [[Official Arch Linux Install Guide#Configure System | configure system]] stage, edit /etc/mkinitcpio.conf and add the '''usbinput''' hook to the '''HOOKS''' line somewhere after the '''autodetect''' hook. This will load the drivers for your keyboard in case you need to use it before Arch boots (e.g. entering a [[LUKS]] password or using the troubleshooting shell).<br />
<br />
* When the install process is complete, reboot your computer.<br />
# reboot<br />
<br />
* If using optical media, hold down the eject key as your MacBook starts, this should eject the Arch Linux install disk.<br />
<br />
* If dual-booting Mac OS X and Arch Linux, hold down the alt (option) key while the system boots to use the Mac bootloader to select which OS to boot.<br />
<br />
=== Additional steps for Arch Linux only install===<br />
{{ Note | Do this after you tested that your setup is working. This procedure has been tested on a MacBook 4,1 with an msdos partition table. It may not work on newer versions. Please update if it works for you.}}<br />
* In order for Linux to boot up straight away, you will have to tell the firmware that your /boot partition is bootable, or you will always have to hold down the option (alt) key whenever you want to start up your computer.<br />
* In order to do this you will need the original Mac OS X install disk<br />
* Boot into it (you may need to hold the option (alt) key during boot again to access it)<br />
** Open Terminal.app (found under the Utilities menu in the menu bar), and type:<br />
# diskutil list<br />
** Find the device name of your /boot partition (this is your root (/) partition, if you don't have it separate). The format should be /dev/disk0sX, where X is a number from 1 to infinity<br />
** If using EFI type (replace X with the appropriate number):<br />
#bless --folder=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
# bless --mount=/Volumes/efi --file=/Volumes/efi/efi/arch/grubx64.efi --setBoot<br />
** If using BIOS-compatibility type (replace X with the appropriate number):<br />
# bless --device /dev/disk0sX --setBoot --legacy --verbose<br />
* Remove the installation disk and restart your computer<br />
* After a few seconds of grey screen, your boot loader screen should appear automatically.<br />
<br />
==Post-Install Configuration==<br />
<br />
=== Xorg ===<br />
<br />
Install and configure Xorg by following the [[Xorg]] article.<br />
<br />
==== Video ====<br />
<br />
Different MacBook models have different graphic cards.<br />
<br />
To see which graphics card you have type:<br />
<br />
$ lspci | grep VGA<br />
<br />
* If it returns a string containing '''intel''' you only need the '''xf86-video-intel''' driver. You can install it by typing<br />
<br />
# pacman -S xf86-video-intel<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 [https://wiki.archlinux.org/index.php/NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29 Pure Video HD] is available for hardware video decoding. }}<br />
<br />
For MacBooks with NVIDIA graphics, for the backlight to work properly you may need the [https://aur.archlinux.org/packages.php?ID=25467 nvidia-bl] package found in the [[AUR]].<br />
<br />
{{Tip|If backlight control doesn't work after installing nvidia-bl, you should [[Kernel modules#Blacklisting|blacklist]] apple_bl kernel module.}}<br />
<br />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [https://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
===== MacbookPro 5.5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install [https://aur.archlinux.org/packages.php?ID=52283 nvidia-275xx] and [https://aur.archlinux.org/packages.php?ID=52285 nvidia-utils-275xx ] from [[AUR]], and possibly [https://aur.archlinux.org/packages.php?ID=52284 lib32-nvidia-utils-275xx] if you are on x86_64 system and want 32-bits support.<br />
<br />
MacbookPro 5.5 has an NVIDIA 9400m graphics card. This problem might apply to other devices as well.<br />
<br />
==== Touchpad ====<br />
<br />
The touchpad should have basic functionality by default. A true multitouch driver which behaves very similarly to native OSX can be installed from the AUR: [https://aur.archlinux.org/packages.php?ID=46339 xf86-input-multitouch-git]. It supports 1, 2 and 3 finger gestures, including differentiation between horizontal and vertical 3 finger swipe. Additional details are available at [http://bitmath.org/code/multitouch/ the driver's project page].<br />
<br />
xf86-input-multitouch-git does not support any sort of configuration without editing the driver's source. Some users are also experiencing issues with false clicks from palm touches. There is now a much more configurable fork available as [https://aur.archlinux.org/packages.php?ID=48505 xf86-input-mtrack-git]. Configuration options are documented in the [https://github.com/BlueDragonX/xf86-input-mtrack readme].<br />
<br />
The following mtrack options work well on a Macbook 7,1:<br />
<br />
Option "Thumbsize" "50"<br />
Option "ScrollDistance" "100"<br />
<br />
Probably you need also to add:<br />
<br />
MatchDevicePath "/dev/input/event10"<br />
<br />
'''Special Note About Older Macbook Models (confirmed on MacBook 2,1):''' On older Macbook models (pre-multitouch), the touchpad will not function properly until you install the xf86-input-synaptics package. Please see [[Touchpad Synaptics]] for more information on installing and configuring this package.<br />
<br />
'''Note on Macbook Pro(5,5):''' I found it is much simpler to use the xf86-input-synaptics[http://www.archlinux.org/packages/extra/x86_64/xf86-input-synaptics/] in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. Gsynaptics[http://www.archlinux.org/packages/community/i686/gsynaptics/] also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
<br />
==== Keyboard ====<br />
<br />
MacBook keyboard works by default. For swaping fn keys with Fx keys see [[Apple Keyboard]].<br />
<br />
To enable it you can map with right application like '''xbindkeys''' or through DE preferences; but another very good way, that we recommend, is to install [https://aur.archlinux.org/packages.php?ID=14833 pommed] from the [[AUR]].<br />
<br />
Edit the '''/etc/pommed.conf''' according to your hardware on MacBook, building<br />
it from '''/etc/pommed.conf.mac''' or '''/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<br />
<br />
Put '''pommed''' at the end in your '''DAEMONS''' array in your '''/etc/rc.conf'''<br />
<br />
finally reboot your pc.<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 />
===== NVIDIA note =====<br />
<br />
If the brightness does not function correctly through pommed, make sure you have installed the [https://aur.archlinux.org/packages.php?ID=25467 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-utilities, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD ubuntu macbook pro 5,5] <br />
<br />
=== Wifi ===<br />
{{ Tip | MBP 6.2: since kernel 2.6.32.35-1 this works out of the box }}<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 all should works-out-of-the-box.<br />
<br />
* instead if you have a Broadcom follow the [[Broadcom BCM4312]] page.<br />
<br />
* 5.0 and 6.0 generation MacBooks may have a BCM43xx, follow the instructions for the broadcom-wl driver on the [[Broadcom wireless]] page. The interfaces can swap during reboot so its best to define them in a udev rule (instructions on the [[Broadcom wireless]] page).<br />
<br />
* 8.1 generation MacBooks have BCM4331, for which support is not present in either Linux (3.0 and 3.1) or the proprietary drivers by Broadcom. There is however preliminary support for it in Linux 3.2. To run the drivers on earlier kernels, you will need to use [http://wireless.kernel.org/en/users/Download compat-wireless]<br />
<br />
''Note'': if your connection frequently drops, you may have to turn off wifi power management. If you are running [[pm-utils]], you may override wireless power management by creating an executable file /etc/pm/wireless with the lines {{bc|#!/bin/sh<br />
/sbin/iwconfig wlan0 power off}}<br />
<br />
=== Power management ===<br />
<br />
==== Laptop-mode-tools ====<br />
<br />
Because the MacBook is obviously a laptop, you may wish to control its power management features using something like [[Laptop Mode Tools]].<br />
<br />
However, Laptop Mode Tools is known to disable the keyboard in console mode after being idle for a few seconds (does not happen when using X). If this happens to you set <br />
<br />
CONTROL_USB_AUTOSUSPEND=0<br />
<br />
in {{ic|/etc/laptop-mode/conf.d/usb-autosuspend.conf}}. See this [https://bbs.archlinux.org/viewtopic.php?pid=984831 forum thread] for the original workaround.<br />
<br />
==== Suspend to RAM (kernel suspend) ====<br />
<br />
Suspend (the kernel suspend) should work out of the box (I had a problem in which the machine would "suspend immediately after resume" in certain conditions when suspending by closing the lid. This was solved by de-selecting the option "event_when_closed_battery" in gconf-editor &rarr; gnome-power-manager &rarr; actions).<br />
<br />
For a macbook2,1 (bought in 2007) s2ram works using <br />
s2ram -f -a 3 <br />
To make it work with kde4 you have to create a file named "config" into /etc/pm/config.d containing<br />
SLEEP_MODULE="uswsusp"<br />
S2RAM_OPTS="-f -a 3"<br />
<br />
For a MacBook Pro 3,1 (bought in 2008), the following command should work, both in X and in a console:<br />
s2ram -f -a 1<br />
<br />
Note: If you use pm-utils suspending lead (at least for me) disk freeze. Try changing /etc/pm/config.d/module to<br />
SLEEP_MODULE=tuxonice<br />
<br />
For a macbook5.5, s2ram may work using (be sure to run it in X)<br />
s2ram -f -p -m<br />
<br />
==== Suspend to disk (hibernate) ====<br />
{{Merge|Swap#Swap file|These part is duplication of Swap file section in Swap. Should check and merge it to Swap.}}<br />
Hibernate should work if you have a swap partition. If you opted for a swap file because of the MBR limitation to 4 primary partitions, you can still get hibernate functionality by following these instructions (this is mostly taken from http://ubuntuforums.org/showthread.php?t=1042946):<br />
<br />
* Create a swapfile (here 2G = bs*count):<br />
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2M<br />
It is recommended, but not necessary, to create the swapfile on a newly created partition, so that fragmentation is minimum.<br />
# chmod 600 swapfile <br />
# mkswap swapfile <br />
mkswap: swapfile: warning: don't erase bootbits sectors<br />
on whole disk. Use -f to force.<br />
Setting up swapspace version 1, size = 2097148 KiB<br />
no label, UUID=6bf46166-4f9e-433a-aac1-91cb3f5cf8ba<br />
# <br />
Note that we will not use this UUID later.<br />
* Add the swapfile in fstab:<br />
/swapfile none swap sw 0 0<br />
* Determine the UUID of partition on which the swapfile is (/sbin/blkid is provided by util-linux-ng)<br />
# blkid -g<br />
# blkid<br />
/dev/sda4: UUID="388014d3-1d18-4ca0-980e-ef2f9fdebde4" TYPE="ext3" <br />
388014d3-1d18-4ca0-980e-ef2f9fdebde4 is the number we are looking for.<br />
* Determine the physical offset of the swapfile:<br />
$ sudo filefrag -v /swapfile | head<br />
Filesystem type is: ef53<br />
Filesystem cylinder groups is approximately 132<br />
File size of /swapfile is 2147483648 (524288 blocks, blocksize 4096)<br />
ext logical physical expected length flags<br />
0 0 24576 12 merged<br />
1 12 24589 24587 1024 merged<br />
2 1036 25615 25612 1024 merged<br />
3 2060 26640 26638 1024 merged<br />
4 3084 27665 27663 1024 merged<br />
5 4108 28690 28688 1024 merged<br />
$ <br />
Here, 24576 is the number we want.<br />
* Edit /boot/grub/menu.lst and add:<br />
resume=/dev/disk/by-uuid/388014d3-1d18-4ca0-980e-ef2f9fdebde4 resume_offset=24576<br />
to your kernel stanza options (or use the kopt method as in the post). Note that the "resume=UUID=" actually did not work for me. I had to use the /dev/disk/by-uuid syntax.<br />
<br />
Note: "ro" has to be at the end of the line, like this:<br />
kernel /boot/vmlinuz-linux root=/dev/sda4 '''resume=/dev/sda4 resume_offset=24576''' ro<br />
* Nothing to do with update-grub nor mkinitcpio.<br />
* Reboot once<br />
* Try to hibernate<br />
<br />
=== Sound ===<br />
{{ Tip | MBP 5.5: since kernel 2.6.32 this works out of the box - just unmute the front speakers and store the sound level }}<br />
<br />
First of all follow [[ALSA]] wiki page, then if something does not work correctly, continue reading this part.<br />
<br />
Edit your '''/etc/modprobe.d/50-sound.conf''' or '''/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 />
{{ Note | you can try to specify other options, agree with in your hardware. All other possible settings are listed in Kernel Documentation, avaible online:<br />
<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt ALSA-Configuration.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-Audio.txt]<br />
* [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt HD-Audio-Models.txt].}}<br />
<br />
Then, reboot.<br />
<br />
=== Bluetooth ===<br />
<br />
{{Note|Bluetooth should work out-of-the box. The hid2hci utility is used by default since bluez 4.91}}<br />
<br />
See the article on [[Bluetooth]] to install and configure all software needed.<br />
<br />
=== iSight ===<br />
<br />
{{Note|Linux kernel from 2.6.26 includes the '''Linux UVC driver''' natively. MBP 6.2+ (Kernel ~2.6.37+) iSight works out of the box without the need to use firmware from OS X. }}<br />
<br />
You can use many applications to test the camera:<br />
<br />
* MPlayer<br />
<br />
# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30<br />
<br />
* Cheese<br />
* Skype<br />
* Ekiga<br />
<br />
A simple solution to take snapshots is:<br />
<br />
# mplayer tv:// -vf screenshot<br />
<br />
and the pressing the s key to take a snapshot. Files are of the format shot\d\d\d\d.png and are reported in the standard output.<br />
<br />
=== Temperature Sensors ===<br />
<br />
For reading temperature just install and configure '''lm_sensors'''.<br />
See [[Lm sensors]] page.<br />
<br />
=== Color Profile ===<br />
<br />
We can use color profiles from Mac OS.<br />
<br />
First, install [https://aur.archlinux.org/packages.php?ID=10969 xcalib] from the [[AUR]].<br />
<br />
Second copy pre-saved color profiles placed in '''/Library/ColorSync/Profiles/Displays/''' on Mac OS partition to '''~/colorprofiles/''' for example.<br />
<br />
There are color profile files agree with in MacBook models; select the right one:<br />
<br />
* '''Color LCD-4271800.icc''' for MacBook Pro with CoreDuo CPU<br />
* '''Color LCD-4271880.icc''' for MacBook with Core2Duo<br />
* '''Color LCD-4271780.icc''' for MacBook (not Pro) based on CoreDuo or Core2Duo.<br />
<br />
{{ Tip | also Mac OS allows to save current color profile from '''Displays -> Color''' section of the '''Mac OS System Preferences''', in this case file is saved to '''/Users/<username>/Library/ColorSync/Profiles'''.}}<br />
<br />
Finally you can activate it by running<br />
<br />
# xcalib ~/colorprofile.icc<br />
<br />
{{ Warning | 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 />
{{ Note | see '''xcalib''' man pages for further information.}}<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 '''/dev/usb/hiddev0''' (or '''/dev/hiddev0''') by editing '''/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 lircd.conf below):<br />
<br />
sudo 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 '''/etc/lirc/lircd.conf''':<br />
<br />
begin remote<br />
<br />
name lircd.conf.macbook<br />
bits 8<br />
eps 30<br />
aeps 100<br />
<br />
one 0 0<br />
zero 0 0<br />
pre_data_bits 24<br />
pre_data 0x87EEFD<br />
gap 211994<br />
toggle_bit_mask 0x87EEFD01<br />
<br />
begin codes<br />
Repeat 0x01<br />
Menu 0x03<br />
Play 0x05<br />
Prev 0x09<br />
Next 0x06<br />
Up 0x0A<br />
Down 0x0C<br />
end codes<br />
<br />
end remote<br />
<br />
===HFS Partition Sharing===<br />
<br />
First, we need [https://aur.archlinux.org/packages.php?ID=6709 hfsprogs] package from AUR. <br />
<br />
we have to list our partitions. Use<br />
<br />
fdisk -l /dev/sda<br />
<br />
example output:<br />
<br />
# fdisk -l /dev/sda<br />
Device Boot Start End Blocks Id Type<br />
/dev/sda1 1 26 204819 ee GPT<br />
/dev/sda2 26 13602 109051903+ af Unknown<br />
/dev/sda3 * 13602 14478 7031250 83 Linux<br />
/dev/sda4 14478 14594 932832+ 82 Linux swap / Solaris<br />
<br />
As we see, the "Unknown" partition is our OS X partition, which is located in {{ic|/dev/sda2}}.<br />
<br />
Create a "mac" folder in /media:<br />
<br />
sudo mkdir /media/mac<br />
<br />
Add at the end of ''/etc/fstab'' this line:<br />
<br />
/dev/sda2 /media/mac hfsplus auto,user,rw,exec 0 0<br />
<br />
Mount it :<br />
<br />
mount /media/mac<br />
<br />
and check it:<br />
<br />
ls /media/mac<br />
<br />
===HFS+ Partitions===<br />
<br />
HFS+ partitions, now the default in Mac OS X, are not fully supported by Linux and are mounted as read-only by default. In order to write to an HFS+ partition, it is necessary to disable journaling. This can be accomplished using Mac OS X Disk Utility. Refer to this [http://support.apple.com/kb/ht2355 Apple support page] for more information.<br />
<br />
===Home Sharing===<br />
<br />
'''''UID Synchronization'''''<br />
<br />
====In OS X====<br />
<br />
{{Note | it is strongly recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.}}<br />
<br />
=====Step 1: Change UID and GID(s)=====<br />
<br />
'''''Pre-Leopard'''''<br />
<br />
# Open '''NetInfo Manager''' located in the ''/Applications/Utilities'' folder.<br />
<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 />
<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 />
<br />
# Change the '''UID''' value to 1000 (the value used by default for first user created in Arch).<br />
<br />
# Also change the '''GID''' value to 1000 (the value used by default for user account creation in Arch).<br />
<br />
# Navigate to ''/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 />
<br />
# Click on '''Accounts'''.<br />
<br />
# Unlock the pane if not already done so.<br />
<br />
# Right-click on the desired user and select '''Advanced Options'''.<br />
<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 ''/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 />
sudo find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group> {} \;<br />
<br />
====In Arch====<br />
<br />
To synchronize your UID in Arch Linux, you are advised to perform this operation ''while creating a new user account''.<br />
It is therefore recommended that you do this as soon as you install Arch Linux.<br />
<br />
Now you must substitute Arch's home with Mac OS's home, by modify entries of the famous ''/etc/fstab'' file.<br />
<br />
=== Avoid long EFI wait before GRUB ===<br />
If your Macbook spends 30 seconds with "white screen" before GRUB shows, try booting from your Mac OS X install DVD, select language, then click Utilities->Terminal, and enter<br />
<br />
# bless --device /dev/disk0s1 --setBoot --legacy<br />
<br />
(given that if your GRUB is on sda1, /dev/disk0s2 if it is on sda2, etc). Via https://bbs.archlinux.org/viewtopic.php?pid=833215 <br />
<br />
=== Mute startup chime ===<br />
If you forgot to mute before installing, you can still mute again if you have a Mac OS X Install disk. Boot from it, select language, then click Utilities->Terminal, and enter<br />
<br />
# /usr/sbin/nvram SystemAudioVolume=%01<br />
<br />
(or whatever volume you want).<br />
<br />
==rEFIt==<br />
<br />
{{Note | this is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.}}<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; ./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 />
{{bc|<br />
GRUB>_<br />
}}<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 />
{{bc|<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_amd64.deb<br />
}}<br />
<br />
and for i386:<br />
{{bc|<br />
wget http://ftp.us.debian.org/debian/pool/main/r/refit/gptsync_0.14-2_i386.deb<br />
}}<br />
<br />
since they are .deb packages you will need the program deb2targz<br />
<br />
pacman -S deb2targz<br />
<br />
== Model-specific information ==<br />
<br />
=== MacBook Pro ===<br />
<br />
==== 10,1 ====<br />
<br />
* [[MacBookPro Retina]].<br />
<br />
=== MacBook Air===<br />
==== Mid 2012 13" - Version 5,2 ====<br />
Kernel panics using default boot media under arch kernel 3.5. Adding 'intremap=off' fixes this. Additionally, there are problems loading the 'applesmc' module (meaning the temperature sensors, fan, and keyboard backlight do not work). These problems are fixed in the linux 3.6-rc4 mainline kernel (I have tested).<br />
<br />
===== Installing using the Archboot 2012.06 image =====<br />
Several people have reported problems installing Arch Linux on the MBA version 5,2 (See [https://bbs.archlinux.org/viewtopic.php?id=144089 problems booting archlinux on a MacBook Air Mid 2012]). A common problem is that the screen is not detected and therefore goes black when the installer boots. To fix this problem one has to select the normal install (Not the LTS) during boot and press tab to edit the boot flags. Then add noapic flag to the boot line. This should fix the screen going black. Install the system as you normally would. It may help later in the configuration process if the support packages are installed already at this stage.<br />
<br />
When the install has finished again add the noapic flag to the grub2 boot line (if you use grub2) and also add i915.diescreaming=1 (or perhaps i915.die). This should keep the screen from going black when booting the new system. After you enter the system the wireless driver should be loaded. If you installed the support packages during installation you should have the wifi-menu command. Run it and select the network you want to use. One could also use wpa_supplicant but wifi-menu is quite fast to use at this stage. Now you are ready to upgrade the system. As of writing there have been a lot of changes to Archlinux since the 2012.06 image of Archboot was released ([https://www.archlinux.org/news/filesystem-upgrade-manual-intervention-required-1/ filesystem] and [https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ glibc]). Therefore the upgrade process can be a bit difficult. The current solution has sucessfully upgraded a standart archboot version to a up-to-date version as of October 2012 and this step should be obsolete in future releases of archboot.<br />
<br />
First ignore the new "big" changes to Arch Linux,<br />
<br />
pacman -Suy --ignore glibc,libarchive,curl,filesystem <br />
<br />
If this only upgrades pacman then run the command again. Remember to make sure that pacman is ignoring the packages you don't want upgraded now. Otherwise you may break the system and have to reinstall! Now upgrade to the new filesystem,<br />
<br />
pacman -S filesystem --force<br />
<br />
As described here ([https://wiki.archlinux.org/index.php/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 />
pacman -S linux<br />
<br />
Now this command shouldn't give any errors like last time. You can also reinstall gcc at this point. After a rebooted the system should startup and the new kernel should have fixed the problem with the screen going black. If want to boot Xorg then you may need to remove the i915.diescreaming=1 line from GRUB2. 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 />
==== 4,x ====<br />
Works out-of-the-box since kernel 3.2. It is recommended to use [[Archboot]], install [[GRUB2]] and use EFI.<br />
<br />
== See also ==<br />
<br />
* http://www.netsoc.tcd.ie/~theorie/interblag/2010/01/30/installing-arch-linux-on-a-mac-pro/<br />
* http://allanmcrae.com/2010/04/installing-arch-on-a-macbook-pro-5-5/<br />
* http://allanmcrae.com/2012/04/installing-arch-on-a-macbook-pro-8-1/<br />
* http://linux-junky.blogspot.com/2011/08/triple-boot-archlinux-windows-7-and-mac.html</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=SSH_keys&diff=218601SSH keys2012-08-19T16:16:34Z<p>LinuxChristian: Fixed missing filename in authorizedKeysFile command.</p>
<hr />
<div>[[Category:Secure Shell]]<br />
[[es:SSH Keys]]<br />
[[it:SSH Keys]]<br />
[[ru:SSH Keys]]<br />
[[sr:SSH Keys]]<br />
[[tr:SSH_Anahtarları]]<br />
[[zh-CN:SSH Keys]]<br />
SSH keys serve as a means of identifying yourself to an SSH server using [[Wikipedia:Public-key cryptography|public-key cryptography]] and [[Wikipedia:Challenge-response authentication|challenge-response authentication]]. One immediate advantange this method has over traditional password authentication is that you can be authenticated by the server without ever having to send your password over the network. Anyone eavesdropping on your connection will not be able to intercept and crack your password because it is never actually transmitted. Additionally, Using SSH keys for authentication virtually eliminates the risk posed by brute-force password attacks by drastically reducing the chances of the attacker correctly guessing the proper credentials.<br />
<br />
As well as offering additional security, SSH key authentication can be more convenient than the more traditional password authentication. When used with a program known as an SSH agent, SSH keys can allow you to connect to a server, or multiple servers, without having to remember or enter your password for each system.<br />
<br />
SSH keys are not without their drawbacks and may not be appropriate for all environments, but in many circumstances they can offer some strong advantages. A general understanding of how SSH keys work will help you decide how and when to use them to meet your needs. This article assumes you already have a basic understanding of the [[Secure Shell]] protocol and have installed the {{Pkg|openssh}} package, available in the [[Official Repositories]].<br />
<br />
==Background==<br />
SSH keys always come in pairs, one private and the other public. The private key is known only to you and it should be safely guarded. By contrast, the public key can be shared freely with any SSH server to which you would like to connect.<br />
<br />
When an SSH server has your public key on file and sees you requesting a connection, it uses your public key to construct and send you a challenge. This challenge is like a coded message and it must be met with the appropriate response before the server will grant you access. What makes this coded message particularly secure is that it can only be understood by someone with the private key. While the public key can be used to encrypt the message, it cannot be used to decrypt that very same message. Only you, the holder of the private key, will be able to correctly understand the challenge and produce the correct response.<br />
<br />
This challenge-response phase happens behind the scenes and is invisible to the user. As long as you hold the private key, which is typically stored in the {{ic|~/.ssh/}} directory, your SSH client should be able to reply with the appropriate response to the server.<br />
<br />
Because private keys are considered sensitive information, they are often stored on disk in an encrypted form. In this case, when the private key is required, a passphrase must first be entered in order to decrypt it. While this might superficially appear the same as entering a login password on the SSH server, it is only used to decrypt the private key on the local system. This passphrase is not, and should not, be transmitted over the network.<br />
<br />
==Generating an SSH key pair==<br />
An SSH key pair can be generated by running the {{ic|ssh-keygen}} command:<br />
<br />
{{hc<br />
|$ ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"<br />
|<nowiki>Generating public/private ecdsa key pair.<br />
Enter file in which to save the key (/home/username/.ssh/id_ecdsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/username/.ssh/id_ecdsa.<br />
Your public key has been saved in /home/username/.ssh/id_ecdsa.pub.<br />
The key fingerprint is:<br />
dd:15:ee:24:20:14:11:01:b8:72:a2:0f:99:4c:79:7f username@localhost-2011-12-22<br />
The key's randomart image is:<br />
+--[ECDSA 521]---+<br />
| ..oB=. . |<br />
| . . . . . |<br />
| . . . + |<br />
| oo.o . . = |<br />
|o+.+. S . . . |<br />
|=. . E |<br />
| o . |<br />
| . |<br />
| |<br />
+-----------------+</nowiki>}}<br />
<br />
In the above example, {{ic|ssh-keygen}} generates a 521 bit long ({{ic|-b 521}}) public/private ECDSA ({{ic|-t ecdsa}}) key pair with an extended comment including the data ({{ic|-C "$(whoami)@$(hostname)-$(date -I)"}}). The [http://www.cs.berkeley.edu/~dawnsong/papers/randomart.pdf randomart image] was introduced in OpenSSH 5.1 as an easier means of visually identifying the key fingerprint.<br />
<br />
===Choosing the type of encryption===<br />
The Elliptic Curve Digital Signature Algorithm (ECDSA) provides smaller key sizes and faster operations for equivalent estimated security to the previous methods. It was introduced as the preferred algorithm for authentication in OpenSSH 5.7, see [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]. '''ECDSA keys might not be compatible with systems that ship old versions of OpenSSH.''' Some vendors also disable the required implementations due to potential patent issues.<br />
<br />
If you choose to create an RSA (2048-4096 bit) or DSA (1024 bit) key pair instead of ECDSA, use the {{ic|-t rsa}} or {{ic|-t dsa}} switches in your {{ic|ssh-keygen}} command and do not forget to increase the key size. Running {{ic|ssh-keygen}} without the {{ic|-b}} switch should provide reasonable defaults.<br />
<br />
{{Note|These keys are used only to authenticate you; choosing stronger keys will not increase CPU load when transferring data over SSH.}}<br />
<br />
===Choosing the key location and passphrase===<br />
Upon issuing the {{ic|ssh-keygen}} command, you will be prompted for the desired name an location of your private key. By default, keys are stored in the {{ic|~/.ssh/}} directory and named according the type of encryption used. You are advised to accept the default name and location in order for later code examples in this article to work properly.<br />
<br />
When prompted for a passphrase, choose something that will be hard to guess if you have the security of your private key in mind. A longer, more random password will generally be stronger and harder to crack should it fall into the wrong hands.<br />
<br />
It is also possible to create your private key without a passphrase. While this can be convenient, you need to be aware of the associated risks. Without a passphrase, your private key will be stored on disk in an unencrypted form. Anyone who gains access to your private key file will then be able to assume your identity on any SSH server to which you connect using key-based authentication. Furthermore, without a passphrase, you must also trust the root user, as he can bypass file permissions and will be able to access your unencrypted private key file at any time.<br />
<br />
====Changing the private key's passphrase without changing the key====<br />
If the originally chosen SSH key passphrase is undesirable or must be changed, one can use the {{ic|ssh-keygen}} command to change the passphrase without changing the actual key.<br />
<br />
To change the passphrase for the private RSA key, run the following command:<br />
$ ssh-keygen -f ~/.ssh/id_rsa -p<br />
<br />
==Copying the public key to the remote server==<br />
Once you have generated a key pair, you will need to copy the public key to the remote server so that it will use SSH key authentication. The public key file shares the same name as the private key except that is appended with a {{ic|.pub}} extension. Note that the private key is not shared and remains on the local machine.<br />
<br />
===Simple method===<br />
If your key file is {{ic|~/.ssh/id_rsa.pub}} you can simply enter the following command.<br />
$ ssh-copy-id remote-server.org<br />
<br />
If your username differs on remote machine, be sure to prepend the username followed by {{ic|@}} to the server name.<br />
$ ssh-copy-id username@remote-server.org<br />
<br />
If your public key filename is anything other than the default of {{ic|~/.ssh/id_rsa.pub}} you will get an error stating {{ic|/usr/bin/ssh-copy-id: ERROR: No identities found}}. In this case, you must explicitly provide the location of the public key.<br />
$ ssh-copy-id -i ~/.ssh/id_ecdsa.pub username@remote-server.org<br />
<br />
If the ssh server is listening on a port other than default of 22, be sure to include it within the host argument.<br />
$ ssh-copy-id -i ~/.ssh/id_rsa.pub '-p 221 username@remote-server.org'<br />
<br />
===Traditional method===<br />
By default, for OpenSSH, the public key needs to be concatenated with {{ic|~/.ssh/authorized_keys}}. Begin by copying the public key to the remote server.<br />
<br />
$ scp ~/.ssh/id_ecdsa.pub username@remote-server.org:<br />
<br />
The above example copies the public key ({{ic|id_ecdsa.pub}}) to your home directory on the remote server via {{ic|scp}}. Do not forget to include the {{ic|:}} at the end of the server address. Also note that the name of your public key may differ from the example given.<br />
<br />
On the remote server, you will need to create the {{ic|~/.ssh}} directory if it does not yet exist and append your public key to the {{ic|authorized_keys}} file.<br />
<br />
$ ssh username@remote-server.org<br />
username@remote-server.org's password:<br />
$ mkdir ~/.ssh<br />
$ cat ~/id_ecdsa.pub >> ~/.ssh/authorized_keys<br />
$ rm ~/id_ecdsa.pub<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
The last two commands remove the public key file from the server and set the permissions on the {{ic|authorized_keys}} file such that it is only readable and writable by you, the owner.<br />
<br />
===Securing the authorized_keys file===<br />
<br />
You can further protect the {{ic|authorized_keys}} file in such a way that it can only be modified only by root.<br />
<br />
Create a directory, say, {{ic|/etc/ssh/user-keys}}, owned by root, and put users' keys in files named according to their usernames (e.g. {{ic|/etc/ssh/user-keys/john}}). Keep the files root-owned as well.<br />
<br />
Then change the {{ic|AuthorizedKeysFile}} option in {{ic|/etc/ssh/sshd_config}} to point to your new directory:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
AuthorizedKeysFile /etc/ssh/user-keys/%u/authorized_keys}}<br />
<br />
{{ic|%u}} will be expanded to the user's name when authenticating. The ssh daemon may need to be reloaded {{ic|rc.d reload sshd}}.<br />
<br />
{{Note|If you copy the {{ic|authorized_keys}} file from another location, make sure the permissions are set to 600. Run {{ic|chmod 600 authorized_keys}} to ensure this.}}<br />
<br />
==Disabling password logins==<br />
While copying your public key to the remote SSH server eliminates the need to transmit your password over the network, it does not give any added protection against a brute-force password attack. In the absence of a private key, the SSH server will fall back to password authentication by default, thus allowing a malicious user to attempt to gain access by guessing your password. To disable this behavior, edit the following lines in the {{ic|/etc/ssh/sshd_config}} file on the remote server.<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
PasswordAuthentication no<br />
ChallengeResponseAuthentication no}}<br />
<br />
==SSH agents==<br />
If your private key is encrypted with a passphrase, this passphrase must be entered every time you attempt to connect to an SSH server using public-key authentication. Each individual invocation of {{ic|ssh}} or {{ic|scp}} will need the passphrase in order to decrypt your private key before authentication can proceed.<br />
<br />
An SSH agent is a program which caches your decrypted private keys and provides them to SSH client programs on your behalf. In this arrangement, you must only provide your passphrase once, when adding your private key to the agent's cache. This facility can be of great convenience when making frequent SSH connections.<br />
<br />
An agent is typically configured to run automatically upon login and persist for the duration of your login session. A variety of agents, front-ends, and configurations exist to achieve this effect. This section provides an overview of a number of different solutions which can be adapted to meet your specific needs.<br />
<br />
===ssh-agent===<br />
ssh-agent is the default agent included with OpenSSH. It can be used directly or serve as the back-end to a few of the front-end solutions mentioned later in this section. When {{ic|ssh-agent}} is run, it will fork itself to the background and print out the environment variables it would use.<br />
<br />
$ ssh-agent<br />
SSH_AUTH_SOCK=/tmp/ssh-vEGjCM2147/agent.2147; export SSH_AUTH_SOCK;<br />
SSH_AGENT_PID=2148; export SSH_AGENT_PID;<br />
echo Agent pid 2148;<br />
<br />
To make use of these variables, run the command through the {{ic|eval}} command.<br />
<br />
$ eval $(ssh-agent)<br />
Agent pid 2157<br />
<br />
You can append the above command to your {{ic|~/.bash_profile}} script so that it will run automatically when starting a login shell.<br />
<br />
$ echo 'eval $(ssh-agent)' >> ~/.bash_profile<br />
<br />
If you would rather have ssh-agent run automatically for all users append the command to {{ic|/etc/profile}} instead.<br />
<br />
# echo 'eval $(ssh-agent)' >> /etc/profile<br />
<br />
Once {{ic|ssh-agent}} is running, you will need to add your private key to its cache.<br />
<br />
$ ssh-add ~/.ssh/id_ecdsa<br />
Enter passphrase for /home/user/.ssh/id_ecdsa:<br />
Identity added: /home/user/.ssh/id_ecdsa (/home/user/.ssh/id_ecdsa)<br />
<br />
If you would like your private keys to be added automatically on login. Append the following command to your {{ic|~/.bash_profile}} as well.<br />
<br />
$ echo 'ssh-add' >> ~/.bash_profile<br />
<br />
If your private key is encrypted {{ic|ssh-add}} will prompt you to enter your passphrase. Once your private key has been successfully added to the agent you will be able to make SSH connections without having to enter a passphrase.<br />
<br />
One downside to this approach is that a new instance of {{ic|ssh-agent}} is created for every login shell and each instance will persist between login sessions. Over time you can wind up with dozens of needless {{ic|ssh-agent}} processes running. There exist a number of front-ends to ssh-agent and alternative agents described later in this section which avoid this problem.<br />
<br />
===GnuPG Agent===<br />
<br />
{{Note|The stock gnupg Arch Linux package does not support ECC encryption and signing. Hence you cannot use the GnuPG agent to manage ECDSA keys.}}<br />
<br />
The [[GnuPG]] agent, distributed with the {{Pkg|gnupg}} package, available in the [[Official Repositories|official repositories]], has OpenSSH agent emulation. If you use GPG you might consider using its agent to take care of all of your keys. Otherwise you might like the PIN entry dialog it provides and its passphrase management, which is different from Keychain.<br />
<br />
To start using GPG agent for your SSH keys you should first start the gpg-agent with the {{ic|--enable-ssh-support}} option. Example (do not forget to make the file executable):<br />
{{hc|/etc/profile.d/gpg-agent.sh|<nowiki><br />
#!/bin/sh<br />
<br />
# Start the GnuPG agent and enable OpenSSH agent emulation<br />
gnupginf="${HOME}/.gpg-agent-info"<br />
<br />
if pgrep -u "${USER}" gpg-agent >/dev/null 2>&1; then<br />
eval `cat $gnupginf`<br />
eval `cut -d= -f1 $gnupginf | xargs echo export`<br />
else<br />
eval `gpg-agent -s --enable-ssh-support --daemon`<br />
fi<br />
</nowiki>}}<br />
<br />
Once gpg-agent is running you can use ssh-add to approve keys, just like you did with plain ssh-agent. The list of approved keys is stored in the {{ic|~/.gnupg/sshcontrol}} file. Once your key is approved you will get a PIN entry dialog every time your passphrase is needed. You can control passphrase caching in the {{ic|~/.gnupg/gpg-agent.conf}} file. The following example would have gpg-agent cache your keys for 3 hours: <br />
{{hc|~/.gnupg/gpg-agent.conf|<br />
# Cache settings<br />
default-cache-ttl 10800<br />
default-cache-ttl-ssh 10800<br />
}}<br />
Other useful settings for this file include the PIN entry program (GTK, QT or ncurses version), keyboard grabbing and so on...:<br />
<br />
{{Note|gpg-agent.conf must be created and the variable 'write-env-file' must be set in order to allow gpg-agent keys to be injected to SSH across logins. (Unless you restart the gpg-agent, and therefore export its settings, with every login.)}}<br />
{{hc|~/.gnupg/gpg-agent.conf|<nowiki><br />
# Environment file<br />
write-env-file /home/username/.gpg-agent-info<br />
<br />
# Keyboard control<br />
#no-grab<br />
<br />
# PIN entry program<br />
#pinentry-program /usr/bin/pinentry-curses<br />
#pinentry-program /usr/bin/pinentry-qt4<br />
#pinentry-program /usr/bin/pinentry-kwallet<br />
pinentry-program /usr/bin/pinentry-gtk-2<br />
<br />
</nowiki>}}<br />
<br />
===Keychain===<br />
[http://www.funtoo.org/en/security/keychain/intro/ Keychain] is a program designed to help you easily manage your SSH keys with minimal user interaction. It is implemented as a shell script which drives both {{ic|ssh-agent}} and {{ic|ssh-add}}. A notable feature of Keychain is that it can maintain a single {{ic|ssh-agent}} process across multiple login sessions. This means that you only need to enter your passphrase once each time your local machine is booted.<br />
<br />
[[pacman|Install]] the {{Pkg|keychain}} package, available from the [[Official Repositories]].<br />
<br />
Append the following line to {{ic|~/.bash_profile}}, or create {{ic|/etc/profile.d/keychain.sh}} as root and make it executable (e.g. {{ic|chmod 755 keychain.sh}}):<br />
{{hc|~/.bash_profile|<br />
eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa)<br />
}}<br />
<br />
In the above example, the {{ic|--eval}} switch outputs lines to be evaluated by the opening {{ic|eval}} command. This sets the necessary environments variables for SSH client to be able to find your agent. The {{ic|--agents}} switch is not strictly necessary, because Keychain will build the list automatically based on the existence of ssh-agent or gpg-agent on the system. Adding the {{ic|--quiet}} switch will limit output to warnings, errors, and user prompts. If you want greater security replace {{ic|-Q}} with {{ic|--clear}} but will be less convenient.<br />
<br />
If necessary, replace {{ic|~/.ssh/id_ecdsa}} with the path to your private key. For those using a non-Bash compatible shell, see {{ic|keychain --help}} or {{ic|man keychain}} for details on other shells.<br />
<br />
To test Keychain, log out from your session and log back in. If this is your first time running Keychain, it will prompt you for the passphrase of the specified private key. Because Keychain reuses the same {{ic|ssh-agent}} process on successive logins, you shouldn't have to enter your passphrase the next time you log in. You will only ever be prompted for your passphrase once each time the machine is rebooted.<br />
<br />
====Alternate startup methods====<br />
There are numerous ways in which Keychain can be invoked and you are encouraged to experiment to find a method that works for you. The {{ic|keychain}} command itself comes with dozens of command-line options which are described in the Keychain man page.<br />
<br />
One alternative implementation of a Keychain startup script could be to create the file {{ic|/etc/profile.d/keychain.sh}} as the root user and add the following lines.<br />
<br />
{{hc|/etc/profile.d/keychain.sh|<nowiki><br />
/usr/bin/keychain -Q -q --nogui ~/.ssh/id_ecdsa<br />
[[ -f $HOME/.keychain/$HOSTNAME-sh ]] && source $HOME/.keychain/$HOSTNAME-sh<br />
</nowiki>}}<br />
<br />
Be sure to also make {{ic|/etc/profile.d/keychain.sh}} executable by changing its file permissions.<br />
# chmod 755 /etc/profile.d/keychain.sh<br />
<br />
If you do not want to get asked for your passphrase every time you login but rather the first time you actually attempt to connect, you may add the following to your {{ic|.bashrc}}:<br />
alias ssh='eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet .ssh/id_rsa) && ssh'<br />
This will ask you if you try to use ssh for the first time. Remember however that this will ONLY ask you if {{ic|.bashrc}} is applicable. So you would always have your first ssh-command to be executed in a terminal.<br />
<br />
===x11-ssh-askpass===<br />
The x11-ssh-askpass package provides a graphical dialog for entering your passhrase when running an X session. x11-ssh-askpass depends only the {{Pkg|libx11}} and {{Pkg|libxt}} libraries, and the appearance of x11-ssh-askpass is customizable. While it can be invoked by the {{ic|ssh-add}} program which will then load your decrypted keys into [[#ssh-agent|ssh-agent]], the following instructions will instead configure x11-ssh-askpass to be invoked by the aforementioned [[#Keychain|Keychain]] script.<br />
<br />
Install {{Pkg|keychain}} and {{Pkg|x11-ssh-askpass}}, both available in the [[Official Repositories]].<br />
<br />
Edit your {{ic|~/.xinitrc}} file to include the lines highlighted in bold, replacing the name and location of your private if necessary. Be sure to place these commands '''before''' the line which invokes your window mananger.<br />
<br />
{{hc|~/.xinitrc|<br />
'''keychain ~/.ssh/id_ecdsa'''<br />
'''[ -f ~/.keychain/$HOSTNAME-sh ] && . ~/.keychain/$HOSTNAME-sh 2>/dev/null'''<br />
'''[ -f ~/.keychain/$HOSTNAME-sh-gpg ] && . ~/.keychain/$HOSTNAME-sh-gpg 2>/dev/null'''<br />
...<br />
exec openbox-session}}<br />
<br />
In the above example, the first line invokes {{ic|keychain}} and passes the name and location of your private key. If this is not the first time keychain was invoked, the following two lines load the contents of {{ic|$HOSTNAME-sh}} and {{ic|$HOSTNAME-sh-gpg}} if they exist. These files store the environment variables of the previous instance of {{ic|keychain}}.<br />
<br />
====Theming====<br />
The appearance of the x11-ssh-askpass dialog can be customized by setting its associated [[X resources]]. The x11-ssh-askpass [http://www.jmknoble.net/software/x11-ssh-askpass/ homepage] presents some example [http://www.jmknoble.net/software/x11-ssh-askpass/screenshots.html example themes]. See the x11-ssh-askpass man page for full details.<br />
<br />
====Alternative passphrase dialogs====<br />
There are other passphrase dialog programs which can be used instead of x11-ssh-askpass. The following list provides some alternative solutions.<br />
<br />
* {{Pkg|ksshaskpass}} is available in the Official Repositories. It is dependent on {{Pkg|kdelibs}} and is suitable for the KDE Desktop Environment.<br />
<br />
* {{Pkg|openssh-askpass}} depends on the {{Pkg|qt}} libraries, and is available from the Official Repositories.<br />
<br />
===pam_ssh===<br />
The [http://pam-ssh.sourceforge.net/ pam_ssh] project exists to provide a [[Wikipedia:Pluggable authentication module|Pluggable Authentication Module]] (PAM) for SSH private keys. This module can provide single sign-on behavior for your SSH connections. On login, your SSH private key passphrase can be entered in place of, or in addition to, your traditional system password. Once you have been authenticated, the pam_ssh module spawns ssh-agent to store your decrypted private key for the duration of the session.<br />
<br />
To enable single sign-on behavior at the tty login prompt, install the unofficial {{AUR|pam_ssh}} package, available in the [[Arch User Repository]]. <br />
<br />
Edit the {{ic|/etc/pam.d/login}} configuration file to include the text highlighted in bold in the example below. The order in which these lines appear is significiant and can affect login behavior.<br />
<br />
{{Warning|Misconfiguring PAM can leave the system in a state where all users become locked out. Before making any changes, you should have an understanding of how PAM configuration works as well as a backup means of accessing the PAM configuration files, such as an Arch Live CD, in case you become locked out and need to revert any changes. An IBM developerWorks [http://www.ibm.com/developerworks/linux/library/l-pam/index.html article] is available which explains PAM configuration in further detail.}}<br />
<br />
{{hc|/etc/pam.d/login|2=<br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
'''auth sufficient pam_ssh.so'''<br />
auth include system-local-login<br />
account include system-local-login<br />
session include system-local-login<br />
'''session optional pam_ssh.so'''<br />
}}<br />
<br />
{{out of date|The below paragraph has not been properly updated for {{pkg|pambase}}<nowiki>=</nowiki>20120701-1.}}<br />
<br />
In the above example, login uses the pam_ssh module to check the entered password against the user's SSH private key passphrase. If the password matches, the user is immediately authenticated and granted access to the system. If the password does not match, control falls to the pam_unix module included via the {{ic|/etc/pam.d/system-local-login}} file. The pam_unix module provides traditional system password authentication. Note, however, that the line which actually calls the pam_unix module resides in {{ic|/etc/pam.d/system-auth}} and this file is referenced in {{ic|/etc/pam.d/login}} through a series of "include" control flags. Because the pam_unix module is passed the {{ic|try_first_pass}} option, it first checks the previously entered password against the {{ic|/etc/passwd}} file instead of prompting for a password again if the pam_ssh authentication failed. In this way, the use of pam_ssh will be transparent to users without an SSH private key.<br />
<br />
If you use another means of logging in, such as an X11 display manager like [[SLiM]] or [[XDM]] and you would like it to provide similar functionality, you must edit its associated PAM configuration file in a similar fashion. Packages providing support for PAM typically place a default configuration file in the {{ic|/etc/pam.d/}} directory.<br />
<br />
Further details on how to use pam_ssh and a list of its options can be found in the pam_ssh man page.<br />
<br />
====Known issues with pam_ssh====<br />
Work on the pam_ssh project is infrequent and the documentation provided is sparse. You should be aware of some of its limitations which are not mentioned in the package itself.<br />
<br />
* SSH keys employing the newer option of ECDSA (elliptic curve) cryptography do not appear to be supported by pam_ssh. You must use either RSA or DSA keys.<br />
<br />
* The {{ic|ssh-agent}} process spawned by pam_ssh does not persist between user logins. If you like to keep a [[GNU Screen]] session active between logins you may notice when reattaching to your screen session that it can no longer communicate with ssh-agent. This is because the GNU Screen environment and those of its children will still reference the instance of ssh-agent which existed when GNU Screen was invoked but was subsequently killed in a previous logout. The [[#keychain|Keychain]] front-end avoids this problem by keeping the ssh-agent process alive between logins.<br />
<br />
===GNOME Keyring===<br />
If you use the [[GNOME]] desktop, the [[GNOME Keyring]] tool can be used as an SSH agent. Visit the [[GNOME Keyring]] article.<br />
<br />
==Troubleshooting==<br />
If it appears that the SSH server is ignoring your keys, ensure that you have the proper permissions set on all relevant files.<br /><br />
For the local machine:<br />
<br />
$ chmod 700 ~/<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/id_ecdsa<br />
<br />
For the remote machine:<br />
<br />
$ chmod 700 ~/<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
If that does not solve the problem you may try temporarily setting {{ic|StrictModes}} to {{ic|no}} in {{ic|sshd_config}}. If authentication with StrictModes off is successful, it is likely an issue with file permissions persists.<br />
{{Tip|Do not forget to set {{ic|StrictModes}} to {{ic|yes}} for added security.}}<br />
Make sure the remote machine supports the type of keys you are using. Try using RSA or DSA keys instead [[#Generating an SSH key pair]]<br />
Some servers do not support ECDSA keys. <br />
<br />
Failing this, run the sshd in debug mode and monitor the output while connecting:<br />
<br />
# /usr/sbin/sshd -d<br />
<br />
=== Using kdm ===<br />
It appears that kdm doesn't launch the ssh-agent process directly. You need to install the {{Pkg|kde-agent}}.<br />
<br />
==See also==<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc.html OpenSSH key management, Part 1]<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc2/ OpenSSH key management, Part 2]<br />
* [http://www-106.ibm.com/developerworks/library/l-keyc3/ OpenSSH key management, Part 3]<br />
* [http://kimmo.suominen.com/docs/ssh/ Getting started with SSH]<br />
* [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=OpenSSL&diff=215803OpenSSL2012-07-31T16:00:51Z<p>LinuxChristian: +Link</p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Security]]<br />
[http://www.openssl.org OpenSSL] is an open-source implementation of the SSL and TLS protocols, dual-licensed under the OpenSSL and the SSLeay licenses. It is supported on a variety of platforms, including BSD, Linux, OpenVMS, Solaris and Windows. It is designed to be as flexible as possible, and is free to use for both personal and commercial uses. It is based on the earlier SSLeay library. Version 1.0.0 of OpenSSL was released on March 29, 2010.<br />
<br />
==SSL introduction==<br />
<!-- Should be moved into [[SSL]] when someone covers other libraries, such as gnutls or the mozilla one. --><br />
In order to focus on setting up a SSL/TLS solution, rather than explaining the bare basics regarding the subject, the approach used throughout the article to explain SSL concepts is by and large file-oriented.<br />
<br />
Consult both [[Wikipedia:Certificate authority]] and [[Wikipedia:Public key infrastructure]] for more information.<br />
<br />
===Certificate authority (CA)===<br />
Certificate authorities return certificates from end-user requests. In order to do this, the returned end-user certificate is signed with the CA private key and CA certificate, which in turn contains the CA public key. CA also distribute certificate revocation lists (CRL) which tell the end-user what certificates are no longer valid, and when the next CRL is due.<br />
<br />
====CA private key====<br />
The CA private key is the crucial part of the trifecta. Exposing it would defeat the purpose of designating a central authority that validates and revokes permissions, and at the same time, it is the signed counter part to the CA public key used to certify against the CA certificate. An exposed CA private key could allow an attacker to replicate the CA certificate since the CA private key signature is embedded in the CA certificate itself.<br />
<br />
====CA certificate and public key====<br />
These are distributed in a single file to all end-users. They are used to certify other end-user certificates that claimed to be signed by the matching CA, such as mail servers or websites. <br />
<br />
===End-users===<br />
End-users submit certificate requests to the CA which contain a distinguished name (DN). Normally, CA do not allow more than one valid certificate with the same DN without revoking the previous one. End-user certificates may be revoked if they are not renewed when due, among other reasons.<br />
<br />
====End-user generated key====<br />
End-users generate keys in order to sign certificate requests that are submitted to the CA. As with the CA private key, an exposed user-key could facilitate impersonating the user to the point where an attacker could submit a request under the user's name, resulting in the CA revoking the former, legitimate, user certificate.<br />
<br />
====Certificate requests====<br />
These contain the user's DN and public key. As their name implies, they fully represent the initial part of the process of acquiring certification from a CA.<br />
<br />
====End-user certificate====<br />
The main distinction between an end-user certificate and CA certificate is that end-user ones cannot sign certificates themselves; they merely provide means of identification in exchanges of information.<br />
<br />
====Certificate revocation list (CRL)====<br />
CRL are also signed with the CA key, but they only dictate information regarding end-user certificates. Usually, a 30 day span is given between new CRL submissions.<br />
<br />
==Configuring==<br />
The OpenSSL configuration file, conventionally placed in {{ic|/etc/ssl/openssl.cnf}}, may appear complicated at first. This isn't remedied by the fact that there's no ''include'' directive to split configuration into a modal setup. Nevertheless, this section covers the essential settings.<br />
<br />
Remember that variables may be expanded in assignments, much like how shell scripts work. For a more thorough explanation of the configuration file format, see ''config(5)''. This [[man]] page is named ''openssl-config'' or ''config.5ssl'' in other operative systems, or it even may not be available through the man hierarchy at all; e.g., it may be placed in OpenSSL's share root, {{ic|/usr/share/openssl}}.<br />
<br />
===Global variables===<br />
These settings are relevant in all sections. For that to happen, they can not be specified under a section header:<br />
<br />
<nowiki><br />
DIR= . # Useful macro for populating real vars.<br />
RANDFILE= ${DIR}/private/.rnd # Entropy source.<br />
default_md= sha1 # Default message digest.<br />
</nowiki><br />
<br />
===ca section===<br />
These settings are used when signing CRLs, and signing and revoking certificates. Users that only want to generate requests can safely skip to the [[#req section]].<br />
<br />
<nowiki><br />
[ ca ]<br />
default_ca= dft_ca # Configuration files may have more than one CA<br />
# section for different scenarios.<br />
<br />
[ dft_ca ]<br />
certificate= ${DIR}/cacert.pem # The CA certificate.<br />
database= ${DIR}/index.txt # Keeps tracks of valid/revoked certs.<br />
new_certs_dir= ${DIR}/newcerts # Copies of signed certificates, for<br />
# administrative purposes.<br />
private_key= ${DIR}/private/cakey.pem # The CA key.<br />
serial= ${DIR}/serial # Should be populated with the next<br />
# cert hex serial.<br />
<br />
# These govern the way certificates are displayed while confirming<br />
# the signing process.<br />
name_opt= ca_default<br />
cert_opt= ca_default<br />
<br />
default_days= 365 # How long to sign certificates for.<br />
default_crl_days=30 # The same, but for CRL.<br />
<br />
policy= dft_policy # The default policy should be lenient.<br />
x509_extensions=cert_v3 # For v3 certificates.<br />
<br />
[ dft_policy ]<br />
# A value of 'supplied' means the field must be present in the certificate,<br />
# whereas 'match' means the field must be populated with the same contents as<br />
# the CA certificate. 'optional' dictates that the field is entirely optional.<br />
<br />
C= supplied # Country<br />
ST= supplied # State or province<br />
L= optional # Locality<br />
O= supplied # Organization<br />
OU= optional # Organizational unit<br />
CN= supplied # Common name<br />
<br />
[ cert_v3 ]<br />
# With the exception of 'CA:FALSE', there are PKIX recommendations for end-user<br />
# certificates that should not be able to sign other certificates.<br />
# 'CA:FALSE' is explicitely set because some software will malfunction without.<br />
<br />
subjectKeyIdentifier= hash<br />
basicConstraints= CA:FALSE<br />
keyUsage= nonRepudiation, digitalSignature, keyEncipherment<br />
<br />
nsCertType= client, email<br />
nsComment= "OpenSSL Generated Certificate"<br />
<br />
authorityKeyIdentifier=keyid:always,issuer:always<br />
</nowiki><br />
<br />
===req section===<br />
Settings related to generating keys, requests and self-signed certificates.<br />
<br />
The req section is responsible for the DN prompts. A general misconception is the ''Common Name'' (CN) prompt, which suggests that it should have the user's proper name as a value. End-user certificates need to have the '''machine hostname''' as CN, whereas CA should ''not'' have a valid TLD, so that there's no chance that, between the possible combinations of certified end-users' CN and the CA certificate's, there's a match that could be misinterpreted by some software as meaning that the end-user certificate is self-signed. Some CA certificates do not even have a CN, such as [http://www.equifax.com Equifax]:<br />
# subject= /C=US/O=Equifax/OU=Equifax Secure Certificate Authority<br />
openssl x509 -subject -noout < /etc/ssl/certs/Equifax_Secure_CA.pem<br />
<br />
Even though splitting the files isn't strictly necessary to normal functioning, it is very confusing to handle request generation and CA administration from the same configuration file, so it is advised to follow the convention of clearly separating the settings into two {{ic|cnf}} files and into two containing directories.<br />
<br />
Here are the settings that are common to both tasks:<br />
<nowiki><br />
[ req ]<br />
# Default bit encryption and out file for generated keys.<br />
default_bits= 1024<br />
default_keyfile=private/cakey.pem<br />
<br />
string_mask= utf8only # Only allow utf8 strings in request/ca fields.<br />
prompt= no # Do not prompt for field value confirmation.<br />
</nowiki><br />
<br />
====CA req settings====<br />
The settings should produce a standard CA capable of only singing other certificates:<br />
<nowiki><br />
distinguished_name=ca_dn # Distinguished name contents.<br />
x509_extensions=ca_v3 # For generating ca certificates.<br />
<br />
[ ca_dn ]<br />
# CN isn't needed for CA certificates<br />
C= US<br />
ST= New Jersey<br />
O= localdomain<br />
<br />
[ ca_v3 ]<br />
subjectKeyIdentifier= hash<br />
<br />
# PKIX says this should also contain the 'crucial' value, yet some programs<br />
# have trouble handling it.<br />
basicConstraints= CA:TRUE<br />
<br />
keyUsage= cRLSign, keyCertSign<br />
<br />
nsCertType= sslCA<br />
nsComment= "OpenSSL Generated CA Certificate"<br />
<br />
authorityKeyIdentifier=keyid:always,issuer:always<br />
</nowiki><br />
<br />
====End-user req settings====<br />
Makes a v3 request suitable for most circumstances:<br />
<nowiki><br />
distinguished_name=ca_dn # Distinguished name contents.<br />
req_extensions=req_v3 # For generating ca certificates.<br />
<br />
[ ca_dn ]<br />
C= US<br />
ST= New Jersey<br />
O= localdomain<br />
CN= localhost<br />
<br />
[ v3_req ]<br />
basicConstraints= CA:FALSE<br />
keyUsage= nonRepudiation, digitalSignature, keyEncipherment<br />
</nowiki><br />
<br />
===GOST engine support===<br />
First, be sure that libgost.so exist on your system<br />
pacman -Ql openssl | grep libgost<br />
<br />
In case everything is fine, add the following lines to the config:<br />
openssl_conf = openssl_def # this must be a top-level declaration<br />
<br />
Put the following lines in the end of the document:<br />
[ openssl_def ]<br />
engines = engine_section<br />
<br />
[ engine_section ]<br />
gost = gost_section<br />
<br />
[ gost_section ]<br />
engine_id = gost<br />
soft_load = 1<br />
dynamic_path = /usr/lib/engines/libgost.so<br />
default_algorithms = ALL<br />
CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet<br />
The official [http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/crypto/external/bsd/openssl/dist/engines/ccgost/README.gost README.gost] should contain more examples on this.<br />
<br />
==Generating keys==<br />
Before generating the key, make a secure directory to host it:<br />
mkdir -m0700 private<br />
Followed by preemptively assigning secure permissions for the key itself:<br />
touch private/key.pem<br />
chmod 0600 private/key.pem<br />
<br />
An example {{ic|genpkey}} key generation:<br />
openssl genpkey -algorithm RSA -out private/key.pem<br />
<br />
If an encrypted key is desired, use the following command and remember to enter EOF, usually {{keypress|Ctrl}}+{{keypress|D}}, to indicate the end of the password string:<br />
openssl genpkey -pass stdin -algorithm RSA -out private/key.pem<br />
<br />
==Making requests==<br />
To obtain a certificate from a CA, whether it be a public one such as [http://www.cacert.org CAcert.org], or a locally managed solution, a request file must be delivered to the CA, and these are conventionally called {{ic|csr}} files.<br />
<br />
Make a new request and sign it with a previously [[#Generating keys|generated key]]:<br />
openssl req -new -key private/key.pem -out req.csr<br />
<br />
==Signing certificates==<br />
Covers the process of local CA signing: directly self-signed certificates or through a local CA.<br />
<br />
===Self-signed certificate===<br />
A significant amount of programs will not work with self-signed certificates, and maintaining more than one system with self-signed certificates is more trouble than investing the initial effort in setting up a [[#Certificate authority|certificate authority]].<br />
<br />
If a key was already generated as [[#Generating keys|explained before]], use this command to sign the new certificate with the aforementioned key:<br />
openssl req -key private/key.pem -x509 -new -days 3650 -out cacert.pem<br />
<br />
===Certificate authority===<br />
The method shown in this section is mostly meant to show how signing works; it is not suited for large deployments that need to automate signing a large number of certificates. Consider installing an SSL server for that purpose.<br />
<br />
Before using the Makefile, make a configuration file according to [[#Configuring]]. Be sure to follow instructions relevant to CA administration; not request generation.<br />
<br />
====Makefile====<br />
Saving the file as {{ic|Makefile}} and issuing {{Ic|make}} in the containing directory will generate the initial CRL along with its prerequisites:<br />
<nowiki><br />
OPENSSL= openssl<br />
CNF= openssl.cnf<br />
CA= ${OPENSSL} ca -config ${CNF}<br />
REQ= ${OPENSSL} req -config ${CNF}<br />
<br />
KEY= private/cakey.pem<br />
KEYMODE= RSA<br />
<br />
CACERT= cacert.pem<br />
CADAYS= 3650<br />
<br />
CRL= crl.pem<br />
INDEX= index.txt<br />
SERIAL= serial<br />
<br />
<br />
CADEPS= ${CNF} ${KEY} ${CACERT}<br />
<br />
all: ${CRL}<br />
<br />
${CRL}: ${CADEPS}<br />
${CA} -gencrl -out ${CRL}<br />
<br />
${CACERT}: ${CNF} ${KEY}<br />
${REQ} -key ${KEY} -x509 -new -days ${CADAYS} -out ${CACERT}<br />
rm -f ${INDEX}<br />
touch ${INDEX}<br />
echo 100001 > ${SERIAL}<br />
<br />
${KEY}: ${CNF}<br />
mkdir -m0700 -p $(dir ${KEY})<br />
touch ${KEY}<br />
chmod 0600 ${KEY}<br />
${OPENSSL} genpkey -algorithm ${KEYMODE} -out ${KEY}<br />
<br />
<br />
revoke: ${CADEPS} ${item}<br />
@test -n $${item:?'usage: ${MAKE} revoke item=cert.pem'}<br />
${CA} -revoke ${item}<br />
${MAKE} ${CRL}<br />
<br />
sign: ${CADEPS} ${item}<br />
@test -n $${item:?'usage: ${MAKE} sign item=request.csr'}<br />
mkdir -p newcerts<br />
${CA} -in ${item} -out ${item:.csr=.crt} <br />
<br />
</nowiki><br />
<br />
To sign certificates:<br />
make sign item='''req.csr'''<br />
<br />
To revoke certificates:<br />
make revoke item='''cert.pem'''<br />
<br />
==See also==<br />
* [http://en.wikipedia.org/wiki/OpenSSL Wikipedia page] on OpenSSL, with background information.<br />
* [http://www.openssl.org OpenSSL] project page.<br />
* [http://www.freebsd.org/doc/en/books/handbook/openssl.html FreeBSD Handbook]<br />
* [http://www.akadia.com/services/ssh_test_certificate.html Step-by-step guide to create a signed SSL certificate]</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Working_with_the_serial_console&diff=133494Working with the serial console2011-03-11T19:54:50Z<p>LinuxChristian: Added a nice hint</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
=Introduction=<br />
<br />
Configure your Arch Linux machine, so you can connect to it via the serial console port (com port).<br />
This will enable you to administer the machine, even if it has no keyboard, mouse, monitor or network attached to it (a headless server).<br />
<br />
As of Arch Linux 2007.x, installation of Arch Linux is possible via the serial console as well.<br />
<br />
A basic environment for this scenario is two machines, connected using a serial cable (9-pin connector cable).<br />
The administering machine can be any Linux or Windows machine with a terminal emulator program (putty or Minicom for example)<br />
<br />
The configuration instructions below will enable grub menu selection, boot messages and terminal forwarding to the serial console.<br />
<br />
=Configuration=<br />
<br />
===Configure console access on the target machine===<br />
<br />
1. Edit the grub.conf file:<br />
<br />
<pre><br />
# vi /boot/grub/menu.lst<br />
</pre><br />
<br />
Add these lines to the general area of the configuration:<br />
<br />
<pre><br />
serial --unit=0 --speed=9600<br />
terminal --timeout=5 serial console<br />
</pre><br />
<br />
Add the console parameters at the end of your current kernel line:<br />
<br />
<pre><br />
console=ttyS0,9600<br />
</pre><br />
<br />
For example, the kernel line should look something like this after modification:<br />
<br />
<pre><br />
kernel /vmlinuz26 root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=773 console=ttyS0,9600<br />
</pre><br />
<br />
2. Edit the inittab file: <br />
<br />
<pre><br />
# vi /etc/inittab<br />
</pre><br />
<br />
Add a new agetty line below the existing ones :<br />
<br />
<pre><br />
c0:2345:respawn:/sbin/agetty 9600 ttyS0 linux<br />
</pre><br />
<br />
3. Edit the securetty file:<br />
<pre><br />
# vi /etc/securetty<br />
</pre><br />
<br />
Below the existing tty's add an entry for the the serial console:<br />
<pre><br />
ttyS0<br />
</pre><br />
<br />
4. Reboot the machine<br />
<br />
Note that in all of the steps above ttyS1 can also be used, in case that your machine has more than one serial port.<br />
<br />
=Making Connections=<br />
<br />
===Connect using a terminal emulator program===<br />
<br />
Perform these steps on the machine used to connect the remote console.<br />
<br />
====Minicom====<br />
<br />
1. Install Minicom:<br />
<br />
<pre><br />
# pacman -S minicom<br />
</pre><br />
<br />
2. Start Minicom in setup mode:<br />
<br />
<pre><br />
# minicom -s<br />
</pre><br />
<br />
3. Using the textual navigation menu change the serial port settings to the following:<br />
<br />
<pre><br />
Serial Device: /dev/ttyS0<br />
Bps/Par/Bits: 9600 8N1<br />
</pre><br />
<br />
Press Enter to exit the menus (pressing Esc will not save changes)<br />
<br />
4. Remove the modem Init and Reset strings:<br />
<br />
Under the 'Modem and Dialing' menu delete the Init and Reset strings.<br />
<br />
5. Save the setup:<br />
<br />
From the main menu, choose 'save setup as dfl'<br />
<br />
6. Exit Minicom:<br />
<br />
From the main menu, choose 'Exit from Minicom'<br />
<br />
7. Connect to the target machine:<br />
<br />
While the serial cable is connected to the target machine, start the Minicom program:<br />
<br />
<pre><br />
# minicom<br />
</pre><br />
<br />
8. Exiting Minicom<br />
<br />
To finish the session press 'ctrl-A' and then 'X'.<br />
<br />
====Screen====<br />
<br />
Screen is able to connect to a serial port. It will connect to a standard 9200 speed port without options.<br />
<br />
<pre><br />
# screen /dev/ttyS0<br />
</pre><br />
<br />
If needed see the section "WINDOW TYPES" in the screen man page for details on setting the baud rate.<br />
<br />
====Windows Options====<br />
<br />
On Windows machines, connect to the serial port using programs like Putty or Hyper Terminal.<br />
<br />
=Installing Arch Linux using the serial console=<br />
<br />
1. Connect to the target machine using the method described above.<br />
<br />
2. Boot the target machine using the Arch Linux installation CD.<br />
<br />
After a while, output from the console will start showing on screen and setup can be started normally.<br />
<br />
Note that after setup is complete, the console settings will not be saved on the target machine, in order to avoid having to connect a keyboard and monitor, configure console access on the target machine before rebooting.<br />
<br />
Note that while a port speed of 9600 is used in all of the examples in this document, working with higher values is recommended (List of available speeds is displayed in Minicom by pressing 'Ctrl-A' and then 'P')<br />
<br />
=Troubleshooting=<br />
====Ctrl-C and Minicom====<br />
If you are having trouble sending a Control-C command through minicom you need to switch off hardware flow control in the device settings (minicom -s), which then enables the break.</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=XAMPP&diff=129428XAMPP2011-01-30T21:29:41Z<p>LinuxChristian: +styling and note about repositorie</p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n|Xampp}}<br />
<br />
[http://www.apachefriends.org/en/xampp.html XAMPP] is an easy to install Apache distribution containing MySQL, PHP and Perl. It contains: Apache, MySQL, PHP & PEAR, Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, mcrypt, mhash, eAccelerator, SQLite and IMAP C-Client.<br />
<br />
== Installation ==<br />
=== AUR ===<br />
* [http://aur.archlinux.org/packages.php?ID=14141 Xampp package] in the [[AUR]]<br />
<br />
=== Manual ===<br />
# Download the latest version from [http://www.apachefriends.org/en/xampp-linux.html#374 here].<br />
# In the terminal run the following from the folder where the archive was downloaded to: <pre>sudo tar xvfz xampp-linux-*.tar.gz -C /opt</pre><br />
<br />
{{Note|If you are running 64-bit arch, you must install <tt>lib32-glibc</tt> and <tt>lib32-gcc-libs</tt>.<br />
<pre>sudo pacman -S lib32-glibc lib32-gcc-libs</pre><br />
to do this you must have activated the multilib repositorie in /etc/pacman.conf}}<br />
<br />
== Configuration ==<br />
<br />
Setting the individual parts of XAMPP can by made by editing following files:<br />
<br />
'''/opt/lampp/etc/httpd.conf''' - Apache configuration. For example you can change folder with web page's source files.<br />
<br />
'''/opt/lampp/etc/php.ini''' - PHP configuration.<br />
<br />
'''/opt/lampp/phpmyadmin/config.inc.php''' - phpMyAdmin configuration.<br />
<br />
'''/opt/lampp/etc/proftpd.conf''' - proFTP configuration.<br />
<br />
'''/opt/lampp/etc/my.cnf''' - MySQL configuration.<br />
<br />
If you would like to set up security of server, you can do it simply by this command:<br />
<pre>sudo /opt/lampp/lampp security</pre><br />
You will be asked step by step to choose passwords for web page's access, user "pma" for phpMyAdmin, user "root" for MySQL and user "nobody" for proFTP.<br />
<br />
== Usage ==<br />
<br />
Use the following commands to control XAMPP: <pre>sudo /opt/lampp/lampp {start,stop,restart}</pre><br />
<br />
== Removal ==<br />
<br />
All the files needed by Xampp to be installed are located in the previous /opt/lampp folder. So, to uninstall Xampp, consider this command.<br />
<br />
<pre># rm -rf /opt/lampp</pre><br />
<br />
'''NOTE:'''If you had create symlinks, you need to destroy them too!<br />
<br />
== Hosting files outside the htdocs directory ==<br />
The document root (web root) directory is located at '''/opt/lampp/htdocs/'''. All files placed in this directory will be processed by the web server.<br />
<br />
To host other files on your system with XAMPP, you can configure an alias with apache.<br />
<br />
#Edit apache's httpd.conf with your favorite editor. <pre>nano /opt/lampp/etc/httpd.conf</pre><br />
#In the Alias section, add an alias:<br />
<pre>Alias /shortname /full_file_path<br />
<directory /full_file_path> <br />
AllowOverride FileInfo Limit Options Indexes<br />
Order allow,deny<br />
Allow from all<br />
</directory><br />
</pre><br />
<br />
Don't forget to restart apache: <pre>/opt/lampp/lampp restart</pre><br />
<br />
This will allow you to host files from your home directory (or any other directory) with XAMPP.<br />
<br />
In the above example, you can access the files by pointing your web browser to '''localhost/shortname'''.</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Dell_XPS_15&diff=127972Dell XPS 152011-01-13T15:51:56Z<p>LinuxChristian: More info</p>
<hr />
<div>This page is a work in progress! More info comming soon.<br />
<br />
<br />
{| cellpadding="2" style="border: 1px solid darkgray;"<br />
! width="160" style="border-bottom: 2px solid;" | Device<br />
! width="120" style="border-bottom: 2px solid" | Status<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Network<br />
! style="background: #228B22; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Wireless<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Sound<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Bluetooth<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Touchpad<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Graphics<br />
! style="background: #FF4F00; border-bottom: 1px solid" | Modify<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Screen<br />
! style="background: #FF4F00; border-bottom: 1px solid" | Modify<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | USB 3.0<br />
! style="background: #FFFFFF; border-bottom: 1px solid" | Not testet<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Webcam<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | System info<br />
! style="background: #FFFFFF; border-bottom: 1px solid" | Not testet<br />
|}<br />
<br />
* Works - Works out-of-the-box<br />
* Modify - Works with modifications<br />
* Not testet<br />
* Not working<br />
<br />
= System Settings =<br />
Hardware settings om January 2011 model<br />
<br />
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)<br />
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18)<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)<br />
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)<br />
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)<br />
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)<br />
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)<br />
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)<br />
00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06)<br />
00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)<br />
00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06)<br />
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)<br />
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)<br />
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06)<br />
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)<br />
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)<br />
02:00.0 VGA compatible controller: nVidia Corporation Device 0df1 (rev a1)<br />
02:00.1 Audio device: nVidia Corporation GF108 High Definition Audio Controller (rev a1)<br />
04:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000<br />
05:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)<br />
09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)<br />
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)<br />
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05)<br />
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05)<br />
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05)<br />
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05)<br />
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05)<br />
<br />
<br />
= System Setup =<br />
<br />
== Graphics ==<br />
Intel card works out of the box (just install i915 driver). Not yet working with Nvidia driver.<br />
<br />
== Screen ==<br />
<br />
== Bluetooth ==<br />
Some users may need to run <br />
hciconfig hci0 reset<br />
to get blueman working<br />
<br />
== Power management ==<br />
<br />
== Notes ==<br />
* Remember to turn on WIFI and Bluetooth by pressing the F2-button.<br />
* Touchpad can handle multitouch. Read [Synaptics] to get that working.</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Dell_XPS_15&diff=127963Dell XPS 152011-01-13T15:15:19Z<p>LinuxChristian: Page created - More to be added soon</p>
<hr />
<div>This page is a work in progress! More info comming soon.<br />
<br />
<br />
{| cellpadding="2" style="border: 1px solid darkgray;"<br />
! width="160" style="border-bottom: 2px solid;" | Device<br />
! width="120" style="border-bottom: 2px solid" | Status<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Network<br />
! style="background: #228B22; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Wireless<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Sound<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Bluetooth<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Touchpad<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Graphics<br />
! style="background: #FF4F00; border-bottom: 1px solid" | Modify<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | USB 3.0<br />
! style="background: #FFFFFF; border-bottom: 1px solid" | Not testet<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | Webcam<br />
! style="background: green; border-bottom: 1px solid" | Works<br />
|-<br />
! style="border-bottom: 1px solid; border-right: 1px solid" | System info<br />
! style="background: #FFFFFF; border-bottom: 1px solid" | Not testet<br />
|}<br />
<br />
* Works - Works out-of-the-box<br />
* Modify - Works with modifications<br />
* Not testet<br />
* Not working<br />
<br />
== Graphics ==<br />
Intel card works out of the box (just install i915 driver). Not yet working with Nvidia driver.<br />
<br />
== Notes ==<br />
* Remember to turn on WIFI and Bluetooth by pressing the F2-button.<br />
* Touchpad can handle multitouch. Read [Synaptics] to get that working.</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Dell_Mini_10v&diff=72929Dell Mini 10v2009-07-29T21:53:19Z<p>LinuxChristian: Hardware added</p>
<hr />
<div>== Summary ==<br />
The Dell Mini 10v is a netbook from Dell. The display and wired NIC workes out of the box but the rest needs some work.<br />
<br />
== Hardware ==<br />
Audio: Realtek ALC272 (snd_hda_intel)<br />
<br />
Video: Integrated Intel 945GSE UMA Graphics Media Accelerator <br />
<br />
Wired NIC: Realtek RTL8101E/RTL8102E<br />
<br />
Wireless NIC: Broadcom Corporation BCM4312 802.11b/g<br />
<br />
Bluetooth: <br />
<br />
Webcam: <br />
<br />
== Installing ==<br />
Because the netbook has no CD-ROM drive you need to boot from a USB. See the guide [Install_from_USB_stick].<br />
<br />
== Xorg ==<br />
Setting up Xorg is easy on the Mini 10v. Just follow the guide for [[Xorg | Xorg]] and hal will do the rest. Becareful not to start the display manager without adding hal to the /etc/inittab and installing the touchpad driver! <br />
<br />
=== Touchpad ===<br />
The Mini 10v needs the synaptics driver to get the touchpad working. Read the [[synaptics]] guide to get help.<br />
<br />
<br />
== Sound ==<br />
<br />
== Power ==<br />
<br />
== Extras ==<br />
=== Webcam ===<br />
<br />
=== Bluetooth ===</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Dell_Mini_10v&diff=72919Dell Mini 10v2009-07-29T17:46:34Z<p>LinuxChristian: save - a work in procress</p>
<hr />
<div>== Summary ==<br />
The Dell Mini 10v is a netbook from Dell.<br />
<br />
== Hardware ==<br />
Audio: <br />
<br />
Video: Integrated Intel 945GSE UMA Graphics Media Accelerator <br />
<br />
Wired NIC: <br />
<br />
Wireless NIC: <br />
<br />
Bluetooth: <br />
<br />
Webcam: <br />
<br />
== Installing ==<br />
Because the netbook has no CD-ROM drive you need to boot from a USB. See the guide [Install_from_USB_stick].<br />
<br />
== Xorg ==<br />
Setting up Xorg is easy on the Mini 10v. Just follow the guide for [[Xorg | Xorg]] and hal will do the rest. Becareful not to start the display manager without adding hal to the /etc/inittab and installing the touchpad driver! <br />
<br />
=== Touchpad ===<br />
The Mini 10v needs the synaptics driver to get the touchpad working. Read the [[synaptics]] guide to get help.<br />
<br />
<br />
== Power ==<br />
<br />
== Extras ==<br />
=== Webcam ===<br />
<br />
=== Bluetooth ===</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Xmonad&diff=72918Xmonad2009-07-29T17:08:34Z<p>LinuxChristian: Added hint to GDM</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Xmonad}}<br />
{{i18n_entry|Türkçe|Xmonad (Türkçe)}}<br />
{{i18n_links_end}}<br />
== Introduction ==<br />
<br />
[http://xmonad.org/ xmonad] is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Window manager features are accessible from the keyboard: a mouse is optional. <br />
<br />
xmonad is written, configured and extensible in [http://haskell.org/ Haskell]. Custom layout algorithms, key bindings and other extensions may be written by the user in config files. <br />
<br />
Layouts are applied dynamically, and different layouts may be used on each workspace. [[Xinerama]] is fully supported, allowing windows to be tiled on several physical screens.<br />
<br />
For more information, please visit the xmonad website: http://xmonad.org/<br />
<br />
== Installation ==<br />
<br />
xmonad is currently available in the community repo. A build for the current development snapshot (darcs) is in the [http://aur.archlinux.org/ aur]. The following instructions are for xmonad-darcs, the development snapshot.<br />
<br />
=== Development Version (xmonad-darcs) ===<br />
<br />
The xmonad-darcs development version can be installed from the AUR, with some additional dependencies in [community]. Install them in the following order:<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=12483 xmonad-darcs] - the core window manager<br />
* [http://aur.archlinux.org/packages.php?ID=13652 xmonad-contrib-darcs] - contributed extensions providing custom layouts, configurations, etc.<br />
<br />
== Configuration ==<br />
<br />
=== Starting xmonad ===<br />
To start xmonad automatically, simply add the command '''xmonad''' to your startup script (e.g. ~/.xinitrc). GDM and KDM users can create a new session file and then select xmonad from the appropriate Session menu.<br />
<br />
''Note:'' by default, xmonad does not set an X cursor, therefore the "cross" cursor is usually displayed which can be confusing for new users (thinking that xmonad has not launched correctly). To set the expected left-pointer, add the following to your startup file (e.g. ~/.xinitrc):<br />
<br />
xsetroot -cursor_name left_ptr<br />
<br />
=== Configuring xmonad ===<br />
<br />
Xmonad users can modify, override or extend the default settings with the ~/.xmonad/xmonad.hs configuration file. Recompiling is done on the fly, with the Mod+q shortcut.<br />
<br />
Because the xmonad configuration file is written in Haskell, non-programmers may have a difficult time adjusting settings. For detailed HOWTO's and example configs, we refer you to the following resources:<br />
<br />
* [http://haskell.org/haskellwiki/Xmonad xmonad wiki]<br />
* [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
* [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions xmonad FAQ]<br />
<br />
=== Exiting xmonad ===<br />
To end the current xmonad session, press Mod+SHIFT+q (Mod being ALT by default).<br />
<br />
== Tips & Tricks ==<br />
=== Complementary Applications ===<br />
There are number of complementary utilities that work well with Xmonad. The most common of these include:<br />
<br />
* [http://www.suckless.org/wiki/tools/xlib dmenu]<br />
* [[Xmobar]]<br />
* [[Dzen]] <br />
* [[Conky]] and [http://aur.archlinux.org/packages.php?ID=11884 conky-cli]<br />
<br />
=== Making room for conky or tray apps ===<br />
Wrap your layouts with avoidStruts from XMonad.Hooks.ManageDocks for automatic dock/panel/trayer spacing:<br />
layoutHook = avoidStruts (tiled Tall ||| ...<br />
manageHook = manageHook defaultConfig <+> manageDocks<br />
<br />
If you ever want to toggle the gaps the action is<br />
,((modMask x, xK_b ), sendMessage ToggleStruts)<br />
<br />
=== Using [[xmobar]] with xmonad ===<br />
[[Xmobar]] is a light and minimalistic text based bar, designed to work with xmonad.<br><br />
To use xmobar with xmonad, you will need two packages in addition to the xmonad package, these are xmonad-contrib from [community] and xmobar or [http://aur.archlinux.org/packages.php?ID=13627 xmobar-darcs from aur].<br />
<br />
Here we will start xmobar from within xmonad, which reloads xmobar whenever you reload xmonad.<br />
<br />
Open up <tt>~/.xmonad/xmonad.hs</tt> in your favorite editor, and choose one of the two following options:<br />
<br />
===== Option 1. Quick, less flexible, different in darcs =====<br />
Note: there is also a <tt>dzen</tt> which you can substitute for <tt>xmobar</tt> in either case.<br />
<br />
Common imports:<br />
<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
The xmobar action starts xmobar and returns a modified config that includes all the options described in the [[Xmonad#Option 2. More Configurable]] choice.<br />
<br />
-- main for darcs (>0.8.1)<br />
main = xmonad =<< xmobar myConfig<br />
myConfig = defaultConfig { modMask = mod4Mask, -- or any other configurations here ... }<br />
<br />
-- main for (<=0.8.1)<br />
main = xmobar (xmonad . modifyConfig)<br />
modifyConfig x = x { modMask = mod4Mask, ...}<br />
<br />
===== Option 2. More Configurable =====<br />
Threading the Handle manually also <b>requires you to:</b> [[Xmonad#Making room for conky or tray apps]]. With this method you have access to xmobarPP, so you could change the formatting (ex. change colors or field separators).<br />
<br />
First, we need to import three modules, IO, the DynamicLog and the Run utility. The logger is used to format and print various information about xmonad, like the workspaces, the title of the current window, the current layout and more. The two others are neede to run xmobar with a pipe, and to print the output of the logger to it.<br />
import IO<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
import XMonad.Util.Run<br />
<br />
Now, on to the main function. There are several loggers you can use and you can also create your own. In this example, we will use xmobarPP, for details read the documentation on [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html XMonad.Hooks.DynamicLog].<br><br />
The important thing here, is that we have to overide the ppOutput, else it will just print to stdout.<br />
main = do<br />
xmobar <- spawnPipe "xmobar" -- spawns xmobar and returns a handle<br />
xmonad $ defaultConfig <br />
{ ...<br />
, logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmobar } -- print the output of xmobarPP to the handle<br />
, ...<br />
}<br />
<br />
====== Verify XMobar Config ======<br />
<br />
The template and default xmobarrcs contains this.<br />
<br />
At last, open up <tt>~/.xmobarrc</tt> and make sure you got StdinReader in the template and run the plugin. E.g.<br />
Config { ...<br />
, commands = [ Run StdinReader .... ] <br />
...<br />
, template = " %StdinReader% ... "<br />
}<br />
Now, all you should have to do is either to start, or restart xmonad.<br />
<br />
=== Example Configurations ===<br />
Below are some example configurations from fellow Xmonad users. Feel free to add links to your own.<br />
* MrElendig :: Simple configuration, with xmobar :: [http://arch.har-ikkje.net/configs/home/dot.xmonad/xmonad.hs xmonad.hs], [http://arch.har-ikkje.net/configs/home/dot.xmobarrc .xmobarrc], [http://arch.har-ikkje.net/gfx/ss/2008-11-15-161451_1680x1050_scrot.png screenshot].<br />
* hsa2 :: Simple configuration, with xmobar :: [http://www.difuzyon.net/linked/configs/xmonad.hs xmonad.hs], [http://www.difuzyon.net/linked/configs/dot.xmobarrc .xmobarrc].<br />
* jelly :: Configuration with prompt, different layouts, twinview with xmobar :: [http://github.com/jelly/dotfiles/tree/master/.xmonad/xmonad.hs xmonad.hs], [http://github.com/jelly/dotfiles/tree/master/.xmobarrc .xmonbarrc]<br />
* vogt :: Check adamvo's config, and others in the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
<br />
== Troubleshooting ==<br />
=== GDM can't find Xmonad ===<br />
You can force GDM to launch xmonad by creating the file xmonad.desktop in the /usr/share/xsession directory and add the contents:<br />
<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=xmonad<br />
Comment=This session starts xmonad<br />
Exec=/home/sc/.cabal/bin/xmonad<br />
Type=Application<br />
<br />
Now xmonad will show in your GDM session menu. Thanks to [http://santanuchatterjee.blogspot.com/2009/03/making-xmonad-to-show-up-in-gdm-session.html Santanu Chatterjee] for the hint.<br />
<br />
=== xmonad-i386-linux missing ===<br />
Xmonad should automatically create the xmonad-i386-linux file (in $HOME/.xmonad/). If this it not the case you can grab a cool looking config file from the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad wiki] or create your [http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen's_Configuration own]. Put the .hs and all others files in .xmonad/ and run the command from the folder:<br />
<br />
xmonad --recompile<br />
<br />
Now you should see the file.<br />
<br />
== Other Resources ==<br />
[http://xmonad.org/ xmonad] -- The official xmonad website<br />
<br />
[http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_%280.8%29 xmonad.hs] -- Original xmonad.hs<br />
<br />
[http://xmonad.org/tour.html xmonad: a guided tour]<br />
<br />
[[dzen]] -- A general purpose messaging and notification program<br />
<br />
[[dmenu]] -- A dynamic X menu for the quick launching of programs<br />
<br />
[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]</div>LinuxChristianhttps://wiki.archlinux.org/index.php?title=Xmonad&diff=72482Xmonad2009-07-21T08:18:05Z<p>LinuxChristian: + troublesoothin section</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Xmonad}}<br />
{{i18n_entry|Türkçe|Xmonad (Türkçe)}}<br />
{{i18n_links_end}}<br />
== Introduction ==<br />
<br />
[http://xmonad.org/ xmonad] is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Window manager features are accessible from the keyboard: a mouse is optional. <br />
<br />
xmonad is written, configured and extensible in [http://haskell.org/ Haskell]. Custom layout algorithms, key bindings and other extensions may be written by the user in config files. <br />
<br />
Layouts are applied dynamically, and different layouts may be used on each workspace. [[Xinerama]] is fully supported, allowing windows to be tiled on several physical screens.<br />
<br />
For more information, please visit the xmonad website: http://xmonad.org/<br />
<br />
== Installation ==<br />
<br />
xmonad is currently available in the community repo. A build for the current development snapshot (darcs) is in the [http://aur.archlinux.org/ aur]. The following instructions are for xmonad-darcs, the development snapshot.<br />
<br />
=== Development Version (xmonad-darcs) ===<br />
<br />
The xmonad-darcs development version can be installed from the AUR, with some additional dependencies in [community]. Install them in the following order:<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=12483 xmonad-darcs] - the core window manager<br />
* [http://aur.archlinux.org/packages.php?ID=13652 xmonad-contrib-darcs] - contributed extensions providing custom layouts, configurations, etc.<br />
<br />
== Configuration ==<br />
<br />
=== Starting xmonad ===<br />
To start xmonad automatically, simply add the command '''xmonad''' to your startup script (e.g. ~/.xinitrc). GDM and KDM users can create a new session file and then select xmonad from the appropriate Session menu.<br />
<br />
''Note:'' by default, xmonad does not set an X cursor, therefore the "cross" cursor is usually displayed which can be confusing for new users (thinking that xmonad has not launched correctly). To set the expected left-pointer, add the following to your startup file (e.g. ~/.xinitrc):<br />
<br />
xsetroot -cursor_name left_ptr<br />
<br />
=== Configuring xmonad ===<br />
<br />
Xmonad users can modify, override or extend the default settings with the ~/.xmonad/xmonad.hs configuration file. Recompiling is done on the fly, with the Mod+q shortcut.<br />
<br />
Because the xmonad configuration file is written in Haskell, non-programmers may have a difficult time adjusting settings. For detailed HOWTO's and example configs, we refer you to the following resources:<br />
<br />
* [http://haskell.org/haskellwiki/Xmonad xmonad wiki]<br />
* [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
* [http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions xmonad FAQ]<br />
<br />
=== Exiting xmonad ===<br />
To end the current xmonad session, press Mod+SHIFT+q (Mod being ALT by default).<br />
<br />
== Tips & Tricks ==<br />
=== Complementary Applications ===<br />
There are number of complementary utilities that work well with Xmonad. The most common of these include:<br />
<br />
* [http://www.suckless.org/wiki/tools/xlib dmenu]<br />
* [[Xmobar]]<br />
* [[Dzen]] <br />
* [[Conky]] and [http://aur.archlinux.org/packages.php?ID=11884 conky-cli]<br />
<br />
=== Making room for conky or tray apps ===<br />
Wrap your layouts with avoidStruts from XMonad.Hooks.ManageDocks for automatic dock/panel/trayer spacing:<br />
layoutHook = avoidStruts (tiled Tall ||| ...<br />
manageHook = manageHook defaultConfig <+> manageDocks<br />
<br />
If you ever want to toggle the gaps the action is<br />
,((modMask x, xK_b ), sendMessage ToggleStruts)<br />
<br />
=== Using [[xmobar]] with xmonad ===<br />
[[Xmobar]] is a light and minimalistic text based bar, designed to work with xmonad.<br><br />
To use xmobar with xmonad, you will need two packages in addition to the xmonad package, these are xmonad-contrib from [community] and xmobar or [http://aur.archlinux.org/packages.php?ID=13627 xmobar-darcs from aur].<br />
<br />
Here we will start xmobar from within xmonad, which reloads xmobar whenever you reload xmonad.<br />
<br />
Open up <tt>~/.xmonad/xmonad.hs</tt> in your favorite editor, and choose one of the two following options:<br />
<br />
===== Option 1. Quick, less flexible, different in darcs =====<br />
Note: there is also a <tt>dzen</tt> which you can substitute for <tt>xmobar</tt> in either case.<br />
<br />
Common imports:<br />
<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
<br />
The xmobar action starts xmobar and returns a modified config that includes all the options described in the [[Xmonad#Option 2. More Configurable]] choice.<br />
<br />
-- main for darcs (>0.8.1)<br />
main = xmonad =<< xmobar myConfig<br />
myConfig = defaultConfig { modMask = mod4Mask, -- or any other configurations here ... }<br />
<br />
-- main for (<=0.8.1)<br />
main = xmobar (xmonad . modifyConfig)<br />
modifyConfig x = x { modMask = mod4Mask, ...}<br />
<br />
===== Option 2. More Configurable =====<br />
Threading the Handle manually also <b>requires you to:</b> [[Xmonad#Making room for conky or tray apps]]. With this method you have access to xmobarPP, so you could change the formatting (ex. change colors or field separators).<br />
<br />
First, we need to import three modules, IO, the DynamicLog and the Run utility. The logger is used to format and print various information about xmonad, like the workspaces, the title of the current window, the current layout and more. The two others are neede to run xmobar with a pipe, and to print the output of the logger to it.<br />
import IO<br />
import XMonad<br />
import XMonad.Hooks.DynamicLog<br />
import XMonad.Util.Run<br />
<br />
Now, on to the main function. There are several loggers you can use and you can also create your own. In this example, we will use xmobarPP, for details read the documentation on [http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html XMonad.Hooks.DynamicLog].<br><br />
The important thing here, is that we have to overide the ppOutput, else it will just print to stdout.<br />
main = do<br />
xmobar <- spawnPipe "xmobar" -- spawns xmobar and returns a handle<br />
xmonad $ defaultConfig <br />
{ ...<br />
, logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmobar } -- print the output of xmobarPP to the handle<br />
, ...<br />
}<br />
<br />
====== Verify XMobar Config ======<br />
<br />
The template and default xmobarrcs contains this.<br />
<br />
At last, open up <tt>~/.xmobarrc</tt> and make sure you got StdinReader in the template and run the plugin. E.g.<br />
Config { ...<br />
, commands = [ Run StdinReader .... ] <br />
...<br />
, template = " %StdinReader% ... "<br />
}<br />
Now, all you should have to do is either to start, or restart xmonad.<br />
<br />
=== Example Configurations ===<br />
Below are some example configurations from fellow Xmonad users. Feel free to add links to your own.<br />
* MrElendig :: Simple configuration, with xmobar :: [http://arch.har-ikkje.net/configs/home/dot.xmonad/xmonad.hs xmonad.hs], [http://arch.har-ikkje.net/configs/home/dot.xmobarrc .xmobarrc], [http://arch.har-ikkje.net/gfx/ss/2008-11-15-161451_1680x1050_scrot.png screenshot].<br />
* hsa2 :: Simple configuration, with xmobar :: [http://www.difuzyon.net/linked/configs/xmonad.hs xmonad.hs], [http://www.difuzyon.net/linked/configs/dot.xmobarrc .xmobarrc].<br />
* jelly :: Configuration with prompt, different layouts, twinview with xmobar :: [http://github.com/jelly/dotfiles/tree/master/.xmonad/xmonad.hs xmonad.hs], [http://github.com/jelly/dotfiles/tree/master/.xmobarrc .xmonbarrc]<br />
* vogt :: Check adamvo's config, and others in the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad config archive]<br />
<br />
== Troubleshooting ==<br />
=== xmonad-i386-linux missing ===<br />
Xmonad should automatically create the xmonad-i386-linux file (in $HOME/.xmonad/). If this it not the case you can grab a cool looking config file from the [http://haskell.org/haskellwiki/Xmonad/Config_archive xmonad wiki] or create your [http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen's_Configuration own]. Put the .hs and all others files in .xmonad/ and run the command from the folder:<br />
<br />
xmonad --recompile<br />
<br />
Now you should see the file.<br />
<br />
== Other Resources ==<br />
[http://xmonad.org/ xmonad] -- The official xmonad website<br />
<br />
[http://xmonad.org/tour.html xmonad: a guided tour]<br />
<br />
[[dzen]] -- A general purpose messaging and notification program<br />
<br />
[[dmenu]] -- A dynamic X menu for the quick launching of programs<br />
<br />
[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]</div>LinuxChristian