sylvain durand

Arch Linux on Macbook Pro late 2013

Arch Linux is a distribution whose installation procedure may seem demanding, but which in return offers complete control over what is installed, but above all allows you to experiment with and understand many of the basic elements of how a Linux system works.

This article details the specific steps that allow me to get a minimum functional installation on a 13" MacBook Pro, late 2013 (11.x). This one is characterized by a few specificities, notably a recalcitrant Broadcom wifi card.

It is strictly discouraged to follow these commands blindly, because Arch Linux is a distribution that is very regularly updated and because each system is different.

Start by opening and following the Installation guide and the Macbook Pro 11.x page on the Arch Linux Wiki, which are very detailed. This article can serve as a complement of the intallation guide.

Activating Wifi during the installation process

This is the most blocking part compared to the usual computers. The MacBook Pro for late 2013 usually comes with a Broadcom wifi card, which is known to be difficult to use with regular drivers.

The purpose of this part is only to have a network connection to do the installation, we are not yet configuring the wifi for our final system. If your system is already installed and you want to have a working wifi, you can go further down on this page.

To check which card is on board, use the command:

lspci -k

In my case, the lines concerned are as follows:

Network controller: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter (rev 03)
Subsystem: Apple Inc. BCM3460 802.11ac Wireless Network AdapterKernel driver in use: bcma-pci-bridge
Kernel modules: bcma, wl

If the iw dev command doesn’t return anything, it is because the driver (broadcom-wl in our case), although present in the installer, is not loaded. We start by disabling the concurrent modules, which could be run:

rmmod b43 bcma ssb wl

Then, we activate:

modprobe wl

If all goes well, iw dev now displays something:

phy#1
    Interface wlan0
        ifindexwdev 0x100000001
        addr 00:00:00:00:00:00
        type managedtxpower 200.00 dBm

You can then activate the connection and then scan the surrounding networks (if the interface has, in the result of the previous command, a name other than wlan0, you have to adapt it):

ifconfig wlan0 up
iwlist wlan0 scan

If you can’t connect, you can still use a small USB wifi adapter to continue the installation, or use the “modem” mode of your Android phone.

To connect to the wifi, use the command (where ssid and password are respectively the name and password of your access point):

wpa_supplicant -B -i wlan0 -c <(wpa_passphrase "ssid" "password")

Be careful not to put a space between the < and the (, to avoid getting the error zsh: number expected. Also, depending on the situation, it may not work on some channels in the 5 GHz band. In this case, the simplest way is to reconfigure your wifi on the 2.4 GHz band.

We get an IP address with the following command (which should display a succession of communications):

dhcpcd

If you get the message no interface have a carrier, you can try running dhcpcd --release and then dhcpcd again.

We’re checking that we’re connected with:

ping archlinux.org

Installing Wifi for the first launch

We still have to install our driver on our system to have a network connection on reboot. Let’s start by retrieving the tools to be able to connect, while arch-chroot:

pacman -Syu networkmanager

It will allow us, after the reboot, to simply connect with nmtui.

With a Broadcom BCM4360 (rev 03) card, we will install the broadcom-wl package in its DKMS version. This will allow it to be upgraded along with the Linux kernels.

pacman -Syu linux-headers broadcom-wl-dkms

Red light in the jack audio output

I had a lot of trouble to get rid of the red light in the jack output. I manage to do it with:

sudo pacman -S alsa-utils
sudo hda-verb /dev/snd/hwC1D0 0x21 SET_PIN_WID 0x00