https://wiki.archlinux.org/api.php?action=feedcontributions&user=Oboenerd&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:05:34ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=276059MacBookPro9,x2013-09-19T15:51:58Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBook Pro 7,1}}<br />
{{Article summary wiki|MacBook Pro 8,1 / 8,2 / 8,3 (2011)}}<br />
{{Article summary wiki|MacBook Pro 9,2 (Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<br />
{{note|Apple prefers having 128MB of unallocated space between partitions. Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.}}<br />
<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
/dev/sda7 ? ? ? shared (optional)<br />
<br />
For sharing files between OSX and Linux, a number of filesystem options exist. FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB. Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux. Full read-write support is available for unjournaled HFS+ filesystems. ExFAT support can be made available by installing {{Pkg|fuse-exfat}} and {{Pkg|exfat-utils}}.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only the uid and gid need to match. (usernames can differ)<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
Install {{Pkg|dkms}} from the offical repositories, then Install {{AUR|broadcom-wl-dkms}} from [[AUR]] and reboot. <br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|1=synclient TapAndDragGesture=0}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=262785VirtualBox2013-06-15T00:24:10Z<p>Oboenerd: fixing misleading language re: .xinitrc</p>
<hr />
<div>[[Category:Emulators]]<br />
[[Category:Virtualization]]<br />
[[cs:VirtualBox]]<br />
[[de:VirtualBox]]<br />
[[es:VirtualBox]]<br />
[[fr:VirtualBox]]<br />
[[hu:VirtualBox]]<br />
[[it:VirtualBox]]<br />
[[ja:VirtualBox]]<br />
[[pt:VirtualBox]]<br />
[[ru:VirtualBox]]<br />
[[zh-CN:VirtualBox]]<br />
{{Article summary start}}<br />
{{Article summary text|This article is about basic usage of VirtualBox, including running the VirtualBox software within an Arch ''host'', and running an Arch ''guest'' inside a VirtualBox virtual machine.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|VirtualBox|https://www.virtualbox.org}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|VirtualBox Extras}}<br />
{{Article summary wiki|PhpVirtualBox}}<br />
{{Article summary wiki|VirtualBox Arch Linux Guest On Physical Drive}}<br />
{{Article summary wiki|Installing Arch Linux from VirtualBox}}<br />
{{Article summary wiki|Moving an existing install into (or out of) a virtual machine}}<br />
{{Article summary end}}<br />
<br />
'''VirtualBox''' is a virtual PC emulator like [[VMware]]. It is in constant development and new features are implemented all the time. e.g. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a [[Qt]] GUI interface, as well as headless and [[Wikipedia:SDL|SDL]] command line tools for managing and running virtual machines. It includes ''guest additions'' for some guest operating systems, which integrate functions of the guest and host systems, including sharing files, the clipboard, video acceleration and a “seamless” window integration mode.<br />
<br />
{{Wikipedia|VirtualBox}}<br />
<br />
== Installation on host ==<br />
<br />
The basic GPL-licensed VirtualBox suite can be [[pacman|installed]] with the {{Pkg|virtualbox}} package, found in the [[official repositories]].<br />
<br />
The {{pkg|virtualbox-host-modules}} package, which contains the precompiled modules for the stock archlinux kernel, should be installed with it. If you are using the {{pkg|linux-lts}} kernel you should also install the {{pkg|virtualbox-host-modules-lts}} package. For custom kernels, read [[#Hosts running a custom kernel|the section below]].<br />
<br />
In order to use the graphical interface, based on [[Qt]] ({{ic|VirtualBox}} command), you will also need to install the {{Pkg|qt4}} package. This is not required for the simpler SDL-only GUI ({{ic|VBoxSDL}} command) nor for the {{ic|VBoxHeadless}} command.<br />
<br />
=== Hosts running a custom kernel ===<br />
<br />
VirtualBox works just fine with custom kernels such as [[Linux-ck]] ''without'' the need to keep any of the official ARCH kernel packages on the system. The trick to keeping pacman from bringing down the ARCH kernel packages is to install virtualbox with the {{Pkg|virtualbox-host-dkms}} package, which contains the source for the virtualbox kernel modules. See {{Bug|26721}} for further explanations.<br />
<br />
Once {{Pkg|virtualbox-host-dkms}} is installed, simply generate the kernel modules for your custom kernel by running:<br />
# dkms install vboxhost/<virtualbox-host-source version> -k <your custom kernel's version>/<your architecture><br />
<br />
Which for the lazy is the command:<br />
# dkms install vboxhost/$(pacman -Q virtualbox|awk {'print $2'}|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')<br />
<br />
{{Note|You're probably missing {{Pkg|linux-headers}} if you are getting an error like {{ic|Your kernel headers for kernel <your custom kernel's version> cannot be found at/usr/lib/modules/<your custom kernel's version>/build or /usr/lib/modules/<your custom kernel's version>/source}}}}<br />
<br />
and load it:<br />
# modprobe vboxdrv<br />
<br />
To load/compile virtualbox modules automatically at startup you can enable {{ic|dkms.service}}:<br />
# systemctl enable dkms.service<br />
<br />
==== Automatic re-compilation of the virtualbox host modules with every update of any kernel====<br />
<br />
This is possible thanks to {{AUR|vboxhost-hook}} from the [[AUR]]. In '''vboxhost-hook''', the 'automatic re-compilation' functionality is done by a '''vboxhost hook''' on [[mkinitcpio]] after forcing to update the {{Pkg|linux-headers}} package. You will need to add 'vboxhost' to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}, as well as 'linux-headers' and your custom kernel(s) headers to the SyncFirst array in {{ic|/etc/pacman.conf}} for this to work.<br />
<br />
{{Warning|The SyncFirst option is no longer available as of pacman 4.1. Use<br />
<br />
$ pacman -Sy linux-headers && pacman -Su<br />
<br />
instead to manually cause linux-headers to be updated first. See [https://mailman.archlinux.org/pipermail/arch-general/2013-April/033297.html This explanation].}}<br />
<br />
The hook will call the '''dkms''' command to update the virtualbox host modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. vboxhost hook will tell you if anything goes wrong.}}<br />
<br />
== Setup ==<br />
<br />
Add the desired username to the '''vboxusers''' [[group]]. Everything may work fine without this step but shared folders and possibly some other optional stuff require it to work. The new group does not automatically apply to existing sessions; the user has to log in again or start a new environment with a command like {{Ic|newgrp}} or {{Ic|sudo -u ''username'' -s}}.<br />
<br />
# gpasswd -a ''username'' vboxusers<br />
<br />
=== Loading Kernel Modules ===<br />
VirtualBox running on Linux uses its own [[kernel modules]], including a mandatory module named '''vboxdrv''', which must be loaded before virtual machines can run. It can be automatically loaded when Arch Linux starts up, or it can be loaded manually when necessary.<br />
<br />
To load the module manually:<br />
<br />
# modprobe vboxdrv<br />
<br />
To load the VirtualBox driver at startup, create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/[[Kernel_modules#Loading|modules-load.d]]}} that contains all modules that should be loaded:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxdrv}}<br />
<br />
{{Note|You may need to update the kernel modules db in order to avoid 'no such file or directory' error when loading vboxdrv. Run: {{ic|depmod -a}}.}}<br />
<br />
To start the VirtualBox graphical manager:<br />
<br />
$ VirtualBox<br />
<br />
To ensure full functionality of bridged networking, ensure that the {{ic|vboxnetadp}}, {{ic|vboxnetflt}} and {{ic|vboxpci}} [[Kernel modules|kernel modules]] are loaded as well as the {{pkg|net-tools}} package.<br />
<br />
=== Guest additions disc ===<br />
<br />
The {{Pkg|virtualbox}} package also suggests installing {{Pkg|virtualbox-guest-iso}} on the host (Arch Linux) running VirtualBox. It is a disc image that can be used to install the guest additions onto guest systems. Make it available to the (running) guest by going to Devices and clicking "Install Guest Additions... Host+D". Then run the guest additions installation from inside the guest.<br />
<br />
=== Booting a live disc ===<br />
<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512&nbsp;MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
=== Starting virtual machines with a service ===<br />
<br />
See [[Systemd/Services#VirtualBox virtual machines]] for details on how to setup a systemd service for each virtual machine.<br />
<br />
=== Advanced setup ===<br />
<br />
See [[VirtualBox Extras]] for advanced configuration.<br />
<br />
== Arch Linux guests ==<br />
<br />
Installing Arch under VirtualBox is straightforward, and additions should be installed through pacman (not through "Install Guest Additions" in VirtualBox, or from a mounted ISO image).<br />
<br />
=== Install the Guest Additions ===<br />
<br />
Install the {{Pkg|virtualbox-guest-utils}} package. Manually load the modules with:<br />
<br />
# modprobe -a vboxguest vboxsf vboxvideo<br />
<br />
Create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with these lines:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxguest<br />
vboxsf<br />
vboxvideo}}<br />
<br />
Add the following line to the top of {{ic|~/.xinitrc}} above any {{ic|exec}} options. (create a new file if it does not exist):<br />
<br />
{{hc|~/.xinitrc|<br />
/usr/bin/VBoxClient-all}}<br />
<br />
{{Note|If you are creating a new {{ic|~/.xinitrc}} file you ''must'' also include a [[window manager]] or [[desktop environment]].}}<br />
<br />
=== Automatic re-compilation of the VirtualBox guest modules with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|vboxguest-hook}} from the [[AUR]]. In '''vboxguest-hook''', the 'automatic re-compilation' functionality is done by a '''vboxguest hook''' on [[mkinitcpio]] after forcing to update the {{pkg|linux-headers}} package. You will need to add {{ic|vboxguest}} to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}. You may need to manually recreate the initramfs after an upgrade of the {{pkg|linux-headers}} package.<br />
<br />
The hook will call the {{ic|dkms}} command to update the VirtualBox guest modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality, it is '''important''' to look at the installation process of the {{pkg|linux}} (or any other kernel) package. vboxguest hook will tell you if anything goes wrong.}}<br />
<br />
=== Start the sharing services ===<br />
After installing {{Pkg|virtualbox-guest-utils}} above, you should start {{ic|VBoxClient-all}} to start services for sharing the clipboard, resizing the screen, etc.<br />
* If you are running something that launches {{Ic|/etc/xdg/autostart/vboxclient.desktop}}, such as GNOME or KDE, then nothing needs to be done. <br />
* If you use {{Ic|.xinitrc}} to launch things instead, you must add the following to your {{Ic|.xinitrc}} before launching your WM.<br />
<br />
# VBoxClient-all &<br />
<br />
=== Using USB webcam / microphone ===<br />
<br />
{{Note|You will need to have VirtualBox extension pack installed before following the steps below. See [[VirtualBox_Extras#Extension_pack]] for details.}}<br />
<br />
# Make sure the virtual machine is not running and your webcam / microphone is not being used.<br />
# Bring up the main VirtualBox window and go to settings for Arch machine. Go to USB section.<br />
# Make sure "Enable USB Controller" is selected. Also make sure that "Enable USB 2.0 (EHCI) Controller" is selected too.<br />
# Click the "Add filter from device" button (the cable with the '+' icon).<br />
# Select your USB webcam/microphone device from the list.<br />
# Now click OK and start your VM.<br />
<br />
=== Using Arch under Virtualbox EFI mode ===<br />
<br />
My experience with this configuration was pretty terrible, but it does work.<br />
<br />
''UPD. Using efibootmgr has the same effect as using VirtualBox boot menu (see the note below): settings [https://www.virtualbox.org/ticket/11177 disappear] after VM shutdown.'' First, {{ic|efibootmgr}} does *not* work. It will appear to work, but all changes it makes appear to be overwritten on reboot. After performing a standard UEFI/GPT installation, reboot and you should get dumped to the EFI shell. Type exit and you will get a menu. Select the Boot Management Manager, Boot Options, Add Boot Option. Use the file browser to find the grub efi file and select it. Add a label if you want. Afterwards, select Change Boot Order from the menu, use arrow keys to select your Arch option, and {{keypress|+}} to move it up to the top. GRUB should boot by default now.<br />
<br />
Other options are: 1) move your loader to {{ic|\EFI\boot\bootx64.efi}}, 2) create {{ic|\startup.nsh}} script, which executes desirable loader, like this:<br />
<br />
{{hc|\startup.nsh|<br />
HD16a0a1:\EFI\refind\refindx64.efi}}<br />
<br />
Here I'm using consistent mapping name (HD16a0a1). It is probably a good idea, because they do survive configuration changes.<br />
<br />
{{Note|Another useful way to get back to the EFI menu after autobooting is working is to press the {{Keypress|C}} key inside GRUB and type {{ic|exit}}. Obviously, this will only work with {{ic|grub-efi}}, not {{ic|grub-bios}}.<br><br />
Regenerating the {{ic|grub.cfg}} file may also be required to fix broken UUIDs. Check with the {{ic|lsblk -f}} command that they match.<br><br />
Yet another useful way to get to VirtualBox boot menu is pressing {{keypress|F12}} right after starting virtual machine. It comes in handy when using rEFInd + EFISTUB, for example.}}<br />
<br />
== Shared Folders as Arch Linux Guest ==<br />
<br />
Shared folders are managed via the VirtualBox program on the host. They may be added, auto-mounted and made read-only from there. Creating a shared folder from the VirtualBox program in the host locates that folder in {{Ic|/media/sf_''SHAREDFOLDERNAME''}}. At this time an additional step is needed to have that folder created in the Arch Guest because Arch use a package for Guest Additions. To create and access this shared folder from the Arch Guest, this must also be done at the command line after installing the Guest Additions package(s) from pacman:<br />
<br />
# groupadd vboxsf<br />
# gpasswd -a $USER vboxsf<br />
<br />
{{Note|For automounting to work, you have to enable the vboxservice service. See next section for instructions.}}<br />
<br />
If you wish, a symbolic link may be made to another folder in your home directory for easy access. As an example, if a shared folder named "Dropbox" was created in the VirtualBox program on the host machine, then /media/sf_Dropbox is automatically created in the guest so this could be done:<br />
<br />
$ ln -s /media/sf_Dropbox/* ~/dropbox<br />
<br />
The .run script provided in the Guest Additions iso does this for you, however, Arch does not recommend using that script so this step must be done manually. The instructions for it were found here: (pastebin: [http://pastebin.com/6cUE3kjF]) .<br />
<br />
If shared folders are not auto-mounted, try [https://bbs.archlinux.org/viewtopic.php?id=70780 manually mount] or read the next section.<br />
<br />
To prevent startup problems when you're using [[systemd]], you should add {{ic|1=comment=systemd.automount}} to your {{ic|/etc/fstab}}. This way, they are mounted only when you access those mountpoints and not during startup. Otherwise your system might become unusable after a kernel upgrade (if you install your guest additions manually).<br />
<br />
desktop /media/desktop vboxsf uid=user,gid=group,rw,dmode=700,fmode=600,comment=systemd.automount 0 0<br />
<br />
Don't waste your time to test the {{ic|nofail}} option. {{ic|mount.vboxsf}} is not able to handle this (2012-08-20).<br />
<br />
desktop /media/desktop vboxsf uid=user,gid=group,rw,dmode=700,fmode=600,nofail 0 0<br />
<br />
=== Synchronise guest date with host ===<br />
<br />
To keep sync date and time, make sure you have {{Pkg|virtualbox-guest-utils}} installed in your host (see [[#Install the Guest Additions|previous section]]). Then run<br />
# systemctl enable vboxservice.service<br />
<br />
To enable the service for next boot. To start immediately, run<br />
# systemctl start vboxservice.service<br />
<br />
You also need run this daemon in order to use auto-mounting feature of shared folders that are mentioned above.<br />
<br />
== Troubleshooting ==<br />
=== VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) ===<br />
This can occur if a VM is exited ungracefully. The solution to unlock the VM is trivial:<br />
VBoxManage controlvm nArch poweroff<br />
<br />
=== USB subsystem is not working on the host or guest ===<br />
<br />
Sometimes the USB subsystem is not auto-detected resulting in an error or in a not visible USB drive on the host, even when the user is in the '''vboxusers''' group. See this topic [https://bbs.archlinux.org/viewtopic.php?id=125785] for details.<br />
<br />
USB subsystem will work if you add<br />
<br />
VBOX_USB=usbfs<br />
<br />
to {{Ic|~/.bashrc}} and reboot your system or open a new bash instance.<br />
<br />
Also make sure that your user is a member of the '''storage''' group.<br />
<br />
=== Failed to create the host-only network interface ===<br />
<br />
To be able to create a Host-Only Network Adapter or a Bridged Network Adapter the kernel modules {{ic|vboxnetadp}} and {{ic|vboxnetflt}} need to be loaded, you also need to make sure the {{pkg|net-tools}} package is installed. It's possible to load these kernel modules manually with<br />
<br />
# modprobe -a vboxnetadp vboxnetflt<br />
<br />
To load them automatically at boot, add a new line for each module to {{ic|/etc/modules-load.d/virtualbox.conf}}:<br />
<br />
vboxdrv<br />
vboxnetadp<br />
vboxnetflt<br />
<br />
{{Note|These used to be added to the {{ic|MODULES}} array in {{ic|/etc/rc.conf}}. This is now deprecated.}}<br />
<br />
More information in [https://bbs.archlinux.org/viewtopic.php?id=130581 this] topic.<br />
<br />
=== WinXP: Bit-depth cannot be greater than 16 ===<br />
<br />
If you are running at 16-bit color depth, then the icons may appear fuzzy/choppy. However, upon attempting to change the color depth to a higher level, the system may restrict you to a lower resolution or simply not enable you to change the depth at all. To fix this, run {{ic|regedit}} add the following key to the Virtual Windows XP registry:<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]<br />
"ColorDepth"=dword:00000004<br />
<br />
Then update the color depth in the desktop properties window. If nothing happens, force the screen to redraw through some method (i.e. {{Keypress|Host+F}} to redraw/enter full screen).<br />
<br />
=== Mounting .vdi Images ===<br />
<br />
This just work with '''static''' size vdi images! '''Dynamic size won't''' be easy mountable! First we need one information from your .vdi image:<br />
<br />
$ VBoxManage internalcommands dumphdinfo Arch_64min.vdi |grep offData<br />
Header: offBlocks=4096 offData=69632<br />
<br />
Now, '''add to your''' {{ic|offData}} 32256. e.g. 32256 + 69632 = 101888<br />
<br />
Now you can mount your vdi image:<br />
<br />
# mount -t ext4 -o rw,noatime,noexec,loop,offset=101888 Arch_64min.vdi /mnt/<br />
<br />
=== Startup problems because of mount failures ===<br />
<br />
If you experience problems in a [[systemd]] setup after a kernel upgrade, you should start the system with {{ic|1=init=/bin/bash}} (if the emergency shell does not work for you).<br />
<br />
root=/dev/mapper/vg_main-lv_root ro vga=792 resume=/dev/mapper/vg_main-lv_swap init=/bin/bash<br />
<br />
Then mount the ''root''-filesystem with write access:<br />
<br />
# mount / -o remount,rw<br />
<br />
Change {{ic|/etc/fstab}} according to [[#Shared Folders as Arch Linux Guest]]. Then exec systemd within the Bash shell:<br />
<br />
# exec /bin/systemd<br />
<br />
=== Copy&Paste not working on Arch Linux Guest ===<br />
<br />
Since updating {{ic|virtualbox-guest-additions}} to version {{ic|4.2.0-2}} copy&paste from Host OS to Arch Linux Guest stopped working. It seems to be due to {{ic|VBoxClient-all}} requiring ''root'' access. In previous versions adding ''VBoxClient-all &'' to ''~/.xinitrc'' was sufficient to make copy&paste work. Update ''~/.xinitrc'' to match {{ic|sudo VBoxClient-all &}} and add the line {{ic|, NOPASSWD: /usr/bin/VBoxClient-all}} to your username in the sudoers file and restart X. It should all work again. The line in the sudoers file should look similar to this:<br />
<br />
# Allow sudo for user 'you' and let him run VBoxClient-all without requiring a password<br />
you ALL = PASSWD: ALL, NOPASSWD: /usr/bin/VBoxClient-all<br />
<br />
{{Note|Use {{ic|visudo}} to edit the sudoers file. This will check for syntax errors when saving.}}<br />
<br />
=== Use Serial port in guest OS ===<br />
Check you permission in Serial port<br />
$ /bin/ls -l /dev/ttyS*<br />
crw-rw---- 1 root uucp 4, 64 Feb 3 09:12 /dev/ttyS0<br />
crw-rw---- 1 root uucp 4, 65 Feb 3 09:12 /dev/ttyS1<br />
crw-rw---- 1 root uucp 4, 66 Feb 3 09:12 /dev/ttyS2<br />
crw-rw---- 1 root uucp 4, 67 Feb 3 09:12 /dev/ttyS3<br />
<br />
Add you user in '''uucp''' group.<br />
# gpasswd -a YOURUSER uucp <br />
and relogon.<br />
<br />
=== Abort on resume ===<br />
There is a known bug that causes abort on resume: https://www.virtualbox.org/ticket/11289. The workaround is simple: always use Host+q or the menu to close the VM.<br />
<br />
=== System Images in Btrfs ===<br />
In 2010 there were reports that OS disk images would not start if they were attached via a virtual SATA device. It was reportedly fixed, and seemed to be. But as of around March 2013, that particular bug report has been [https://www.virtualbox.org/ticket/6905 repoened]. This can be fixed by enabling the use of the host I/O cache, which is disabled by default with virtual SATA interfaces.<br />
<br />
== External links ==<br />
<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259905MacBookPro9,x2013-05-31T19:49:51Z<p>Oboenerd: /* Users */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<br />
{{note|Apple prefers having 128MB of unallocated space between partitions. Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.}}<br />
<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
/dev/sda7 ? ? ? shared (optional)<br />
<br />
For sharing files between OSX and Linux, a number of filesystem options exist. FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB. Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux. Full read-write support is available for unjournaled HFS+ filesystems. ExFAT support can be made available by installing {{Pkg|fuse-exfat}} and {{Pkg|exfat-utils}}.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only the uid and gid need to match. (usernames can differ)<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259904MacBookPro9,x2013-05-31T19:49:06Z<p>Oboenerd: /* Users */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<br />
{{note|Apple prefers having 128MB of unallocated space between partitions. Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.}}<br />
<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
/dev/sda7 ? ? ? shared (optional)<br />
<br />
For sharing files between OSX and Linux, a number of filesystem options exist. FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB. Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux. Full read-write support is available for unjournaled HFS+ filesystems. ExFAT support can be made available by installing {{Pkg|fuse-exfat}} and {{Pkg|exfat-utils}}.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only the id needs to match. (usernames can differ)<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259903MacBookPro9,x2013-05-31T19:48:06Z<p>Oboenerd: /* Sample partition layout */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<br />
{{note|Apple prefers having 128MB of unallocated space between partitions. Whether or not this is completely necessary is uncertain, but if it seems like there is more than enough space available, then creating this buffer of free space may be a good idea.}}<br />
<br />
partition mountpoint size type label<br />
/dev/sda1 /boot/efi 200MiB vfat EFI<br />
/dev/sda2 - ? hfs+ Mac OS X<br />
/dev/sda3 - ? hfs+ Recovery<br />
/dev/sda4 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
/dev/sda7 ? ? ? shared (optional)<br />
<br />
For sharing files between OSX and Linux, a number of filesystem options exist. FAT32 is natively supported on all systems - however, it lacks support for filesystems larger than 2TB or files larger than 4GB. Journaled HFS+ partitions, such as the Macintosh HD partition, will only mount read-only in Linux. Full read-write support is available for unjournaled HFS+ filesystems. ExFAT support can be made available by installing {{Pkg|fuse-exfat}} and {{Pkg|exfat-utils}}.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259898MacBookPro9,x2013-05-31T19:34:41Z<p>Oboenerd: /* Sample partition layout */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
<br />
This is a very basic, bread-and-butter setup.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259897MacBookPro9,x2013-05-31T19:28:32Z<p>Oboenerd: /* Sample partition layout */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 /boot 100MiB boot boot<br />
/dev/sda5 / 10GiB ext4 root<br />
/dev/sda6 /home remaining ext4 home (optional)<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259896MacBookPro9,x2013-05-31T19:26:51Z<p>Oboenerd: /* Shrinking Macintosh HD */</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Although nowadays Boot Camp requires a Windows installation disc before altering partitions, it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to accommodate for this amount. Leave the new partition as free space for now.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259895MacBookPro9,x2013-05-31T19:25:19Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines special information on installing and configuring Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article is written with a dual-boot setup in mind, and does ''not'' cover how to replace OSX with Arch.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=259894MacBookPro9,x2013-05-31T19:22:18Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent walkthrough to install and configure Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article does ''not'' cover how to replace OSX with Arch, though there are not many extra steps necessary to do so.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. As of June 2013 two options are available, the open source b43 driver and Broadcom's proprietary wl driver.<br />
<br />
====b43====<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
====wl====<br />
''more to come.''<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{Pkg|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{Pkg|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the trackpad. This can be achieved with a combination of X11 driver settings and open source software.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the {{pkg|xf86-input-synaptics}} driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some suggestions which resemble the options found in OSX's System Preferences:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}} with the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro&diff=253718MacBookPro2013-04-11T04:02:19Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
[[de:Archlinux auf einem Macbook Pro 3.1]]<br />
{{Out of date}}<br />
{{Article summary start}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
<br />
== WARNING OUTDATED ==<br />
Please see [[MacBook Aluminum]] for newest 5,1 and 5,2 unibody Macbook Pros or [[MacBook]] for general Macbook information.<br />
<br />
also see: https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation<br />
<br />
== Installing Arch Linux on MacbookPro ==<br />
<br />
These instructions could work for the most part for the regular MacBook.<br />
<br />
You will need Arch Linux 0.8 alpha3 or newer at least since GRUB and the kernel will work fine from this version.<br />
<br />
=== Arch Only System ===<br />
To install Arch and replace OSX you need to change the partition table type in Mac OS X from bootcamp. Download bootcamp, install and run. Change disk from GPT to MBR partition table.<br />
<br />
Reboot, hold down the "C" key to boot from CD.<br />
<br />
Install Arch as normal. Do not forget to set one partition as bootable.<br />
<br />
After install you need to configure a couple of things...<br />
<br />
=== Dual Boot (Arch & Mac OS X) ===<br />
<br />
==== Another way ====<br />
<br />
- Prepare:<br />
# Arch Linux Install CD<br />
<br />
- Begin to install<br />
<br />
1. Resize the partition with Disk Utils in Mac OS X<br />
<br />
2. Install REFI in Mac OS X.<br />
<br />
3. Boot to Arch Linux Installation CD <br />
<br />
1) pacman -S gpt-fdisk and install 'gptsync' package from AUR<br />
<br />
2) gptsync /dev/sda4 # TODO is this required?<br />
<br />
3) partition with gdisk. # type code must be 0700<br />
<br />
4) gptsync /dev/sda4 # TODO is this required?<br />
<br />
5) begin install with /arch/setup, but don't install bootloader<br />
<br />
6) gptsync /dev/sda4<br />
<br />
7) install bootloader to /dev/sda3 manually. # be careful, not /dev/sda<br />
<br />
mount /dev/sda4 /mnt<br />
grub-install --root-directory=/mnt /dev/sda4<br />
# edit /mnt/boot/grub/menu.lst<br />
<br />
==== Other ways: Two possibilities: ====<br />
<br />
- Install Bootcamp, resize the Mac OS X partition<br />
<br />
When Mac OS X installation is finished. Go on http://refit.sourceforge.net and download rEFIT (Mac disk image)<br />
<br />
To install rEFIT, mount the rEFIT.dmg file (it is normally automatic).<br />
<br />
There is an other way (refer to rEFIT documentation) but you can open a terminal then you copy /Volumes/rEFIT/efi/ to /<br />
# cp -r /Volumes/rEFIT/efi /<br />
<br />
To install rEFIT :<br />
# cd /efi/refit/<br />
# ./enable.sh<br />
<br />
Now we can synchronized MBR with GPT partition table thanks to rEFIT so you restart your computer. You can see rEFIT, you press down key to access to the Partitioning Tool. You press y to accept.<br />
<br />
Put your Arch Linux CD in the CD-ROM drive first then restart the computer. You can press C to boot from the CD or you can choose it in the rEFIT menu.<br />
<br />
Now it is the typical Arch Linux installation.<br />
<br />
At the end of the installation DO NOT install the bootloader in the MBR, but in a partition (e.g. sda3). This may add complications; see below.<br />
<br />
==== GRUB ====<br />
<br />
Macs are partitioned using the EFI system, which GRUBv1 is not compatible with. Some versions of GRUB2 are compatible - however, GRUB2 is not on the installation CD as of the 2011.08.19 release. In order to work around this, rEFIt creates a MBR ([[Master Boot Record]]), which must be updated every time the partitions are modified or reformatted. However, only the first 4 partitions are put into the MBR; if you are dual booting, those first two will belong to the regular macbook installation.<br />
<br />
To install Arch Linux with GRUB as a dual-boot, follow these steps (tested on a Macbook Pro(6,2)):<br />
<br />
# Use the Disk Utility to resize your Mac partition, and create new partitions for your Linux installation. These can be formatted to anything - the Arch installation can reformat them as ext3 or ext4. Make sure that the / partition AND the /boot partition are BOTH in the first four partitions - or simply do not have a separate /boot partition, it isn't necessary.<br />
# Install rEFIt as above, reboot, and update the MBR (choose "Start Partitioning Tool" from the rEFIt menu on boot)<br />
# Insert the Arch Linux installation CD, reboot, and boot from the CD.<br />
# Install Arch Linux, choosing a GRUB bootloader installation, but being careful to hit CANCEL when asked to install it to the MBR. The installation will consider this section 'FAILED', which is true, but we will take care of this.<br />
# Reboot, update the MBR (same as step 2), and boot from the CD.<br />
# Now we install GRUB:<br />
# cd /<br />
# mount -t ext3 /dev/sdaN /mnt # where sdaN is the location you installed to.<br />
# mount -t ext3 /dev/sdaM /mnt/boot # where sdaM is the location of the /boot partition, if you have a separate one<br />
# mount -t proc proc /mnt/proc<br />
# mount -t sysfs sys /mnt/sys<br />
# mount -o bind /dev /mnt/dev<br />
# chroot /mnt /bin/bash<br />
# grub<br />
grub> root (hd0,M-1)<br />
grub> setup (hd0,M-1)<br />
grub> quit<br />
# reboot<br />
<ol start="7"><br />
<li>From the rEFIt menu on boot, choose "Boot Linux from Partition X"<\li><br />
<\ol><br />
<br />
Now you are at an Arch Linux command-line.<br />
<br />
== Configuration ==<br />
<br />
=== rc.conf ===<br />
Make sure your [[rc.conf]] at least has the following modules:<br />
MODULES=(sky2 fglrx speedstep_centrino)<br />
<br />
For CPU scaling use the [[powernowd]] package.<br />
<br />
=== Xorg ===<br />
Install:<br />
pacman -S ati-fglrx-utils<br />
<br />
A sample {{ic|xorg.conf}} follows (Outdated! See [[Xorg Input Hotplugging]]):<br />
<br />
{{hc|/etc/X11/xorg.conf<br />
|<nowiki><br />
Section "ServerLayout"<br />
Identifier "Simple Layout"<br />
Screen 0 "aticonfig-Screen[0]" 0 0<br />
InputDevice "Mouse1" "CorePointer"<br />
InputDevice "Keyboard1" "CoreKeyboard"<br />
EndSection<br />
<br />
Section "Files"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/Type1"<br />
EndSection<br />
<br />
Section "Module"<br />
Load "freetype"<br />
Load "xtt"<br />
Load "dbe" # Double buffer extension<br />
SubSection "extmod"<br />
Option "omit xfree86-dga" # do not initialize the DGA extension<br />
EndSubSection<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard1"<br />
Driver "kbd"<br />
Option "AutoRepeat" "500 30"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "pc105"<br />
Option "XkbLayout" "latam"<br />
Option "XkbOptions" "lv3:rwin_switch"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "Auto" # Auto detect<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5 6 7"<br />
Option "MinSpeed" "1.0"<br />
Option "MaxSpeed" "1.0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "aticonfig-Monitor[0]"<br />
Option "VendorName" "ATI Proprietary Driver"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "aticonfig-Device[0]"<br />
Driver "fglrx"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "aticonfig-Screen[0]"<br />
Device "aticonfig-Device[0]"<br />
Monitor "aticonfig-Monitor[0]"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "DRI"<br />
Mode 0666<br />
EndSection<br />
</nowiki>}}<br />
<br />
OR you can just make the necessary changes: (ADD these to your xorg.conf, do not replace)<br />
<br />
Configure Xorg using xorgconfig. Once done edit your "xorg.conf" and change the driver type to "fglrx".<br />
Section "Device"<br />
Driver "fglrx"<br />
EndSection <br />
<br />
Configure your keyboard: (make right "apple key" right ALT key)<br />
Section "InputDevice"<br />
Option "XkbOptions" "lv3:rwin_switch"<br />
EndSection<br />
<br />
Configure your trackpad:<br />
Section "InputDevice"<br />
Option "Protocol" "Auto"<br />
Option "MinSpeed" "1.0"<br />
Option "MaxSpeed" "1.0"<br />
EndSection<br />
<br />
OR you may want to use this, that emulates the Mac OS X behavior:<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
Option "CorePointer"<br />
Option "Device" "/dev/input/mouse1"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "60"<br />
Option "RightEdge" "900"<br />
Option "BottomEdge" "511"<br />
Option "HorizScrollDelta" "0"<br />
Option "MinSpeed" "0.4"<br />
Option "MaxSpeed" "1"<br />
Option "AccelFactor" "0.08"<br />
Option "MaxTapTime" "0"<br />
Option "TapButton1" "0"<br />
#Two Finger Scroll<br />
Option "VertTwoFingerScroll" "1"<br />
Option "HorizTwoFingerScroll" "1"<br />
EndSection<br />
<br />
Configure modules:<br />
Section "Module"<br />
Load "dbe" # Double buffer extension<br />
SubSection "extmod"<br />
Option "omit xfree86-dga" # do not initialize the DGA extension<br />
EndSubSection<br />
EndSection<br />
<br />
=== Wireless ===<br />
The airport card in the newest MacBook (PCI-ID 168c:0024) is not yet supported by Madwifi. In short: Madwifi does not yet have a version of the (binary-only) HAL (hardware-abstraction layer) for the new chipset and ETA is unknown. Workaround: If your kernel is 32-bit, you can use ndiswrapper in combination with the 32-bit windows driver for the [http://www.dlink.com/products/support.asp?pid=489&sec=0 D-Link DWA-645]. <br />
It is ugly, but it works. Some ubuntu users report it working with 64-bit too, albeit some have issues with WPA1/2.<br />
<br />
Madwifi drivers work on my second generation MBP following [http://ubuntu-tutorials.com/2007/10/24/how-to-enable-wireless-networking-on-the-macbook-ubuntu-710/ these] instructions.<br />
<br />
=== Pommed ===<br />
[http://technologeek.org/projects/pommed/ Pommed] handles the hotkeys and is able to adjusts the LCD backlight, sound volume, keyboard backlight or to eject the CD-ROM drive.<br />
<br />
Pommed is in [community], there is also a GUI built on GTK (gpomme)<br />
<br />
=== Suspend ===<br />
Suspend works most of the time (occasionally it dose not wake up) with the latest version of [[pm-utils]].<br />
<br />
sudo pacman -S pm-utils<br />
<br />
Run the following to test suspension. (Pressing the power button, plugging in a usb device, or closing/opening the lid will resume.)<br />
<br />
sudo pm-suspend<br />
<br />
To suspend on closing of laptop lid, make sure you have acpi, and acpid installed with pacman, and that the acpid daemon is running. Then edit /etc/acpi/handler.sh and change the "button/lid)" section to look like the following:<br />
<br />
button/lid)<br />
#echo "LID switched!">/dev/tty5<br />
if grep -q closed /proc/acpi/button/lid/LID0/state<br />
then pm-suspend<br />
fi<br />
;;<br />
<br />
Acpid calls the button/lid) section whenever the lid is opened or closed. If pm-suspend is just added to this section, it will suspend when the lid is opened, and when the lid is closed. Causing it to wake up, and then immediately suspend again when you open the lid. Checking to see if the lid is closed with grep and only running pm-suspend when the lid is closed fixes this issue.<br />
<br />
== TODO ==<br />
I WILL get around to doing these! I promise! In the mean time I just put them here to remind me to do them.<br />
<br />
- make package for refit<br />
(EDIT: refit is actually in [community])<br />
<br />
- make section for isight</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro7,1&diff=253717MacBookPro7,12013-04-11T04:02:03Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook Pro 7,1}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
== Installation ==<br />
<br />
Using mid 2012/12 installation media, I primarily followed this [https://gist.github.com/Apsu/4108795 GIST] in conjunction with the [[MacBook]] EFI installation instructions to install an x86_64 system. The [[GRUB2]] page is invaluable. Installing rEFIt is not necessary.<br />
<br />
As per [[GRUB2]], it is recommended to read the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages before trying any of this on your machine.<br />
<br />
== Network ==<br />
<br />
[[Wireless_Setup|Wireless Setup]] provides instructions on how to identify your card, but if your MacBook Pro 7,1 is like mine then you'll head to [[Broadcom_wireless|Broadcom Wireless]] and use this command.<br />
<br />
$ lspci -vnn -d 14e4:<br />
<br />
If from this you discover that your full PCI-ID is {{ic|[14e4:432b]}}, then the following advice applies to you: Don't waste time on the {{ic|b43}} driver. I've been fiddling with it for weeks, and switching to {{ic|broadcom-wl}} made all the problems go away. {{ic|broadcom-wl}} might make your device names funky, but that's easily fixed with the udev rule documented on [[Broadcom_wireless|Broadcom Wireless]].<br />
<br />
I also recommend {{ic|netctl}}.<br />
<br />
== Video ==<br />
<br />
According to the [http://wiki.debian.org/MacBookPro Debian Wiki] and the other sources I've searched out, the MacBook Pro 7,1 has an [http://www.geforce.com/hardware/desktop-gpus/geforce-GT-320-OEM NVIDIA GeForce GT 320M] in it.<br />
<br />
I have yet to get the video driver to work. The monitor seizes up when I {{ic|startx}} with the NVIDIA drivers, but if you have a preexisting ssh connection you should be able to kill Xorg and start again.<br />
<br />
'''To be continued..'''</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=253716MacBookPro8,x2013-04-11T04:01:52Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook Pro 8,1/8,2/8,3}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation ==<br />
<br />
Use the latest Arch Installation Image from here: https://www.archlinux.org/download/<br />
<br />
=== EFI Boot ===<br />
<br />
Consult [[UEFI]] <br />
<br />
{{Warning|efibootmgr may brick your Mac firmware.}}<br />
<br />
radeon driver which only loads properly on Macs in BIOS emulation mode, problem description and possible solution [https://bugs.freedesktop.org/show_bug.cgi?id=26891 here].<br />
<br />
'''8,1'''<br />
<br />
Tested on macbook pro 8.1 . Forum thread: [https://bbs.archlinux.org/viewtopic.php?id=136833&p=1]<br />
<br />
Add following to Kernel Parameters. <br />
<br />
i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 usbcore.autosuspend=1 h<br />
<br />
'''8,2 and 8,3'''<br />
<br />
While using EFI Boot, you will find<br />
<br />
radeon 0000:01:00.0: >Invalid ROM contents<br />
i915 0000:00:02.0: Invalid ROM contents<br />
<br />
Which means you need disable KMS for amd and intel card. Add following to Kernel Parameters. <br />
<br />
i915.modeset=0 radeon.modeset=0<br />
<br />
newer versions of the Xorg Intel/i915 driver require KMS to work; without it the X server will fallback to framebuffer mode, with poor performance. The underlying issue is that the Intel KMS driver selects the wrong video output; to fix this try the following settings (tested on an 8,3/17" MBP):<br />
<br />
radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2<br />
<br />
This should give you Intel graphics output. Note that this requires kernel 3.5rc1 or higher; use linux-mainline from Aur if necessary. See [https://bugzilla.kernel.org/show_bug.cgi?id=42842 this bug] for more details.<br />
<br />
If you don't have KMS for intel driver, you need install 'xf86-video-fbdev'<br />
<br />
# pacman -S xf86-video-intel and xf86-video-fbdev<br />
<br />
If Xorg refuses to start with a "no screens found" message you may have to tell Grub2 to turn off the Radeon card and turn on the Intel card during boot. Edit /etc/grub.d/00_header and add the "outb" lines immediately after "set gfxmode=" (Tested on an 8,2 MBP):<br />
<br />
...<br />
set gfxmode=${GRUB_GFXMODE}<br />
outb 0x728 1<br />
outb 0x710 2<br />
outb 0x740 2<br />
outb 0x750 0<br />
load video<br />
...<br />
<br />
Then regenerate your grub.cfg:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using rEFInd and Kernel EFISTUB ====<br />
<br />
'''Install rEFInd'''<br />
<br />
Consult [http://www.rodsbooks.com/refind/installing.html Installing rEFInd]<br />
<br />
Boot into Mac OS X<br />
<br />
# mkdir -p /efi/refind<br />
# cp -r refind/* /efi/refind/<br />
# rm /efi/refind/refind_ia32.efi<br />
# mv /efi/refind/refind.conf-sample /efi/refind/refind.conf and adjust it<br />
# bless --setBoot --folder /efi/refind --file /efi/refind/refind_x64.efi<br />
<br />
'''Setting up EFISTUB'''<br />
<br />
Follow [[UEFI Bootloaders#Linux Kernel EFISTUB]]<br />
<br />
'''Add Kernel MODULES'''<br />
<br />
Without this, you will get 'root fs not found' error.<br />
<br />
Edit /etc/mkinitcpio.conf<br />
<br />
MODULES="..ahci libahci.."<br />
<br />
Then re-generate the boot img:<br />
<br />
# mkinitcpio -p linux<br />
<br />
=== BIOS Boot ===<br />
<br />
Boot into BIOS emulation mode. AMD card works, but intel card doesn't.<br />
<br />
Use refind to load grub-legacy.<br />
<br />
== Network == <br />
<br />
===Wireless:=== <br />
{{Note|need Kernel 3.3 or later}}<br />
<br />
Install {{aur|b43-firmware}} package from the [[AUR]]. <br />
<br />
Unload b43 and bcma modules and load b43 module<br />
<br />
{{bc|<br />
# rmmod b43 bcma<br />
# modprobe b43}}<br />
That's it. The wireless should work now.<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
'''Touchpad''':<br />
<br />
Two finger scrolling and left-click works out of the box. Unfortunately the right-click is not functional.<br />
<br />
'''14/09/2012 : right click (2 fingers) and middle click (3 fingers) works out of the box with KDE.'''<br />
<br />
To enable most of the multitouch touchpad features (even right and middle clik) use [https://github.com/BlueDragonX/xf86-input-mtrack mtrack], which is avaible in [https://aur.archlinux.org/packages.php?ID=48505 AUR]. The configuration is done via the /etc/X11/xorg.conf.d/10-mtrack.conf file. Check if the mtrack module is properly loaded in the /var/log/Xorg.0.log file. Sometimes xorg loads other drivers before, like eg. synpatics, and the mtrack driver is not used at all.<br />
<br />
For an MBP 8,3 I needed to use the following config (in /etc/X11/xorg.conf.d/10-mtrack.conf) to stop it picking up other input devices by mistake:<br />
<br />
Section "InputClass"<br />
Identifier "Multitouch Touchpad"<br />
Driver "mtrack"<br />
MatchDevicePath "/dev/input/event*"<br />
MatchProduct "bcm5974"<br />
MatchIsTouchpad "true"<br />
EndSection<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
Adjust Brightness: works with {{pkg|xorg-xbacklight}}<br />
For example:<br />
<br />
xbacklight -inc 7 # increase brightness<br />
xbacklight -dec 7 # decrease brightness<br />
<br />
or you can use a simple bash script that provides screen and keyboard backlight management by simple cli (-d for display / -k for keyboard)<br />
<br />
#!/bin/bash<br />
case $1 in<br />
-d|--display)<br />
if [ "$2" != "0" ]<br />
then<br />
echo "$[(($2 * 4882) / 100) % 4883]" > /sys/class/backlight/intel_backlight/brightness<br />
fi;;<br />
-k|--keyboard)<br />
echo "$[(($2 * 255) / 100) % 256]" > /sys/class/leds/smc\:\:kbd_backlight/brightness;;<br />
-h|--help)<br />
echo -e "MacBook 8.1 brightness helper\n\t-d\tset display brightness (0-100%)\n\t-k\tset keyboard brightness (0-100%)\n";;<br />
*)<br />
echo -e "Unknown option try -h or --help";;<br />
esac<br />
<br />
save it in <br />
<br />
/usr/bin/macbackl<br />
<br />
mark executable<br />
<br />
# chown +x /usr/bin/macbackl<br />
<br />
<br />
for usage, run<br />
<br />
# macbackl --help<br />
<br />
NOTE: you must be root to edit the files in /sys/class/* but if you want you can chown "/sys/class/leds/smc\:\:kbd_backlight/brightness" and "/sys/class/backlight/intel_backlight/brightness"<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M and 6770M: works with xf86-video-ati<br />
<br />
Adjust Brightness: install AUR package {{aur|apple-bl-gmux}} and reboot system.<br />
<br />
$ echo 34839 | sudo tee /sys/class/backlight/gmux_backlight/brightness<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
'''8,3'''<br />
<br />
Using [[PulseAudio]] sound works out of the box. However some applications (e.g. [[Vlc]]) have intermittent crackling; appending 'tsched=0' to 'module-udev-detect' in /etc/pulse/default.pa fixes this.<br />
<br />
== Suspend & Hibernate == <br />
<br />
Consulte [[Suspend and Hibernate]].<br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
'''8,2'''<br />
<br />
BIOS Boot: using linux >= 3.6.2, supend and resume works out-of-the-box.<br />
<br />
EFI Boot: resume may not work.<br />
<br />
'''8,3'''<br />
<br />
Supend and resume work out of the box, including wireless reconnection.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Bluetooth ==<br />
<br />
I had problems pairing devices, nothing was detected with<br />
<br />
hcitool scan<br />
<br />
There seems to be a conflict between the bluetooth module and the b43 one (wifi), as written in [http://blog.tkassembled.com/188/macbook-pro-83-bluetooth-issues-on-linux/ this blog post]. The solution is to do the following:<br />
<br />
# rmmod b43<br />
pair your bluetooth device<br />
# modprobe b43<br />
<br />
=== Alternative solution ===<br />
<br />
Create {{ic|/etc/modprobe.d/b43.conf}} with the following content:<br />
{{bc|1=options b43 btcoex=0}}<br />
<br />
== Webcam ==<br />
<br />
In order to use your webcam you need to have permission to use /dev/video0. <br />
# gpasswd -a <username> video<br />
<br />
Test to see if it works<br />
$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot<br />
<br />
=== With linux-mainline ===<br />
<br />
As noted elsewhere in this document, some MBP features work best (or only) with the latest kernel; the usual way to install this is using the [https://aur.archlinux.org/packages.php?ID=50893 linux-mainline] AUR package. However, as of 3.6.rc3 the config for linux-mainline disables webcam support (due to changed defaults in kernel). [http://pastebin.com/WbYpPrg1 This patch] to the x86_64 config fixes this issue.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Sensors<br />
<br />
== Troubleshooting ==<br />
<br />
'''Grub2-EFI boot: Intel invalid ROM contents'''<br />
<br />
If you see this error on boot and notice the screen output seemingly frozen, you need to disable KMS.<br />
<br />
Append the following to your /etc/grub/defaults LINUX line:<br />
<br />
i915.modeset=0 radeon.modeset=0<br />
<br />
However, newer versions of the Xorg Intel/i915 driver require KMS to work; without it the X server will fallback to framebuffer mode, with poor performance. The underlying issue is that the Intel KMS driver selects the wrong video output; to fix this try the following settings (tested on an 8,3/17" MBP):<br />
<br />
radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2<br />
<br />
This should give you Intel graphics output. Note that this requires kernel 3.5rc1 or higher; use linux-mainline from Aur if necessary. See [https://bugzilla.kernel.org/show_bug.cgi?id=42842 this bug] for more details.<br />
<br />
You may find you need to enable the Intel device; if using Grub, the following should enable it at boot time:<br />
<br />
set gfxpayload=keep<br />
# Switch gmux to IGD<br />
outb 0x728 1<br />
outb 0x710 2<br />
outb 0x740 2<br />
<br />
Alternatively, if you have OS X available you can use [http://codykrieger.com/gfxCardStatus gfxCardStatus] to switch to the Intel device before booting into Linux.<br />
<br />
'''Grub2-EFI boot: root fs not found'''<br />
<br />
On boot, grub2-efi may complain that no root fs is found. This is due to the ahci modules being improperly loaded. <br />
<br />
chroot into the installed Arch system. Then edit the /etc/mkinitcpio.conf MODULES array:<br />
<br />
MODULES="..ahci libahci.."<br />
<br />
Then re-generate the boot img:<br />
<br />
mkinitcpio -p linux</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=Mac&diff=253715Mac2013-04-11T04:01:41Z<p>Oboenerd: Adding most recent hardware to list</p>
<hr />
<div>[[Category:Apple]]<br />
[[de:ArchLinux auf einem MacBook]]<br />
[[fr:MacBook]]<br />
[[it:MacBook]]<br />
[[zh-CN:MacBook]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook and MacBook Pro lines of notebooks.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}}<br />
{{Article summary wiki|Beginners Guide}}<br />
{{Article summary wiki|General Recommendations}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<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 />
To install using EFI, follow the [https://wiki.archlinux.org/index.php/EFI#Create_UEFI_bootable_USB_from_ISO instruction to make a EFI bootable media]. Once done double check that your USB key actually boots in EFI mode [https://wiki.archlinux.org/index.php/UEFI#UEFI_Variables_Support checking the EFI kernel variables]. You will need to format the EFI partition with the {{ic|hfsplus}} filesystem ({{AUR|hfsprogs}}) instead vfat otherwise {{AUR|mactel-boot}} will fail, and in Macbooks [https://wiki.archlinux.org/index.php/UEFI#Non-Mac_UEFI_systems you cannot use {{ic|efibootmgr}}].<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. See http://mjg59.dreamwidth.org/7468.html)}}<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 | On MacBook Pro 7,1, I had an error booting the installation media Version 2012.12.01: "unable to handle kernel NULL pointer dereference at 0000000000000010" during pacpi_set_dmamode. To fix this problem, boot with the option: acpi&#61;off. After chrooting, add MODULES&#61;"ata_generic" into /etc/mkinitcpio.conf and execute mkinitcpio -p linux, see: [[Installation_Guide#Configure_the_system | Installation Guide, 9 Configure the system]].}}<br />
{{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 />
* 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 />
{{Tip|Alternatively, you can choose to use the [https://aur.archlinux.org/packages/pommed-light/ pommed-light] package found in the [[AUR]]. If you do so, you may wish to change the step settings in /etc/pommed.conf.mactel to something around 5000-10000 depending on how many levels of brightness you desire. The max brightness is around 80000, so take that into account.}}<br />
<br />
===== Macbook 6.2+ - EFI =====<br />
<br />
As of 4/30/2011, the proprietary nvidia driver is not known to work under X with this model in efi mode. The nouveau driver should work out of the box, but dri should be installed from the [https://aur.archlinux.org/packages/mesa-git/PKGBUILD mesa-git] package.<br />
<br />
===== MacbookPro 5.5, NVIDIA and secondary display =====<br />
<br />
As of January 1 2011, the latest NVIDIA drivers (290.10) might not work properly when a secondary display is used (tested with TwinView), NVIDIA's current [http://www.nvnews.net/vbulletin/showthread.php?t=122606 long-live supported] 275xx drivers seem to work fine. Install [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[https://www.archlinux.org/packages/extra/x86_64/xf86-input-synaptics/] in Extra. Although it does not have much function as 3 finger swipe, this driver provides faster response. Gsynaptics[https://www.archlinux.org/packages/community/i686/gsynaptics/] also provides a simple GUI config. Below is a Xorg config file /etc/X11/xorgconfig.d/60-synaptics.conf for reference only.<br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "SHMConfig" "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "PalmDetect" "on"<br />
Option "VertEdgeScroll" "off"<br />
Option "HorizEdgeScroll" "off"<br />
Option "CornerCoasting" "off"<br />
Option "EdgeMotionUseAlways" "off"<br />
Option "AreaLeftEdge" "10"<br />
Option "AreaRightEdge" "1270"<br />
EndSection<br />
<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-settings, edit the file '/etc/X11/xorg.conf' and add this line into the Device section:<br />
<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
save and reboot and check backlight buttons work.<br />
More information available at [https://help.ubuntu.com/community/MacBookPro5-5/Precise#LCD ubuntu macbook pro 5,5]<br />
<br />
=== 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 />
=== Light sensor ===<br />
<br />
If you want to use the built in light sensor to automatically adjust screen and keyboard backlight brightness check out<br />
'''Lighter''' [https://github.com/Janhouse/lighter] (simple perl script, easy to fine-tune) and '''Lightum''' [https://github.com/poliva/lightum] (Requires Gnome or KDE but is older and more complete than Lighter).<br />
<br />
=== Sound ===<br />
{{ 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 booting ===<br />
If your Macbook spends 30 seconds with "white screen" before booting you need to tell the firmware where is the booting partition.<br />
<br />
Boot Mac OS X, if do not have it installed, you can use the install DVD (select language, then click Utilities->Terminal), or another MacBook with Mac OS X (connect the two computers via firewire or thunderbolt, start the other Macbook keeping pressed T, boot your MacBook keeping pressed Options).<br />
<br />
Either way, once you got a Mac OS X terminal running on your MacBook you need to execute, as root, a different command if the boot partition is EFI or it is not:<br />
<br />
# bless --device /dev/disk0s1 --setBoot # if the booting partition is EFI<br />
or<br />
# bless --device /dev/disk0s1 --setBoot --legacy # if the booting partition is not EFI<br />
<br />
(given that if your GRUB or EFI is on sda1, /dev/disk1s2 if it is on sdb2, etc). See also https://bbs.archlinux.org/viewtopic.php?pid=833215 and https://support.apple.com/kb/HT1533 .<br />
<br />
=== Mute startup chime ===<br />
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 | You probably want to have a look at [http://www.rodsbooks.com/refind/ refind], which is some type of successor of rEFIt.}}<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 ===<br />
<br />
==== Mid 2007 13" - Version 2,1 ====<br />
<br />
{{Note|I used the 201212 ISO image.}}<br />
{{Warning|Current linux-3.8.x packages do not work with their EFI stub and refind-efi. Either use an older package ({{Pkg|linux}} 3.7.10-1 works with {{Pkg|refind-efi}} 0.6.8-1) or you may use a bootloader which does not rely on EFI stub. Similiar issues are reported with {{Pkg|gummiboot}}.}}<br />
<br />
Since older Macbooks have a 32bit EFI running, the usual installation image is not recognized. You need to either remove the UEFI support from the disc ([[Unified_Extensible_Firmware_Interface#Remove_UEFI_boot_support_from_ISO]]) or build a 32bit EFI version of the disc. The paragraphs below will take the first path to success, booting into BIOS mode and its pitfalls. For a try the other way round, read [[Unified_Extensible_Firmware_Interface#Create_UEFI_bootable_USB_from_ISO]] first.<br />
<br />
First prepare your harddisc according to your wishes. In this scenario it was a "Linux only" approach with<br />
<br />
/dev/sda1 HFS+ AF00 200M -> EFI boot system on Apple HFS+ partition<br />
/dev/sda2 ext4 8300 147G -> arch system<br />
/dev/sda3 swap 8200 1G -> swap<br />
<br />
The {{AUR|hfsprogs}} package contains the tools to handle HFS/HFS+ filesystems. The rEFInd bootloader recognizes it on its own. Usually the partition for the EFI bootloader is a FAT32 (vfat) partition. In this case I tried rEFIt first, which apparently needs the HFS+ filesystem to work, and kept it at that.<br />
<br />
The mount points are:<br />
<br />
/dev/sda2 -> /<br />
/dev/sda1 -> /boot/efi<br />
<br />
The bootloader in use was [http://www.rodsbooks.com/refind/index.html rEFInd] instead of rEFIt. To install it, the rEFInd homepage provides a good guide. The pitfall here is, that the system bootet in BIOS compatibility mode and not in EFI mode. You can't therefore use {{ic|efibootmgr}}, because the EFI variables (even with 'modprobe efivars') are not available. While installing the system get [[yaourt]] and {{AUR|mactel-boot}} from the [[AUR]]. The {{ic|hfs-bless}} utility comes in handy, when blessing the EFI bootloader. This is done by calling e.g.<br />
<br />
hfs-bless /boot/efi/EFI/refind/refind.efi<br />
<br />
Since the Linux kernel does come with EFI stub enabled, it seemed a good idea to run it through a bootloader first. Especially if it runs not out of the box. But using rEFInd makes GRUB (or any other bootloader) obsolete, because of that.<br />
<br />
Not running out of the box is unfortunately the initial stage for the kernel. Since we installed it in BIOS mode, two modules are missing to grant access to the root partition while booting. Hence the 'initfsram-linux.img' can not be found/loaded. Adding the following modules to your 'MODULES' line in {{ic|/etc/mkinitcpio.conf}} solved this ([https://bbs.archlinux.org/viewtopic.php?pid=1139226#p1139226 original post]).<br />
<br />
{{hc|# nano /etc/mkinitcpio.conf|2=<br />
MODULES="ahci sd_mod"}}<br />
<br />
Rebuild your kernel image<br />
<br />
mkinitcpio -p linux<br />
<br />
The bootloader rEFInd can scan kernels even out of the '/boot/efi/...' directory and assumes an efi kernel even without the extension '.efi'. If you don't want to try out special kernels, this should work without the hassle to copy each kernel after building to some spot special.<br />
<br />
If you happen to get multiple entries for one boot image, it often results of a previous installation of a bootloader within the MBR. To remove that, try the following - taken from the [http://ubuntuforums.org/showpost.php?p=7828260&postcount=4 original post]. This is valid for GPT partitioned discs, so please check your environment and save your MBR first.<br />
<br />
sudo dd if=/dev/zero of=/dev/sda bs=440 count=1<br />
<br />
=== MacBook Pro ===<br />
<br />
==== 10,1 ====<br />
<br />
* [[MacBookPro Retina]].<br />
<br />
=== MacBook Air===<br />
==== 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 />
==== Mid 2012 11.5" - Version 5,1 ====<br />
If you have issues with waking from sleep while in X11 such as a black screen or showing the console with a frozen mouse cursor then remove xf86-input-synaptics and install mtrack-git from aur. This fixed errors such as <br />
(EE) [dix] bcm5974: unable to find touch point 0<br />
and backtraces that causes X11 to crash. This might apply to Version 5,2 assuming they use the same trackpad.<br />
<br />
===== Installing using the Archboot 2012.06 image =====<br />
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 />
==== Early 2008 - Version 1,1 ====<br />
Everything works out of the box though you'll need [https://www.archlinux.org/packages/core/x86_64/b43-fwcutter/ b43-fwcutter] (or simply [https://aur.archlinux.org/packages/b43-firmware/ b43-firmware]) for the wireless adapter to work.<br />
Since this model has a single USB, you may find it easiest to install Arch by using a USB hub with an USB wireless adapter and the arch installation media.<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>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253714MacBookPro9,x2013-04-11T04:00:33Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent walkthrough to install and configure Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article does ''not'' cover how to replace OSX with Arch, though there are not many extra steps necessary to do so.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not desirable it is possible to install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the track.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some OSX-like suggestions:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253713MacBookPro9,x2013-04-11T03:58:31Z<p>Oboenerd: nit-pick grammar</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent walkthrough to install and configure Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article does ''not'' cover how to replace OSX with Arch, though there are not many extra steps necessary to do so.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]], noting the following modifications:<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the track.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some OSX-like suggestions:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253712MacBookPro9,x2013-04-11T03:55:49Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent walkthrough to install and configure Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. <br />
<br />
This article does ''not'' cover single-boot setups, although there are not too many steps required to convert this to a single-boot guide.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the track.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some OSX-like suggestions:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253711MacBookPro9,x2013-04-11T03:55:01Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent walkthrough to install and configure Arch on the more recent Macbook 9,x (Mid-2012) hardware alongside a pre-existing OSX operating system. This requires adequate free disk space, install media (such as a USB or CD), and a wired connection for the initial steps of the install procedure. This article does ''not'' cover single-boot setups, although there are not too many steps required to convert this to a single-boot guide.<br />
<br />
For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
{{note|Remember to back up your pre-existing OSX installation before proceeding!}}<br />
<br />
==Preparation==<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.<br />
<br />
Install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the track.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some OSX-like suggestions:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
{{AUR|touchegg}} is an application that can recognize additional gestures. To use this you'll need to replace the synaptics driver with {{AUR|xf86-input-synaptics-mtpatch}}.<br />
<br />
{{Hc|head=$(HOME)/.config/touchegg/touchegg.conf|output=<br />
...<br />
<application name="All"><br />
...<br />
<gesture type="DRAG" fingers="3" direction="ALL"><br />
<action type="DRAG_AND_DROP"></action><br />
</gesture><br />
...<br />
</application><br />
...<br />
}}</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253707MacBookPro9,x2013-04-11T03:32:01Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent situation of running Arch on Macbook 9,x (Mid-2012) hardware. The original information written here dates from April 2013, installing kernel 3.8. You'll need a wired connection to complete the initial steps of this installation. For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
For now I assume a dual-booted install alongside OSX. Please feel free to contribute information regarding other setups.<br />
<br />
==Preparation==<br />
<br />
{{Warning | Remember to back up your data using a utility such as Time Machine before beginning!}}<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories from Linux, write down the UID and GID for the users.<br />
<br />
{{Note|OSX begins with the first user's UID at 501 while Arch defaults to 1000.}}<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]].<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
Single-boot setups can simply omit the OSX and Recovery partitions.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, new users can be created by running:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access a OSX user's directory, only id's need to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. {{ic|base-devel}} is required.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.<br />
<br />
Then, install {{AUR|b43-firmware}} from [[AUR]] and reboot. From here on in, wifi configuration should proceed normally - once it's working the wired connection may be disconnected.<br />
<br />
{{note|Since this is a bleeding-edge fix, it's probably a good idea to keep a wired connection handy in case something goes horribly wrong.}}<br />
<br />
===Xorg===<br />
Main Page: [[Xorg]]<br />
<br />
Install {{ic|xf86-video-intel}} and setup Xorg as you normally would.<br />
<br />
The built-in keyboard and most usb input devices will work out-of-the-box, but {{ic|xf86-input-synaptics}} is needed in order to use the built-in touchpad. More on this in the "Bells & Whistles" section.<br />
<br />
==Bells & Whistles==<br />
<br />
===Emulating OSX Touchpad Gestures===<br />
With a little bit of work it's possible to tweak the multitouch options on the track.<br />
<br />
====Using synclient====<br />
{{ic|synclient}} is included with the xf86-input-synaptics driver. It is useful for experimenting with settings as they take effect immediately and expire at the end of an X session. Many OSX options can be emulated without any additional software.<br />
<br />
Run {{ic|synclient -l}} to have a look at all the available options. Here are some OSX-like suggestions:<br />
<br />
* By default synaptics is configured to use a double-tap drag gesture found on older touchpads - one may argue that this is not necessary on a clickpad. {{ic|synclient TapAndDragGesture}} will turn this off.<br />
* TapButtonX and ClickFingerX sets the mouse button triggered by tapping or clicking with X fingers. set {{ic|1=TapButton2=3}} and {{ic|1=ClickFinger2=3}} to assign two-finger click to the right mouse button.<br />
* Setting the bottom-right corner click to right mouse button can be done by subtracting about 500 from {{ic|RightEdge}} and {{ic|BottomEdge}} and plugging the new values into {{ic|RightButtonAreaLeft}} and {{ic|RightButtonAreaTop}}. If the last two options are not visible, set {{ic|1=Clickpad=1}}.<br />
<br />
To make settings permanent, just modify {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}.<br />
<br />
{{note|Right/Middle ButtonArea options are only recognized once the X fully loads the driver. To work around this, create a script file {{ic|/usr/local/bin/synarea.sh}}, write the required synclient commands, and add the script to the X startup sequence.}}<br />
<br />
====Using Touchegg====<br />
[code.google.com/projects/touchegg Touchegg] is an application that can recognize additional gestures. To use this you'll need {{AUR|xf86-input-synaptics-mtpatch}}.</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253641MacBookPro9,x2013-04-10T16:58:17Z<p>Oboenerd: </p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent situation of running Arch on Macbook 9,x (Mid-2012) hardware. The original information written here dates from April 2013, installing kernel 3.8. You'll need a wired connection to complete the initial steps of this installation. This article is written in an attempt to cover the Macbook-specific information for both novices and veterans alike. For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
For now I assume a dual-booted install alongside OSX. Please feel free to contribute information regarding other setups.<br />
<br />
==Preparation==<br />
<br />
{{Warning | Remember to back up your data using a utility such as Time Machine before beginning!}}<br />
<br />
The following steps only apply if you wish to keep your OSX system.<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories, write down the UID and GID for the users in question.<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]]<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Since we're going to be using this for linux partitions, it's a good idea to just tell OSX to leave the new partition as free space.<br />
<br />
==Installation==<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
===Running the Arch Installation===<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
The following differences will apply to MacBooks:<br />
<br />
====Sample partition layout====<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 />
Single-boot setups can simply omit the OSX and Recovery partitions.<br />
<br />
====Install Bootloader====<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
==Post Installation==<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].<br />
<br />
===Users===<br />
If you wrote down your OSX uid's and gid's eariler, you can do the following:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access your user directory in OSX, we only need the id's to match.<br />
<br />
===Wireless===<br />
Macbooks 8,1 to 9,2 (and possibly newer) use BCM4331 for Wifi. Linux Kernel 3.3 has led to a loss of most of the functionality - however, as of March 2013 bleeding-edge patches are available that improve the situation significantly. You'll need to install base-devel if you don't already have it.<br />
<br />
$ curl -O https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5.tar.bz2<br />
$ tar xjf compat-drivers-2013-03-28-5.tar.bz2<br />
$ cd compat-drivers-2013-03-28-5<br />
<br />
$ scripts/driver-select b43<br />
$ make<br />
$ sudo make install<br />
<br />
Create {{ic|/etc/modules-load.d/b43.conf}} and simply write {{ic|b43}} to load wireless at startup.<br />
<br />
Then, install {{AUR|b43-firmware}} from AUR. From there on in, wifi configuration should proceed normally - once you've got it working you can disconnect your wired connection.<br />
<br />
{{note|You may want to have a wired connection handy in case wifi fails, since this is an unsupported bleeding-edge solution}}<br />
<br />
==Bells & Whistles==<br />
<TODO></div>Oboenerdhttps://wiki.archlinux.org/index.php?title=MacBookPro9,x&diff=253630MacBookPro9,x2013-04-10T16:29:51Z<p>Oboenerd: Initial edit - to be completed.</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Running Arch on Mid-2012 hardware}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary wiki|MacBookPro}}<br />
{{Article summary wiki|MacBook_Pro_7,1}}<br />
{{Article summary wiki|MacBook_Pro_8,1_/_8,2_/_8,3_(2011_Macbook_Pro)}}<br />
{{Article summary wiki|MacBook_Pro_9,2_(Mid-2012)}}<br />
{{Article summary end}}<br />
<br />
This guide outlines a more recent situation of running Arch on Macbook 9,x (Mid-2012) hardware. The original information written here dates from April 2013, installing kernel 3.8. You'll need a wired connection to complete the initial steps of this installation. This article is written in an attempt to cover the Macbook-specific information for both novices and veterans alike. For general help on the install preocedure see the [[Beginners' Guide]]<br />
<br />
For now I assume a dual-booted install alongside OSX. Please feel free to contribute information regarding other setups.<br />
<br />
=Preparation=<br />
<br />
{{Warning | Remember to back up your data using a utility such as Time Machine before beginning!}}<br />
<br />
==Preparing a Dual-boot with Mac OSX==<br />
The following steps only apply if you wish to keep your OSX system.<br />
<br />
===Recording UIDs===<br />
If you want to access your OSX user directories, write the UID and GID for the users in question.<br />
<br />
{{Warning | Never, ''ever'' change any file permissions in your OSX partition from Linux. Doing so can and will lead to serious repercussions.}}<br />
<br />
===Install Boot Manager===<br />
'''Optional.''' The easiest way to begin is by [http://www.rodsbooks.com/refind/ installing rEFInd] on Mac OSX before moving on to Arch. This will place a boot menu on startup. The config will be in your OSX partition - if this is not what you want simply install it later in Arch. For more information consult [[UEFI]]<br />
<br />
===Shrinking Macintosh HD===<br />
Boot Camp now requires a Windows installation disc before altering partitions, but it is possible to do this using Mac OSX's disk utility. Simply create a new partition, calculate the amount of free space required for all new partitions and shrink Macintosh HD to match this amount. Since we're going to be using this for linux partitions, it's a good idea to just tell OSX to leave the new partition as free space.<br />
<br />
===Preparing Installation Media===<br />
[https://archlinux.org/download/ Download Arch] and burn it to a USB, CD or DVD, and boot into the Arch install.<br />
<br />
=Installation=<br />
<br />
==Running the Arch Installation==<br />
Proceed from the Installation section in either [[Beginners' Guide/Installation]] or [[Installation Guide#Installation]]. Note that you'll need a wired connection to continue for now.<br />
<br />
===Sample partition layout===<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 />
Single-boot setups can simply omit the OSX and Recovery partitions.<br />
<br />
===Install Bootloader===<br />
Use [[GRUB2#UEFI_systems_2]] for more information.<br />
<br />
After setting up the base system, do the following in your chrooted environment:<br />
# pacman -S grub-efi-x86_64<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sda1 /boot/efi<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
<br />
=Post Installation=<br />
Continue with [[Beginners' Guide/Post-installation]] or [[Installation Guide#Post-installation]].<br />
<br />
==Users==<br />
If you wrote down your OSX uid's and gid's eariler, you can do the following:<br />
<br />
# useradd -m -u [uid] -g [gid] -G [additional_groups] -s [login_shell] [username]<br />
<br />
In order to be able to access your user directory in OSX, we only need the uid to match. Username can be whatever you like.<br />
<br />
==Wireless==<br />
TODO</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=GRUB&diff=253624GRUB2013-04-10T16:03:40Z<p>Oboenerd: /* Create and Mount the UEFI System Partition */ fix broken link</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of the next generation of the GRand Unified Bootloader (GRUB2).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
[https://www.gnu.org/software/grub/ GRUB2] is the next generation of the GRand Unified Bootloader (GRUB). GRUB2 is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to investigate the next generation of GRUB. GRUB2 has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
Here is some information that needs to be clarified:<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
<br />
* From 1.99-6 onwards, GRUB2 supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO.<br />
<br />
* For GRUB2 UEFI info, it is recommended to read the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages before reading this page.<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
* Upgrade from [[GRUB Legacy]] to GRUB2 is the much same as fresh installing GRUB2 which is covered [[#Installation|below]].<br />
<br />
* There are differences in the commands of GRUB and GRUB2. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB2 commands] before proceeding (e.g. "find" has been replaced with "search").<br />
<br />
* GRUB2 is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support).<br />
<br />
* Device naming has changed between GRUB and GRUB2. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT) using GRUB2.<br />
<br />
=== Preliminary Requirements for GRUB2 ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== [[GUID Partition Table]] (GPT) specific instructions =====<br />
GRUB2 in BIOS-GPT configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS Boot Partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB2 only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB2). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case. Syslinux does not require this partition.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|0xEF02}} in gdisk, {{ic|EF02}} in cgdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run.}}<br />
{{Note|gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible.}}<br />
<br />
===== [[Master Boot Record]] (MBR) specific instructions =====<br />
Usually the post-MBR gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB2's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
MBR partitioning has better support in other operating systems, such as Microsoft Windows (up to Windows 7) and Haiku, than GPT partitioning. If you dual boot another operating system, consider using MBR partitioning.<br />
<br />
A MBR disk may be convertible to GPT if there is a small amount of extra space available. See [[GUID Partition Table#Convert from MBR to GPT]]<br />
<br />
==== UEFI systems ====<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI SYSTEM PARTITION. Then mount the UEFI SYSTEM PARTITION at {{ic|/boot/efi}}. If you have mounted the UEFISYS partition in some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFISYS_PART_DEVICE> /boot/efi<br />
<br />
Create a <UEFI_SYSTEM_PARTITION>{{ic|/EFI}} directory, if it does not exist:<br />
<br />
# mkdir -p /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
==== Backup Important Data ====<br />
<br />
Although a GRUB(2) installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before installing {{Pkg|grub-bios}}.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path)<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
==== Install grub-bios package ====<br />
<br />
The GRUB(2) packages can be installed with pacman (and will replace {{Pkg|grub-legacy}} or {{Pkg|grub}}, if it is installed):<br />
<br />
# pacman -S grub-bios<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB(2) modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install grub-bios boot files ====<br />
<br />
There are 3 ways to install GRUB(2) boot files in BIOS booting:<br />
*[[#Install to GPT BIOS Boot Partition]] (recommended with [[GPT]])<br />
*[[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
*[[#Install to Partition or Partitionless Disk]] (not recommended)<br />
*[[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[grub-legacy]] or [[syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub-bios}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sda<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB2 on multiple physical disks.<br />
<br />
{{Note|{{ic|--no-floppy}} has been removed from {{ic|grub-install}} in 2.00~beta2 upstream release, and replaced with {{ic|--allow-floppy}}.}}<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic| boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
===== Install to GPT BIOS Boot Partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition (0xEF02) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{Keypress|0xEF02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (stored on disk as {{ic|"Hah!IdontNeedEFI"}} if interpreted as ASCII).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub-bios}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
===== Install to Partition or Partitionless Disk =====<br />
<br />
{{Note|{{ic|grub-bios}} (any version - including upstream Bazaar repo) does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up {{ic|grub-bios}} to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub-bios}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub-bios}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub-bios}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
You can then chainload GRUB2's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate GRUB2 BIOS Config file ====<br />
<br />
Finally, generate a configuration for GRUB2 (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If grub(2) complains about "no suitable mode found" while booting, go to [[#Correct GRUB2 No Suitable Mode Found Error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB2 {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB2 Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB2 {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot in BIOS ====<br />
<br />
===== Boot Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB(2) supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|Take note that it is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See http://en.wikipedia.org/wiki/System_partition_and_boot_partition for more info.}}<br />
<br />
Find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|{{ic|grub-probe}} should be run as root.}}<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|ntldr}} in the above commands.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
<pre><br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}</pre><br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where nn defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note| nn should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is recommended to read the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages before reading this part.}}<br />
<br />
==== Hardware-Specific UEFI Examples ====<br />
<br />
It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.<br />
<br />
==== Install grub-uefi package ====<br />
<br />
{{Note|Unless specified as EFI 1.x , EFI and UEFI terms are used interchangeably to denote UEFI 2.x firmware. Also unless stated explicitly, the instructions are general and not Mac specific. Some of them may not work or may be different in Macs. Apple's EFI implementation is neither a EFI 1.x version nor UEFI 2.x version but mixes up both. This kind of firmware does not fall under any one UEFI Specification version and is therefore not a standard UEFI firmware.}}<br />
<br />
GRUB(2) UEFI bootloader is available in Arch Linux only from version 1.99~rc1. To install, first [[Unified Extensible Firmware Interface#Detecting UEFI Firmware Arch|detect which UEFI firmware arch]] you have (either x86_64 or i386).<br />
<br />
Depending on that, install the appropriate package<br />
<br />
For 64-bit aka x86_64 UEFI firmware:<br />
# pacman -S grub-efi-x86_64<br />
<br />
For 32-bit aka i386 UEFI firmware:<br />
# pacman -S grub-efi-i386<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB(2) modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install grub-uefi boot files ====<br />
<br />
===== Install to UEFI System Partition =====<br />
<br />
{{Note|The below commands assume you are using {{ic|grub-efi-x86_64}} (for {{ic|grub-efi-i386}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands).}}<br />
<br />
{{Note|To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors.}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB(2) install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware grub(2) is being installed. In such cases grub-install will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install grub(2) modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the grub(2) uefi files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
# mkdir -p /boot/efi/EFI/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated.}}<br />
<br />
{{Note|The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB(2) UEFI.}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB(2) for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate GRUB2 UEFI Config file]] and [[#Create GRUB2 entry in the Firmware Boot Manager]].<br />
<br />
==== Generate GRUB2 UEFI Config file ====<br />
<br />
Finally, generate a configuration for GRUB(2) (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB2 complains about "no suitable mode found" while booting, try [[#Correct GRUB2 No Suitable Mode Found Error]].<br />
<br />
==== Create GRUB2 entry in the Firmware Boot Manager ====<br />
<br />
As of grub-efi-x86_64 version 2.00, {{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB2 Standalone UEFI Application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the uefi application, thus removing the need for having a separate directory populated with all the GRUB2 uefi modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub-common}} >= 1:1.99-6 package.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB2 entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot in UEFI ====<br />
<br />
===== Chainload Microsoft Windows x86_64 UEFI-GPT =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
{{Note|{{ic|grub-probe}} should be run as root.}}<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|For EFI systems, if GRUB2 was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in the BIOS version of GRUB2.}}<br />
<br />
{{Note|Here is a quite complete description of how to configure GRUB2: http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html }}<br />
<br />
=== Automatically generating using grub-mkconfig (Recommended) ===<br />
<br />
The GRUB2 {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc<br />
|/boot/grub/grub.cfg<br />
|<nowiki><br />
# Config file for GRUB2 - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
#set root=(hd0,3)<br />
#chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB2 to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root=(hd0,3)<br />
chainloader (hd0,3)+1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB2 menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
===Visual Configuration===<br />
<br />
In GRUB2 it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB2 graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB2. This can be seen in the section [[#Correct_GRUB2_No_Suitable_Mode_Found_Error]]. This video mode is passed by GRUB2 to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
====Setting the framebuffer resolution ====<br />
<br />
GRUB2 can set the framebuffer for both GRUB2 itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen.}}<br />
{{Note|To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB2 prompt you can use the {{ic|1=vbeinfo}} command.}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
====915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
In the following I will proceed with the example for my system. Please adjust the recipe for your needs. First you need to find a video mode which will be modified later. For that, run {{ic|915resolution}} in GRUB2 command shell:<br />
915resolution -l<br />
The output will be something like:<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
...<br />
Mode 30 : 640x480, 8 bits/pixel<br />
...<br />
Next, our purpose is to overwrite mode 30. (You can choose what ever mode you want.) In the file {{ic|/etc/grub.d/00_header}} just before the {{ic|set gfxmode&#61;${GRUB_GFXMODE}}} line insert:<br />
915resolution 30 1440 900<br />
Here we are overwriting the mode {{ic|30}} with {{ic|1440x900}} resolution. Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB2 configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
====Background image and bitmap fonts====<br />
<br />
GRUB2 comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub-common}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct.<br />
* The image is of the proper size and format (tga, png, 8-bit jpg).<br />
* The image was saved in the RGB mode, and is not indexed.<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}.<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file.<br />
<br />
====Theme====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB2 package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
====Menu colors====<br />
<br />
You can set the menu colors in GRUB2. The available colors for GRUB2 can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
====Hidden menu====<br />
<br />
One of the unique features of GRUB2 is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
====Disable framebuffer====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB2's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB2 provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB2. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in /etc/default/grub:<br />
<br />
{{bc|1=# GRUB_DISABLE_LINUX_UUID=true}}<br />
<br />
Either way, do not forget to generate the changes:<br />
{{bc|# grub-mkconfig -o /boot/grub/grub.cfg}}<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB2 can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the setting of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, eg Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} , will need {{ic|savedefault}} added. Remember to regenerate your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB2 so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB2's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it. The output will look like this:<br />
<br />
{{bc|<nowiki><br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A</nowiki>}}Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{bc|<nowiki>cat << EOF<br />
<br />
set superusers="username"<br />
password_pbkdf2 username <password><br />
<br />
EOF</nowiki>}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB2 command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root Encryption ====<br />
<br />
To let GRUB2 automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB2 loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB2 returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB2 menu is not necessary.<br />
<br />
=== Booting an ISO Directly From GRUB2 ===<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in ALL of the lines below to match their systems. However, if booting the ISO from USB on a computer which also has one internal HDD, then it needs to be {{ic|hd0,Y}} with {{ic|sdbY}}, instead of {{ic|sdaY}}.}}<br />
<br />
'''Example using x86_64'''<br />
menuentry "Archlinux-2013.01.04-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.01.04-dual.iso"<br />
loopback loop (hd0,6)$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201301 img_dev=/dev/sda6 img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
'''Example using i686'''<br />
menuentry "Archlinux-2013.01.04-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.01.04-dual.iso"<br />
loopback loop (hd0,6)$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201301 img_dev=/dev/sda6 img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
{{Tip|For thumbdrives, use [[Persistent_block_device_naming|Persistent block device names]] for the "img_dev" kernel parameter. '''Ex:''' img_dev&#61;/dev/disk/by-label/CORSAIR}}<br />
<br />
==== Ubuntu ISO ====<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB2 modules, only the menu and a few basic commands reside there. The majority of GRUB2 functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB2 may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB2 offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB2 supports pager for reading commands that provide long output (like the help command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB2 command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed from [[AUR]]<br />
* {{aur|grub-customizer}} (requires gettext gksu gtkmm hicolor-icon-theme openssl)<br />
*:Customize the bootloader (GRUB2 or BURG)<br />
* {{aur|grub2-editor}} (requires kdelibs)<br />
*:A KDE4 control module for configuring the GRUB2 bootloader<br />
* {{aur|kcm-grub2}} (requires kdelibs python2-qt kdebindings-python)<br />
*:This Kcm module manages the most common settings of Grub2.<br />
* {{aur|startupmanager}} (requires gnome-python imagemagick yelp python2 xorg-xrandr)<br />
*:GUI app for changing the settings of GRUB, GRUB2, Usplash and Splashy<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden C:\ disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third C:\ disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB2.<br />
<br />
to reinstall GRUB2 and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
Any troubleshooting should be added here.<br />
<br />
=== Enable GRUB2 debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== Correct GRUB2 No Suitable Mode Found Error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB2 graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB2. This video mode is passed by GRUB2 to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB2 video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB2_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB2 UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB2_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB2_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB2 to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB2_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB2 in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== UEFI GRUB2 drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB2 UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== UEFI GRUB2 not loaded ===<br />
In some cases the EFI may fail to load GRUB correctly. Provided everything is set up correctly, the output of:<br />
efibootmgr -v<br />
might look something like this:<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
If everything works correctly, the EFI would now automatically load GRUB.<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
If booting gets stuck without any error message after grub2 loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
== References ==<br />
<br />
# Official GRUB2 Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB2 - https://help.ubuntu.com/community/Grub2<br />
# GRUB2 wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== External Links ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB(2) for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB(2) for UEFI from BZR Source]</div>Oboenerdhttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=253621Beginners' guide2013-04-10T15:35:02Z<p>Oboenerd: /* Example */ fix broken link</p>
<hr />
<div><noinclude><br />
[[Category:Getting and installing Arch]]<br />
[[Category:About Arch]]<br />
[[da:Beginners' Guide/Installation]]<br />
[[es:Beginners' Guide/Installation]]<br />
[[hr:Beginners' Guide/Installation]]<br />
[[hu:Beginners' Guide/Installation]]<br />
[[it:Beginners' Guide/Installation]]<br />
[[ja:Beginners' Guide/Installation]]<br />
[[ko:Beginners' Guide/Installation]]<br />
[[nl:Beginners' Guide/Installatie]]<br />
[[pl:Beginners' Guide/Installation]]<br />
[[pt:Beginners' Guide/Installation]]<br />
[[ro:Ghidul începătorilor/Instalare]]<br />
[[ru:Beginners' Guide/Installation]]<br />
[[sr:Beginners' Guide/Installation]]<br />
[[zh-CN:Beginners' Guide/Installation]]<br />
[[zh-TW:Beginners' Guide/Installation]]<br />
{{Tip|This is part of a multi-page article for The Beginners' Guide. '''[[Beginners' Guide|Click here]]''' if you would rather read the guide in its entirety.}}<br />
</noinclude><br />
== Installation ==<br />
<br />
You are now presented with a shell prompt, automatically logged in as root.<br />
<br />
=== Change the language ===<br />
<br />
{{Tip|These are optional for the majority of users. Useful only if you plan on writing in your own language in any of the configuration files, if you use diacritical marks in the Wi-Fi password, or if you would like to receive system messages (e.g. possible errors) in your own language.}}<br />
<br />
By default, the keyboard layout is set to {{ic|us}}. If you have a non-[[Wikipedia:File:KB United States-NoAltGr.svg|US]] keyboard layout, run:<br />
<br />
# loadkeys ''layout''<br />
<br />
...where ''layout'' can be {{ic|fr}}, {{ic|uk}}, {{ic|be-latin1}}, etc. See [[KEYMAP#Keyboard layouts|here]] for a comprehensive list.<br />
<br />
The font should also be changed, because most languages use more glyphs than the 26 letter [[Wikipedia:English alphabet|English alphabet]]. Otherwise some foreign characters may show up as white squares or as other symbols. Note that the name is case-sensitive, so please type it ''exactly'' as you see it:<br />
<br />
# setfont Lat2-Terminus16<br />
<br />
By default, the language is set to English (US). If you would like to change the language for the install process ''(German, in this example)'', remove the {{ic|#}} in front of the [http://www.greendesktiny.com/support/knowledgebase_detail.php?ref=EUH-483 locale] you want from {{ic|/etc/locale.gen}}, along with English (US). Please choose the {{ic|UTF-8}} entry.<br />
<br />
Use {{Keypress|Ctrl+X}} to exit, and when prompted to save changes, press {{Keypress|Y}} and {{Keypress|Enter}} to use the same filename.<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
de_DE.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
# export LANG=de_DE.UTF-8<br />
<br />
Remember, {{Keypress|LAlt+LShift}} activates and deactivates the keymap.<br />
<br />
=== Establish an internet connection ===<br />
<br />
{{Warning|udev no longer assigns network interface names according to the wlanX and ethX naming scheme. If you're coming from a different distribution or are reinstalling Arch and not aware of the new interface naming style, please do not assume that your wireless interface is named wlan0, or that your wired interface is named eth0. You can use the command {{ic|ip addr show}} to discover the names of your interfaces.}}<br />
<br />
From systemd-197's release and onward, udev now assigns predictable, stable network interface names that deviate from the legacy incremental naming scheme (wlan0, wlan1, etc.). These interface names are guaranteed to be persistent across reboots, which solves the problem of the lack of predictability of network interface name assignment. For more information about why this was necessary, read http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames .<br />
<br />
The {{ic|dhcpcd}} network daemon is started automatically at boot and it will attempt to start a wired connection, if available. Try pinging a website to see if it was successful. And since Google is always on...<br />
<br />
{{hc|# ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms}}<br />
<br />
If you get a {{ic|ping: unknown host}} error, first check if there is any problem with your cable (or if you have enough wireless signal), otherwise you will need to set up the network manually, as explained below.<br />
<br />
Otherwise, move on to [[#Prepare the storage drive|Prepare the storage drive]].<br />
<br />
==== Wired ====<br />
<br />
Follow this procedure if you need to set up a wired connection via a static IP address.<br />
<br />
First, disable the dhcpcd service which was started automatically at boot:<br />
<br />
# systemctl stop dhcpcd.service<br />
<br />
Identify the name of your Ethernet interface.<br />
<br />
{{hc|# ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000<br />
link/ether 00:11:25:31:69:20 brd ff:ff:ff:ff:ff:ff<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000<br />
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
In this example, the Ethernet interface is {{ic|enp2s0f0}}. If you're unsure, your Ethernet interface is likely to start with the letter "e", and unlikely to be "lo" or start with the letter "w". You can also use {{ic|iwconfig}} and see which interfaces are not wireless:<br />
<br />
{{hc|# iwconfig|2=<br />
enp2s0f0 no wireless extensions.<br />
wlp3s0 IEEE 802.11bgn ESSID:"NETGEAR97"<br />
Mode:Managed Frequency:2.427 GHz Access Point: 2C:B0:5D:9C:72:BF<br />
Bit Rate=65 Mb/s Tx-Power=16 dBm<br />
Retry long limit:7 RTS thr:off Fragment thr:off<br />
Power Management:on<br />
Link Quality=61/70 Signal level=-49 dBm<br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:430 Missed beacon:0<br />
lo no wireless extensions.}}<br />
<br />
In this example, neither {{ic|enp2s0f0}} nor the loopback device have wireless extensions, meaning {{ic|enp2s0f0}} is our Ethernet interface.<br />
<br />
You also need to know these settings:<br />
<br />
* Static IP address.<br />
* Subnet mask.<br />
* Gateway's IP address.<br />
* Name servers' (DNS) IP addresses.<br />
* Domain name (unless you're on a local LAN, in which case you can make it up).<br />
<br />
Activate the connected Ethernet interface (e.g. {{ic|enp2s0f0}}):<br />
<br />
# ip link set enp2s0f0 up<br />
<br />
Add the address:<br />
<br />
# ip addr add ''ip_address''/''subnetmask'' dev ''interface_name''<br />
<br />
For example:<br />
<br />
# ip addr add 192.168.1.2/24 dev enp2s0f0<br />
<br />
For more options, run {{ic|man ip}}.<br />
<br />
Add your gateway like this, substituting your own gateway's IP address:<br />
<br />
# ip route add default via ''ip_address''<br />
<br />
For example:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
Edit {{ic|resolv.conf}}, substituting your name servers' IP addresses and your local domain name:<br />
<br />
{{hc|# nano /etc/resolv.conf|<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com}}<br />
<br />
{{Note|Currently, you may include a maximum of three {{ic|nameserver}} lines.}}<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Network Configuration]] page.<br />
<br />
==== Wireless ====<br />
<br />
Follow this procedure if you need wireless connectivity (Wi-Fi) during the installation process.<br />
<br />
First, identify the name of your wireless interface.<br />
<br />
{{hc|# iwconfig|2=<br />
enp2s0f0 no wireless extensions.<br />
wlp3s0 IEEE 802.11bgn ESSID:"NETGEAR97"<br />
Mode:Managed Frequency:2.427 GHz Access Point: 2C:B0:5D:9C:72:BF<br />
Bit Rate=65 Mb/s Tx-Power=16 dBm<br />
Retry long limit:7 RTS thr:off Fragment thr:off<br />
Power Management:on<br />
Link Quality=61/70 Signal level=-49 dBm<br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:430 Missed beacon:0<br />
lo no wireless extensions.}}<br />
<br />
In this example, {{ic|wlp3s0}} is the available wireless interface. If you're unsure, your wireless interface is likely to start with the letter "w", and unlikely to be "lo" or start with the letter "e". <br />
<br />
{{Note|If you do not see output similar to this, then your wireless driver has not been loaded. If this is the case, you must load the driver yourself. Please see [[Wireless Setup]] for more detailed information.}}<br />
<br />
Bring the interface up with:<br />
<br />
# ip link set wlp3s0 up<br />
<br />
A small percentage of wireless chipsets also require firmware, in addition to a corresponding driver. If the wireless chipset requires firmware, you are likely to receive this error when bringing the interface up:<br />
<br />
{{hc|# ip link set wlp3s0 up|<br />
SIOCSIFFLAGS: No such file or directory}}<br />
<br />
If unsure, invoke {{ic|dmesg}} to query the kernel log for a firmware request from the wireless chipset.<br />
<br />
Example output from an Intel chipset which requires and has requested firmware from the kernel at boot:<br />
<br />
{{hc|# dmesg <nowiki>|</nowiki> grep firmware|<br />
firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
If there is no output, it may be concluded that the system's wireless chipset does not require firmware.<br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment (on CD/USB stick) '''but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it!''' Package installation is covered later in this guide. Ensure installation of both your wireless module and firmware before rebooting! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset.}}<br />
<br />
Next, use {{Pkg|netcfg}}'s {{ic|wifi-menu}} to connect to a network:<br />
<br />
# wifi-menu wlp3s0<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Wireless Setup]] page.<br />
<br />
==== xDSL (PPPoE), analog modem or ISDN ====<br />
<br />
If you have a router in bridge mode, run:<br />
<br />
# pppoe-setup<br />
<br />
* Type in the username that the ISP provided you with.<br />
* Press {{Keypress|Enter}} for "eth0".<br />
* Press {{Keypress|Enter}} for "no", so that it stays up continuously.<br />
* Type {{ic|server}} (since this is usually the case).<br />
* Press {{Keypress|1}} for a firewall.<br />
* Type in the password that the ISP provided you with.<br />
* Press {{Keypress|Y}} at the end.<br />
<br />
To use these settings and connect to your ISP, run:<br />
<br />
# pppoe-start<br />
<br />
You may also need to adjust your {{ic|resolv.conf}}:<br />
<br />
# echo nameserver 8.8.8.8 > /etc/resolv.conf<br />
<br />
If you have a dial-up or ISDN connection, see [[Direct Modem Connection]].<br />
<br />
==== Behind a proxy server ====<br />
<br />
If you are behind a proxy server, you will need to export the {{ic|http_proxy}} and {{ic|ftp_proxy}} environment variables. See [[Proxy settings]] for more information.<br />
<br />
=== Prepare the storage drive ===<br />
<br />
{{Warning|Partitioning can destroy data. You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}<br />
<br />
Absolute beginners are encouraged to use a graphical partitioning tool. [http://gparted.sourceforge.net/download.php GParted] is a good example, and is [http://gparted.sourceforge.net/livecd.php provided as a "live" CD]. It is also included on live CDs of most Linux distributions such as [[Wikipedia:Ubuntu (operating system)|Ubuntu]] and [[Wikipedia:Linux Mint|Linux Mint]]. A drive should first be [[partitioning|partitioned]] and the partitions should be formatted with a [[File Systems|file system]] before rebooting.<br />
<br />
The recommendation for a system that will boot via UEFI rather than MBR legacy boot is to format the drive using a GPT partition table. This means that if the drive was previously already partitioned with an MBR (MSDOS) partition table it will now have a new partition table created which will destroy all other data on the drive. Once the new partition table has been created on a drive, only then can individual partitions be created with any chosen format type. When using Gparted, selecting the option to create a new partition table gives an "msdos" partition table by default. If you are intending to follow the advice to create a GPT partition table then you need to choose "Advanced" and then select "gpt" from the drop-down menu. This can't be done if you have a pre-existing Windows installation on the drive which you wish not to destroy. It is therefore extremely important to not change the partition table to GPT if you intend on having a dual boot system. Leave the Windows install untouched and try to get the Linux install working with UEFI on a drive that contains an MBR (legacy) partition table. <br />
<br />
In addition, some newer computers come pre-installed with Windows 8 which will be using Secure Boot. Arch Linux currently does not support Secure Boot, but some Windows 8 installations have been seen not to boot if Secure Boot is turned off in the BIOS. In some cases it is necessary to turn off both Secure Boot as well as Fastboot in the BIOS options in order to allow Windows 8 to boot without Secure Boot. However there are potential security risks in turning off Secure Boot for booting up Windows 8. Therefore, it may be a better option to keep the Windows 8 install intact and have an independent hard drive for the Linux install - which can then be partitioned from scratch using a GPT partition table. Once that is done, creating several ext4/FAT32/swap partitions on the second drive may be a better way forward if the computer has two drives available. This is often not easy or possible on a small laptop. Currently, Secure Boot is still not in a fully stable state for reliable operation, even for Linux distributions that support it.<br />
<br />
See [[Swap]] for details if you wish to set up a swap partition or swap file. A swap file is easier to resize than a partition and can be created at any point after installation, but cannot be used with a Btrfs filesystem.<br />
<br />
If you have already done so, proceed to [[#Mount the partitions|Mount the partitions]].<br />
<br />
Otherwise, see the following example.<br />
<br />
==== Example ====<br />
<br />
The Arch Linux install media includes the following partitioning tools: {{ic|fdisk}}, {{ic|gdisk}}, {{ic|cfdisk}}, {{ic|cgdisk}}, {{ic|parted}}.<br />
<br />
{{Box BLUE|Notes regarding [[UEFI]] boot:|<br />
* If you have a UEFI motherboard, you will need to create an extra [[Unified Extensible Firmware Interface#EFI_System_Partition|UEFI System Partition]].<br />
* It is recommended to always use GPT for UEFI boot, as some UEFI firmwares do not allow UEFI-MBR boot.}}<br />
<br />
{{Box BLUE|Notes regarding [[GPT]] partitioning:|<br />
* If you are not dual booting with Windows, then it is advisable to use GPT instead of MBR. Read [[GPT]] for a list of advantages.<br />
* If you have a BIOS motherboard (or plan on booting in BIOS compatibility mode) and you want to setup GRUB on a GPT-partitioned drive, you will need to create an extra [[GRUB2#GUID Partition Table (GPT) specific instructions|BIOS Boot Partition]]. Syslinux doesn't need one.<br />
* Some BIOS systems may have issues with GPT. See http://mjg59.dreamwidth.org/8035.html and http://rodsbooks.com/gdisk/bios.html for more info and possible workarounds.}}<br />
<br />
{{Note|If you are installing to a USB flash key, see [[Installing Arch Linux on a USB key]].}}<br />
<br />
The example system will contain a 15 GB root partition, and a [[Partitioning#/home|home]] partition for the remaining space. Choose either [[MBR]] or [[GPT]]. Do not choose both!<br />
<br />
It should be emphasized that partitioning is a personal choice and that this example is only for illustrative purposes. See [[Partitioning]].<br />
<br />
{| class="wikitable"<br />
|-<br />
| rowspan="2" | '''MBR'''<br />
| rowspan="2"| {{ic|cfdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for Primary – type in "15360" – {{Keypress|Enter}} for Beginning – {{Keypress|Enter}} for Bootable.<br />
|-<br />
|<br />
'''Home:'''<br />
<br />
* Press the down arrow to move to the free space area.<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for Primary – {{Keypress|Enter}} to use the rest of the drive (or you could type in the desired size).<br />
|-<br />
| rowspan="2" | '''GPT'''<br />
| rowspan="2"| {{ic|cgdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for the first sector (2048) – type in "15G" – {{Keypress|Enter}} for the default hex code (8300) – {{Keypress|Enter}} for a blank partition name.<br />
|-<br />
| '''Home:'''<br />
<br />
* Press the down arrow a couple of times to move to the larger free space area.<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for the first sector – {{Keypress|Enter}} to use the rest of the drive (or you could type in the desired size; for example "30G") – {{Keypress|Enter}} for the default hex code (8300) – {{Keypress|Enter}} for a blank partition name.<br />
|}<br />
<br />
If you chose MBR, here's how it should look like:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-----------------------------------------------------------------------<br />
sda1 Boot Primary Linux 15360<br />
sda2 Primary Linux 133000*<br />
<br />
If you chose GPT, here's how it should look like:<br />
<br />
Part. # Size Partition Type Partition Name<br />
----------------------------------------------------------------<br />
1007.0 KiB free space<br />
1 15.0 GiB Linux filesystem<br />
2 123.45 GiB Linux filesystem<br />
<br />
Double check and make sure that you are happy with the partition sizes as well as the partition table layout before continuing.<br />
<br />
If you would like to start over, you can simply select Quit (or press {{Keypress|Q}}) to exit without saving changes and then restart cfdisk (or cgdisk).<br />
<br />
If you are satisfied, choose Write (or press {{Keypress|Shift+W}}) to finalize and to write the partition table to the drive. Type "yes" and choose Quit (or press {{Keypress|Q}}) to exit without making any more changes.<br />
<br />
Simply partitioning is not enough; the partitions also need a [[File Systems|filesystem]]. To format the partitions with an ext4 filesystem:<br />
<br />
{{Warning|Double check and triple check that it's actually {{ic|/dev/sda1}} and {{ic|/dev/sda2}} that you want to format.}}<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda2<br />
<br />
If you have made a partition dedicated to swap (code 82), don't forget to format and activate it with:<br />
<br />
# mkswap /dev/sda''X''<br />
# swapon /dev/sda''X''<br />
<br />
=== Mount the partitions ===<br />
<br />
Each partition is identified with a number suffix. For example, {{ic|sda1}} specifies the first partition of the first drive, while {{ic|sda}} designates the entire drive.<br />
<br />
To display the current partition layout:<br />
<br />
# lsblk /dev/sda<br />
<br />
{{Note|Do not mount more than one partition to the same directory. And pay attention, because the mounting order is important.}}<br />
<br />
First, mount the root partition on {{ic|/mnt}}. Following the example when using {{ic|cfdisk}} above (yours may be different), it would be:<br />
<br />
# mount /dev/sda1 /mnt<br />
<br />
Then mount the home partition and any other separate partition ({{ic|/boot}}, {{ic|/var}}, etc), if you have any:<br />
<br />
# mkdir /mnt/home<br />
# mount /dev/sda2 /mnt/home<br />
<br />
In case you have a UEFI motherboard, mount the UEFI partition:<br />
<br />
# mkdir -p /mnt/boot/efi<br />
# mount /dev/sda''X'' /mnt/boot/efi<br />
<br />
=== Select a mirror ===<br />
<br />
Before installing, you may want to edit the {{ic|mirrorlist}} file and place your preferred mirror first. A copy of this file will be installed on your new system by {{ic|pacstrap}} as well, so it's worth getting it right.<br />
<br />
{{hc|# nano /etc/pacman.d/mirrorlist|<br />
##<br />
## Arch Linux repository mirrorlist<br />
## Sorted by mirror score from mirror status page<br />
## Generated on 2012-MM-DD<br />
##<br />
<br />
<nowiki>Server = http://mirror.example.xyz/archlinux/$repo/os/$arch</nowiki><br />
...}}<br />
<br />
* {{Keypress|Alt+6}} to copy a {{ic|Server}} line.<br />
* {{Keypress|PageUp}} key to scroll up.<br />
* {{Keypress|Ctrl+U}} to paste it at the top of the list.<br />
* {{Keypress|Ctrl+X}} to exit, and when prompted to save changes, press {{Keypress|Y}} and {{Keypress|Enter}} to use the same filename.<br />
<br />
If you want, you can make it the ''only'' mirror available by getting rid of everything else (using {{Keypress|Ctrl+K}}), but it's usually a good idea to have a few more, in case the first one goes offline.<br />
<br />
{{Tip|<br />
* Use the [https://www.archlinux.org/mirrorlist/ Mirrorlist Generator] to get an updated list for your country. HTTP mirrors are faster than FTP, because of something called [[Wikipedia:Keepalive|keepalive]]. With FTP, pacman has to send out a signal each time it downloads a package, resulting in a brief pause. For other ways to generate a mirror list, see [[Mirrors#Sorting mirrors|Sorting mirrors]] and [[Reflector]].<br />
* [https://archlinux.org/mirrors/status/ Arch Linux MirrorStatus] reports various aspects about the mirrors such as network problems with mirrors, data collection problems, the last time mirrors have been synced, etc.}}<br />
<br />
{{Note|<br />
* Whenever in the future you change your list of mirrors, always remember to force pacman to refresh all package lists with {{ic|pacman -Syy}}. This is considered to be good practice and will avoid possible headaches. See [[Mirrors]] for more information.<br />
* If you're using an older installation medium, your mirrorlist might be outdated, which might lead to problems when updating Arch Linux (see {{Bug|22510}}). Therefore it is advised to obtain the latest mirror information as described above.<br />
* Some issues have been reported in the [https://bbs.archlinux.org/ Arch Linux forums] regarding network problems that prevent pacman from updating/synchronizing repositories (see [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] and [https://bbs.archlinux.org/viewtopic.php?id&#61;65728]). When installing Arch Linux natively, these issues have been resolved by replacing the default pacman file downloader with an alternative (see [[Improve Pacman Performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using "Host interface" instead of "NAT" in the machine properties.}}<br />
<br />
=== Install the base system ===<br />
<br />
The base system is installed using the [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap] script.<br />
<br />
The {{ic|-i}} switch can be omitted if you wish to install every package from the ''base'' and ''base-devel'' groups without prompting.<br />
<br />
# pacstrap -i /mnt base base-devel<br />
<br />
{{Note|If pacman fails to verify your packages, check the system time with {{ic|cal}}. If the system date is invalid (e.g. it shows the year 2010), signing keys will be considered expired (or invalid), signature checks on packages will fail and installation will be interrupted. Make sure to correct the system time, either by doing so manually or with the {{Pkg|ntp}} client, and retry running the pacstrap command. Refer to [[Time]] page for more information on correcting system time.}}<br />
<br />
{{Note|If pacman complains that {{ic|error: failed to commit transaction (invalid or corrupted package)}}, run the following command:<br />
# pacman-key --init && pacman-key --populate archlinux<br />
}}<br />
<br />
* {{Grp|base}}: Software packages from the [core] repo to provide the minimal base environment.<br />
<br />
* {{Grp|base-devel}}: Extra tools from [core] such as {{ic|make}}, and {{ic|automake}}. Most beginners should choose to install it, as it will likely be needed to expand the system. The ''base-devel'' group will be required to install software from the [[Arch User Repository]].<br />
<br />
This will give you a basic Arch system. Other packages can be installed later using [[pacman]].<br />
<br />
=== Generate an fstab ===<br />
<br />
Generate an [[fstab]] file with the following command. UUIDs will be used because they have certain advantages (see [[fstab#Identifying filesystems]]). If you would prefer to use labels instead, replace the {{ic|-U}} option with {{ic|-L}}.<br />
<br />
# genfstab -U -p /mnt >> /mnt/etc/fstab<br />
# nano /mnt/etc/fstab<br />
<br />
{{Warning|The fstab file should always be checked after generating it. If you encounter errors running genfstab or later in the install process, do '''not''' run genfstab again; just edit the fstab file.}}<br />
<br />
A few considerations:<br />
<br />
* Only the root ({{ic|/}}) partition needs {{ic|1}} for the last field. Everything else should have either {{ic|2}} or {{ic|0}} (see [[fstab#Field definitions]]).<br />
<br />
=== Chroot and configure the base system ===<br />
<br />
Next, we [[chroot]] into our newly installed system:<br />
<br />
# arch-chroot /mnt<br />
<br />
{{Note|Use {{ic|arch-chroot /mnt /bin/bash}} to chroot into a bash shell.}}<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system. These can either be created if they do not exist, or edited if you wish to change the defaults.<br />
<br />
Closely following and understanding these steps is of key importance to ensure a properly configured system.<br />
<br />
==== Locale ====<br />
<br />
Locales are used by '''glibc''' and other locale-aware programs or libraries for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards.<br />
<br />
There are two files that need editing: {{ic|locale.gen}} and {{ic|locale.conf}}.<br />
<br />
* The {{ic|locale.gen}} file is empty by default (everything is commented out) and you need to remove the {{ic|#}} in front of the line(s) you want. You may uncomment more lines than just English (US), as long as you choose their {{ic|UTF-8}} encoding:<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
de_DE.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
<br />
This will run on every '''glibc''' upgrade, generating all the locales specified in {{ic|/etc/locale.gen}}.<br />
<br />
* The {{ic|locale.conf}} file doesn't exist by default. Setting only {{ic|LANG}} should be enough. It will act as the default value for all other variables.<br />
<br />
# echo LANG=en_US.UTF-8 > /etc/locale.conf<br />
# export LANG=en_US.UTF-8<br />
<br />
{{Note|If you set some other language than English (US) at the beginning of the install, the above commands would be something like:<br />
# echo LANG<nowiki>=</nowiki>de_DE.UTF-8 > /etc/locale.conf<br />
# export LANG<nowiki>=</nowiki>de_DE.UTF-8<br />
}}<br />
<br />
To use other locales for other {{ic|LC_*}} variables, run {{ic|locale}} to see the available options and add them to {{ic|locale.conf}}. It is not recommended to set the {{ic|LC_ALL}} variable. An advanced example can be found [[Locale#Setting_system-wide_locale|here]].<br />
<br />
==== Console font and keymap ====<br />
<br />
If you set a keymap at [[#Change_the_language|the beginning]] of the install process, load it now, as well, because the environment has changed. For example:<br />
<br />
# loadkeys ''de-latin1''<br />
# setfont Lat2-Terminus16<br />
<br />
To make them available after reboot, edit {{ic|vconsole.conf}}:<br />
<br />
{{hc|# nano /etc/vconsole.conf|2=<br />
KEYMAP=de-latin1<br />
FONT=Lat2-Terminus16<br />
}}<br />
<br />
* {{ic|KEYMAP}} – Please note that this setting is only valid for your TTYs, not any graphical window managers or Xorg.<br />
<br />
* {{ic|FONT}} – Available alternate console fonts reside in {{ic|/usr/share/kbd/consolefonts/}}. The default (blank) is safe, but some foreign characters may show up as white squares or as other symbols. It's recommended that you change it to {{ic|Lat2-Terminus16}}, because according to {{ic|/usr/share/kbd/consolefonts/README.Lat2-Terminus16}}, it claims to support "about 110 language sets".<br />
<br />
* Possible option {{ic|FONT_MAP}} – Defines the console map to load at boot. Read {{ic|man setfont}}. Removing it or leaving it blank is safe.<br />
<br />
See [[Fonts#Console_fonts|Console fonts]] and {{ic|man vconsole.conf}} for more information.<br />
<br />
==== Time zone ====<br />
<br />
Available time zones and subzones can be found in the {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} directories.<br />
<br />
To view the available <Zone>, check the directory {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Similarly, you can check the contents of directories belonging to a <SubZone>:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Create a symbolic link {{ic|/etc/localtime}} to your zone file {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} using this command:<br />
<br />
# ln -s /usr/share/zoneinfo/<Zone>/<SubZone> /etc/localtime<br />
<br />
'''Example:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime<br />
<br />
==== Hardware clock ====<br />
<br />
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.<br />
<br />
You can generate {{ic|/etc/adjtime}} automatically by using one of the following commands:<br />
<br />
* '''UTC''' (recommended)<br />
<br />
: {{Note|Using [[Wikipedia:Coordinated Universal Time|UTC]] for the hardware clock does not mean that software will display time in UTC.}}<br />
<br />
: {{bc|# hwclock --systohc --utc}}<br />
<br />
To synchronize your "UTC" time over the internet, see [[Network Time Protocol daemon|NTPd]].<br />
<br />
* '''localtime''' (discouraged; used by default in Windows)<br />
<br />
: {{Warning|Using ''localtime'' may lead to several known and unfixable bugs. However, there are no plans to drop support for ''localtime''.}}<br />
<br />
: {{bc|# hwclock --systohc --localtime}}<br />
<br />
If you have (or planning on having) a dual boot setup with Windows:<br />
<br />
* Recommended: Set both Arch Linux and Windows to use UTC. A quick [[Time#UTC in Windows|registry fix]] is needed. Also, be sure to prevent Windows from synchronizing the time on-line, because the hardware clock will default back to ''localtime''.<br />
<br />
* Not recommended: Set Arch Linux to ''localtime'' and disable any time-related services, like [[Network Time Protocol daemon|NTPd]] . This will let Windows take care of hardware clock corrections and you will need to remember to boot into Windows at least two times a year (in Spring and Autumn) when [[Wikipedia:Daylight saving time|DST]] kicks in. So please don't ask on the forums why the clock is one hour behind or ahead if you usually go for days or weeks without booting into Windows.<br />
<br />
==== Kernel modules ====<br />
<br />
{{Tip|This is just an example, you do not need to set it. All needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.}}<br />
<br />
For kernel modules to load during boot, place a {{ic|*.conf}} file in {{ic|/etc/modules-load.d/}}, with a name based on the program that uses them.<br />
<br />
{{hc|# nano /etc/modules-load.d/virtio-net.conf|<br />
# Load 'virtio-net.ko' at boot.<br />
<br />
virtio-net}}<br />
<br />
If there are more modules to load per {{ic|*.conf}}, the module names can be separated by newlines. A good example are the [[VirtualBox#Arch Linux guests|VirtualBox Guest Additions]].<br />
<br />
Empty lines and lines starting with {{ic|#}} or {{ic|;}} are ignored.<br />
<br />
==== Hostname ====<br />
<br />
Set the [[Wikipedia:hostname|hostname]] to your liking (e.g. ''arch''):<br />
<br />
# echo ''myhostname'' > /etc/hostname<br />
<br />
{{Note|There is no need to edit {{ic|/etc/hosts}}.}}<br />
<br />
=== Configure the network ===<br />
<br />
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described [[#Establish an internet connection|above]], except we are going to make it persistent and automatically run at boot.<br />
<br />
{{Note|For more in-depth information on network configration, visit [[Network Configuration]] and [[Wireless Setup]].}}<br />
<br />
==== Wired ====<br />
<br />
; Dynamic IP<br />
<br />
{{Warning|A bug has been noted in the install ISO, in which the name your interface has during installation differs from the one it will have upon reboot. See [https://bugs.archlinux.org/task/33923 Bug #33923] for more details.<br/><br />
<br />
Use the command {{ic|ip link}} (shows interface names) after rebooting into your installed system to find out if you are affected by this. If so, you will have to redo the configuration described below with the correct interface name.}}<br />
<br />
If you only use a single fixed wired network connection, you do not need a network management service and can simply enable the {{ic|dhcpcd}} service. Here, {{ic|''interface_name''}} is your wired interface:<br />
<br />
# systemctl enable dhcpcd@''interface_name''.service<br />
<br />
And that's it.<br />
<br />
Move on to the next step: [[Beginners%27_Guide/Installation#Create_an_initial_ramdisk_environment|Create an initial ramdisk environment]].<br />
<br />
Alternatively, you can use {{Pkg|netcfg}}'s {{ic|net-auto-wired}}, which gracefully handles dynamic connections to new networks:<br />
<br />
Install {{Pkg|ifplugd}}, which is required for {{ic|net-auto-wired}}:<br />
<br />
# pacman -S ifplugd<br />
<br />
Edit {{ic|/etc/conf.d/netcfg}} and modify the network interface name, most likely it is not eth0. You can find out more about the naming in the warning above.<br />
<br />
{{hc|# nano /etc/conf.d/netcfg|2=<br />
WIRED_INTERFACE="''interface_name''"}}<br />
<br />
Copy a sample profile from {{ic|/etc/network.d/examples}} to {{ic|/etc/network.d}}:<br />
<br />
# cd /etc/network.d<br />
# cp examples/ethernet-dhcp .<br />
<br />
Edit the profile as needed (modify {{ic|INTERFACE}}):<br />
<br />
# nano ethernet-dhcp<br />
<br />
Enable the {{ic|net-auto-wired}} service:<br />
<br />
# systemctl enable net-auto-wired.service<br />
<br />
; Static IP<br />
<br />
Copy a sample profile from {{ic|/etc/network.d/examples}} to {{ic|/etc/network.d}}:<br />
<br />
# cd /etc/network.d<br />
# cp examples/ethernet-static .<br />
<br />
Edit the profile as needed (modify {{ic|INTERFACE}}, {{ic|ADDR}}, {{ic|GATEWAY}} and {{ic|DNS}}):<br />
<br />
# nano ethernet-static<br />
<br />
Edit {{ic|/etc/conf.d/netcfg}} and add the new network profile to the {{ic|NETWORKS}} array:<br />
<br />
{{hc|nano /etc/conf.d/netcfg|2=<br />
NETWORKS=(ethernet-static)}}<br />
<br />
Enable the {{ic|netcfg}} service:<br />
<br />
# systemctl enable netcfg.service<br />
<br />
==== Wireless ====<br />
<br />
You will need to install additional programs to be able to configure and manage wireless network profiles for [[netcfg]].<br />
<br />
[[NetworkManager]] and [[Wicd]] are other popular alternatives.<br />
<br />
* Install the required packages:<br />
<br />
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog<br />
<br />
If your wireless adapter requires a firmware (as described in the above [[#Wireless|Establish an internet connection]] section and also [[Wireless Setup#Drivers and firmware|here]]), install the package containing your firmware. For example:<br />
<br />
# pacman -S zd1211-firmware<br />
<br />
See [[Wireless Setup]] and [[WPA supplicant]] for more info.<br />
<br />
* After finishing the rest of this installation and rebooting, you can connect to the network with {{ic|wifi-menu ''interface_name''}} (where {{ic|''interface_name''}} is the interface of your wireless chipset), which will generate a profile file in {{ic|/etc/network.d}} named after the SSID. There are also templates available in {{ic|/etc/network.d/examples/}} for manual configuration.<br />
<br />
# wifi-menu ''interface_name''<br />
<br />
{{Warning|If you're using {{ic|wifi-menu}}, this must be done *after* your reboot when you're no longer chrooted. The process spawned by this command will conflict with the one you have running outside of the chroot. Alternatively, you could just configure a network profile manually using the templates previously mentioned so that you don't have to worry about using {{ic|wifi-menu}} at all.}}<br />
<br />
* Enable the {{ic|net-auto-wireless}} service, which will connect to known networks and gracefully handle roaming and disconnects:<br />
<br />
# systemctl enable net-auto-wireless.service<br />
<br />
{{Note|From [[Netcfg#Net-Auto-Wireless]]: {{ic|wireless-wpa-config}} profiles do not work with {{ic|net-auto-wireless}}. Convert them to {{ic|wireless-wpa-configsection}} or {{ic|wireless-wpa}} instead.}}<br />
<br />
{{Note|[[Netcfg]] also provides {{ic|net-auto-wired}}, which can be used in conjunction with {{ic|net-auto-wireless}}.}}<br />
<br />
{{Note|Wpasupplicant could be fail with message "WPA Authentication/Association Failed". In that case, see this [https://bbs.archlinux.org/viewtopic.php?id&#61;155273 link] for a solution.}}<br />
<br />
* Make sure that the correct wireless interface (e.g. {{ic|wlp3s0}}) is set in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|# nano /etc/conf.d/netcfg|2=<br />
WIRELESS_INTERFACE="wlp3s0"}}<br />
<br />
It is also possible to define a list of network profiles that should be automatically connected, using the {{ic|AUTO_PROFILES}} variable in {{ic|/etc/conf.d/netcfg}}. If {{ic|AUTO_PROFILES}} is not set, all known wireless networks will be tried.<br />
<br />
==== xDSL (PPPoE), analog modem or ISDN ====<br />
<br />
For xDSL, dial-up and ISDN connections, see [[Direct Modem Connection]].<br />
<br />
=== Create an initial ramdisk environment ===<br />
<br />
{{Tip|Most users can skip this step and use the defaults provided in {{ic|mkinitcpio.conf}}. The initramfs image (from the {{ic|/boot}} folder) has already been generated based on this file when the {{Pkg|linux}} package (the Linux kernel) was installed earlier with {{ic|pacstrap}}.}}<br />
<br />
Here you need to set the right [[Mkinitcpio#HOOKS|hooks]] if the root is on a USB drive, if you use RAID, LVM, or if {{ic|/usr}} is on a separate partition.<br />
<br />
Edit {{ic|/etc/mkinitcpio.conf}} as needed and re-generate the initramfs image with:<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Note|Arch VPS installations on QEMU (e.g. when using {{ic|virt-manager}}) may need {{ic|virtio}} modules in {{ic|mkinitcpio.conf}} to be able to boot.<br />
<br />
{{hc|# nano /etc/mkinitcpio.conf|2=<br />
MODULES="virtio virtio_blk virtio_pci virtio_net"}}}}<br />
<br />
=== Set the root password ===<br />
<br />
Set the root password with:<br />
<br />
# passwd<br />
<br />
=== Install and configure a bootloader ===<br />
<br />
==== For BIOS motherboards ====<br />
<br />
For BIOS systems, there are three bootloaders - Syslinux, GRUB, and [[LILO]]. Choose the bootloader as per your convenience. Below only Syslinux and GRUB are explained.<br />
<br />
* Syslinux is (currently) limited to loading only files from the partition where it was installed. Its configuration file is considered to be easier to understand. An example configuration can be found [https://bbs.archlinux.org/viewtopic.php?pid=1109328#p1109328 here].<br />
<br />
* GRUB is more feature-rich and supports more complex scenarios. Its configuration file(s) is more similar to a scripting language, which may be difficult for beginners to manually write. It is recommended that they automatically generate one.<br />
<br />
{{Note|Some BIOS systems may have issues with GPT. See http://mjg59.dreamwidth.org/8035.html and http://rodsbooks.com/gdisk/bios.html for more info and possible workarounds.}}<br />
<br />
===== Syslinux =====<br />
<br />
Install the {{Pkg|syslinux}} package and then use the {{ic|syslinux-install_update}} script to automatically ''install'' the files ({{ic|-i}}), mark the partition ''active'' by setting the boot flag ({{ic|-a}}), and install the ''MBR'' boot code ({{ic|-m}}):<br />
<br />
{{Note|If you have partitioned the drive as GPT, install {{Pkg|gptfdisk}} package, as well ({{ic|pacman -S gptfdisk}}), because it contains {{ic|sgdisk}}, which will be used to set the GPT-specific boot flag.}}<br />
<br />
# pacman -S syslinux<br />
# syslinux-install_update -i -a -m<br />
<br />
Configure {{ic|syslinux.cfg}} to point to the right root partition. This step is vital. If it points to the wrong partition, Arch Linux will not boot. Change {{ic|/dev/sda3}} to reflect your root partition ''(if you partitioned your drive as in [[#Prepare the storage drive|the example]], your root partition is sda1)''. Do the same for the fallback entry.<br />
<br />
{{hc|# nano /boot/syslinux/syslinux.cfg|2=<br />
...<br />
LABEL arch<br />
...<br />
APPEND root=/dev/sda3 ro<br />
...}}<br />
<br />
For more information on configuring and using Syslinux, see [[Syslinux]].<br />
<br />
===== GRUB =====<br />
<br />
Install the {{Pkg|grub-bios}} package and then run {{ic|grub-install /dev/sda}}:<br />
<br />
{{Note|Change {{ic|/dev/sda}} to reflect the drive you installed Arch on. Do not append a partition number (do not use {{ic|sda''X''}}).}}<br />
<br />
{{Note|For GPT-partitioned drives on BIOS motherboards, GRUB needs a "[[GRUB2#GUID Partition Table (GPT) specific instructions|BIOS Boot Partition]]".}}<br />
<br />
# pacman -S grub-bios<br />
# grub-install --recheck /dev/sda<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
While using a manually created {{ic|grub.cfg}} is absolutely fine, it's recommended that beginners automatically generate one:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, install {{Pkg|os-prober}} ({{ic|pacman -S os-prober}}) before running the next command.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For more information on configuring and using GRUB, see [[GRUB2]].<br />
<br />
==== For UEFI motherboards ====<br />
<br />
For UEFI boot, the drive needs to be GPT-partitioned, and a UEFI System Partition (512 MiB or larger, type {{ic|EF00}}, formatted with FAT32) must be present and mounted on {{ic|/boot/efi}}. If you have followed this guide from the beginning, you've already done all of these.<br />
<br />
While there are other [[UEFI Bootloaders|UEFI bootloaders]] available, using EFISTUB is recommended. Below are instructions for setting up EFISTUB and GRUB (of course you choose only one of them).<br />
<br />
{{Note|Syslinux does not yet support UEFI.}}<br />
<br />
===== EFISTUB =====<br />
<br />
The Linux kernel can act as its own bootloader using EFISTUB. This is the UEFI boot method recommended by developers and simpler compared to {{ic|grub-efi-x86_64}}. The steps below set up rEFInd to provide a menu for EFISTUB kernels, as well as for booting other UEFI bootloaders. Alternative EFISTUB boot managers can be found on the page [[UEFI Bootloaders#Booting EFISTUB]]. Both rEFInd and [[gummiboot]] can detect Windows UEFI bootloaders in case of dual-boot.<br />
<br />
1a. Before chrooting, load the {{ic|efivars}} kernel module:<br />
<br />
# modprobe efivars # before chrooting<br />
<br />
1b. Mount the UEFI System Partition on {{ic|/mnt/boot/efi}} and chroot back into {{ic|/mnt}}.<br />
<br />
2. [[UEFI Bootloaders#Setting up EFISTUB|Copy the kernel and initramfs files]] to {{ic|/mnt/boot/efi}}:<br />
<br />
# mkdir -p /boot/efi/EFI/arch/<br />
# cp /boot/vmlinu'''z'''-linux /boot/efi/EFI/arch/vmlinuz-arch'''.efi'''<br />
# cp /boot/initramfs-linux.img /boot/efi/EFI/arch/initramfs-arch.img<br />
# cp /boot/initramfs-linux-fallback.img /boot/efi/EFI/arch/initramfs-arch-fallback.img<br />
<br />
Every time the kernel and initramfs files are updated in {{ic|/boot}}, they need to be updated in {{ic|/boot/efi/EFI/arch}}. This can be automated [[UEFI Bootloaders#Systemd|using systemd]].<br />
<br />
3. For the rEFInd boot manager, install {{Pkg|refind-efi}} and {{Pkg|efibootmgr}}:<br />
<br />
# pacman -S refind-efi efibootmgr<br />
<br />
4. Install rEFInd to the UEFI System Partition (summarized from [[UEFI Bootloaders#Using rEFInd]]):<br />
<br />
# mkdir -p /boot/efi/EFI/refind<br />
# cp /usr/lib/refind/refind_x64.efi /boot/efi/EFI/refind/refind_x64.efi<br />
# cp /usr/lib/refind/config/refind.conf /boot/efi/EFI/refind/refind.conf<br />
# cp -r /usr/share/refind/icons /boot/efi/EFI/refind/icons<br />
<br />
5. Create a {{ic|refind_linux.conf}} file with the kernel parameters to be used by rEFInd:<br />
<br />
{{hc|# nano /boot/efi/EFI/arch/refind_linux.conf|2=<br />
"Boot to X" "root=/dev/sdaX ro rootfstype=ext4 systemd.unit=graphical.target"<br />
"Boot to console" "root=/dev/sdaX ro rootfstype=ext4 systemd.unit=multi-user.target"}}<br />
<br />
{{Note|{{ic|refind_linux.conf}} is copied in the directory {{ic|/boot/efi/EFI/arch/}} where the initramfs and the kernel have been copied to in step 2.}}<br />
{{Note|In {{ic|refind_linux.conf}}, sdaX refers to your root file system, not your boot partition, if you created them separately.}}<br />
<br />
6. Add rEFInd to UEFI boot menu using [[UEFI#efibootmgr|efibootmgr]]. Replace X and Y with the drive and partition of the UEFI System Partition. For example, in {{ic|/dev/sdc5}}, X is "c" and Y is "5".<br />
<br />
{{Warning|Using {{ic|efibootmgr}} on Apple Macs may brick the firmware and may need reflash of the motherboard ROM. For Macs, use {{AUR|mactel-boot}}, or "bless" from within OS X.}}<br />
<br />
# efibootmgr -c -g -d /dev/sdX -p Y -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi'<br />
<br />
{{Note|On some systems, the above command will not work properly. It will execute without any visible error, but the UEFI boot menu will not have been correctly updated with a new entry. To determine whether the command executed properly, run {{ic|efibootmgr}} without any arguments and see if a new entry has appeared in the list displayed. If there is no new entry, then it will not be possible to enter rEFInd upon reboot, as the UEFI boot menu has been left unchanged. In this case, you will instead have to enter the UEFI shell and manually add an entry to the UEFI boot menu with the {{ic|bcfg}} command, as described [[Unified Extensible Firmware Interface#bcfg|here]].}}<br />
<br />
===== GRUB =====<br />
<br />
{{Note|In case you have a system with 32-bit EFI, like pre-2008 Apple Macs, install {{ic|grub-efi-i386}} instead of {{ic|grub-efi-x86_64}}.}}<br />
<br />
# pacman -S grub-efi-x86_64 efibootmgr<br />
# grub-install --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Next, while using a manually created {{ic|grub.cfg}} is absolutely fine, it's recommended that beginners automatically generate one:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, install {{Pkg|os-prober}} ({{ic|pacman -S os-prober}}) before running the next command.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|{{ic|grub-install}} should create a new entry in the UEFI boot menu. If it doesn't, you will instead have to enter the UEFI shell and manually add an entry to the UEFI boot menu with the {{ic|bcfg}} command, as described [[Unified Extensible Firmware Interface#bcfg|here]].}}<br />
<br />
For more information on configuring and using GRUB, see [[GRUB]].<br />
<br />
=== Unmount the partitions and reboot ===<br />
<br />
Exit from the chroot environment:<br />
<br />
# exit<br />
<br />
Since the partitions are mounted under {{ic|/mnt}}, we use the following command to unmount them:<br />
<br />
# umount /mnt/{boot,home,}<br />
<br />
Reboot the computer:<br />
<br />
# reboot<br />
<br />
{{Tip|Be sure to remove the installation media, otherwise you will boot back into it.}}<noinclude><br />
{{Beginners' Guide navigation}}</noinclude></div>Oboenerdhttps://wiki.archlinux.org/index.php?title=User:Oboenerd&diff=253614User:Oboenerd2013-04-10T14:37:29Z<p>Oboenerd: Created page with "===ME=== Musician, Ex-programmer, Canadian."</p>
<hr />
<div>===ME===<br />
<br />
Musician, Ex-programmer, Canadian.</div>Oboenerd