Hardware Prerequisites
You'll need at least the following hardware:
- At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
- A USB drive
- A USB keyboard
- USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
General notes:
- I strongly recommend against deleting OSX entirely even if you'll never use it, it is required for locating the WiFi firmware during install and can be valuable for determining which hardware you have.
Build archiso with a custom kernel
You'll need an existing arch install to do this
Or download mine from here
- Firstly grab a copy of the archiso script as instructed here:
https://wiki.archlinux.org/index.php/Archiso
cp -r /usr/share/archiso/configs/releng/ archlive
cd archlive
- Add aunali1's repo to
pacman.conf
:
[mbp]
Server = https://packages.aunali1.com/archlinux/$repo/$arch
- Ignore the original kernel in
pacman.conf
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg = linux linux-headers
- Add the linux-mbp pakages to the end of packagesx86_64
...
wvdial
xl2tpd
linux-mbp
linux-mbp-headers
- Force the build script to use interactive mode for pacstrap:
sudo nano /usr/bin/mkarchiso
In this file press Ctrl+W type pacstrap and replace every pacstrap -C
with pacstrap -i -C
:
# Install desired packages to airootfs
_pacman ()
{
_msg_info "Installing packages to '${work_dir}/airootfs/'..."
if [[ "${quiet}" = "y" ]]; then
pacstrap -i -C "${pacman_conf}" -c -G -M "${work_dir}/airootfs" $* &> /dev/null
else
pacstrap -i -C "${pacman_conf}" -c -G -M "${work_dir}/airootfs" $*
fi
_msg_info "Packages installed successfully!"
}
Note: There is definitely a better way to accomplish this
- Build the iso:
sudo ./build.sh -v
Press Y to everything including skipping ignored packages (so the only kernel installed is linux-mbp) then write to your usb (where /dev/sdb is your usb) drive:
sudo dd if=out/archlinux*.iso of=/dev/sdb bs=1M
-
Boot your mac in recovery mode enable booting from USB: https://www.ninjastik.com/support/2018-macbook-pro-boot-from-usb/
-
Hold option while booting up and select your USB. (For some reason it didn't show at first for me and I had to unplug and re-plug the drive once the menu was on the screen)
Installation
You'll need to use a USB keyboard for the installation
-
Follow the Arch Install as normal: https://wiki.archlinux.org/index.php/Installation_guide You can resize the OSX partition, I'd already installed Windows in bootcamp which did this for me so I just wiped off windows and installed Linux on the partitions it created.
-
Mount the existing apple EFI partition (/dev/nvme0n1p1) to
/boot
(if you haven't run arch-chroot yet it will bemount /dev/nvme0n1p1 /mnt/boot
) -
After you've used
arch-chroot
to see the file system as you would post install, add aunali1's repo to/etc/pacman.conf
:
[mbp]
Server = https://packages.aunali1.com/archlinux/$repo/$arch
- Then install the kernel:
sudo pacman -S linux-mbp linux-mbp-headers
sudo mkinitcpio -p linux-mbp
- Use GRUB, (Systemd-boot crashed for me and forced me to hard reboot)
Install your DE and anything you want to use.
Keyboard/touchpad
- install yay:
sudo pacman -S git gcc make fakeroot binutils
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
- Install macbook12-spi-driver-dkms:
yay --editor=nano --editmenu -S macbook12-spi-driver-dkms
When it says PKGBUILDs to edit?
type A
to open nano (or substitute your favourite editor in the command above).
In the source(
line change the branch to mbp15, replace https://github.com/roadrunner2/macbook12-spi-driver.git#branch=touchbar-driver-hid-driver
with https://github.com/roadrunner2/macbook12-spi-driver.git#branch=mbp15
- Get MCMrArm's bridge driver and install it to extramodules:
git clone https://github.com/MCMrARM/mbp2018-bridge-drv.git
cd mbp2018-bridge-drv
make
cp bce.ko /usr/lib/modules/extramodules-mbp/bce.ko
you'll need to remember to rebuild the module every time you update the kernel), I'm looking for a way to automate this
- Have it load on boot:
sudo nano /etc/modules-load.d/bce.conf
Add the following:
bce
- Reboot, you can now disconnect your external keyboard and use the laptop's touchpad.
WiFi
Boot into OSX and run the following in terminal: ioreg -l | grep C-4364
It will show something like:
"RequestedFiles" = ({"Firmware"="C-4364__s-B2/kauai.trx","TxCap"="C-4364__s-B2/kauai-X3.txcb","Regulatory"="C-4364__s-B2/kauai-X3.clmb","NVRAM"="C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"})
| | | | "images" = {"C-4364__s-B2/kauai-X3.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__s-B2/kauai-X3.txcb"},"C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"},"C-4364__s-B2/kauai-X3.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B2/kauai-X3.clmb"},"C-4364__s-B2/kauai.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B2/kauai.trx"}}
It'll be different depending on your exact model.
There are three files to note down. A .trx (for me: C-4364__s-B2/kauai.trx
), a .clmb (for me: C-4364__s-B2/kauai-X3.clmb
and a .txt (for me: C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt
These refer to files on OSX in /usr/share/firmware/wifi
. Copy the trx, clmb and txt somewhere you can easily access them when you boot back into linux (e.g. your home directory if you want to mount the HSF partition in linux, a usb stick, etc)
Boot back into linux and place the files in the following locations:
- Copy the trx to
/lib/firmware/brcm/brcmfmac4364-pcie.bin
(e.g.sudo cp kauai.trx /lib/firmware/brcm/brcmfmac4364-pcie.bin
- The clmb to
/lib/firmware/brcm/brcmfmac4364-pcie.clm_blob
(e.g.sudo cp kauai-X3.clmb /lib/firmware/brcm/brcmfmac4364-pcie.clm_blob
) - The txt to something like
/lib/firmware/brcm/brcmfmac4364-pcie.Apple Inc.-MacBookPro15,1.txt
. You will need to replace 15,1 with your model number. (e.g.sudo cp P-kauai-X3_M-HRPN_V-u__m-7.5.txt /lib/firmware/brcm/brcmfmac4364-pcie.Apple Inc.-MacBookPro15,1.txt
)
Use networkmanager and iwd:
sudo pacman -S networkmanager iwd
sudo systemctl start NetworkManager.service
sudo systemctl enable NetworkManager.service
If you're on kde also install plasma-nm
Configure networkmanager to use iwd. Create /etc/NetworkManager/NetworkManager.conf
and add:
[device]
wifi.backend=iwd
Restart the NetworkManager service and you should have wifi working.
Touchbar
If you've installed the mbp15 branch of @roadrunner2's spi driver as outlined above you just need to load the modules:
modprobe apple-ib-tb
modprobe apple-ib-als
If you want the touchbar to display F* keys by default create /etc/modprobe.d/apple-tb.conf
and add
options apple-ib-tb fnmode=2
Audio
See MCMrARM's gist here: https://gist.github.com/MCMrARM/c357291e4e5c18894bea10665dcebffb
Create the three files and reboot.
Suspend
As of 20/09/2019 you have to choose between audio and suspend though this will likely change when MCMrARM updates the bridge driver.
- Install the suspend branch of the bce module:
git clone https://github.com/MCMrARM/mbp2018-bridge-drv.git
cd mbp2018-bridge-drv
git checkout suspend
make
cp bce.ko /usr/lib/modules/extramodules-mbp/bce.ko
modprobe bce
- Blacklist applesmc
/etc/modprobe.d/applesmc.conf
blacklist applesmc
-
Add
pcie_ports=compat
as a kernel parameter. Edit/etc/default/grub
and add it toGRUB_CMDLINE_LINUX_DEFAULT
e.g.GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet pcie_ports=compat"
then rungrub-mkconfig -o /boot/grub/grub.cfg
and reboot. -
Currently (20/09/2019) the touchbar driver crashes on resume and the thunderbolt driver causes suspend to take 30+ seconds and resume to take several minutes. This is fixed by automaitcally unloading the problematic modules on suspend and reloading them on resume.
Create /lib/systemd/system-sleep/rmmod.sh
and add:
#!/bin/sh
if [ "${1}" == "pre" ]; then
rmmod thunderbolt
rmmod apple_ib_tb
elif [ "${1}" == "post" ]; then
modprobe apple_ib_tb
modprobe thunderbolt
fi
and make the file executable:
sudo chmod +x /lib/systemd/system-sleep/rmmod.sh
DisplayPort over USB-C
Works out of the box with a compatible adapter
This comment has been minimized.
Hello. I have some troubles on macbookpro15,2.
1. Installation/bootloader:
Using arch-mbp.iso, Installed all required packages, including linux-mbp linux-mbp-headers. The main problem with GRUB and systemd-boot. When I tried to grub-install with efi to nvmen0n1p1 I always get kernel panic. The only option that worked for me a systemd-boot (with kernel panic as well but when I restarted i saw the possibility of launching distro).
MODULES=(ext4 bce)
Since I use lvm and luks in my system, a keyboard is needed at the stage of mounting the root partition with luks.
Ok, now keyboard work without Touch Bar.
Ioreg command returns:
"RequestedFiles" = ({"Firmware"="C-4364__s-B2/maui.trx","TxCap"="C-4364__s-B2/maui-X3.txcb","Regulatory"="C-4364__s-B2/maui-X3.clmb","NVRAM"="C-4364__s-B2/P-maui-X3_M-HRPN_V-m__m-7.7.txt"})
I took these files and according to the instructions placed in the desired folder.
Works only with iwctl.
UPDATED Now touchbar works!
Install macbook12-spi-driver-dkms:
git clone --branch mbp15 https://github.com/roadrunner2/macbook12-spi-driver.git
cd macbook12-spi-driver
make install
Add these lines to file: /etc/modules-load.d/apple.conf
industrialio_triggered_buffer
apple-ibridge
apple-ib-tb
apple-ib-als
reboot.
I get endless messages when calling dmesg -w:
[ 1357.225355] aaudio_pcm_pointer while not started
[ 1357.225358] aaudio_pcm_pointer while not started
[ 1357.225367] aaudio aaudio: Received timestamp update for dev=3a ts=13c00d72d84 seed=0
[ 1357.571800] aaudio aaudio: Received timestamp update for dev=3a ts=13c157e3d1d seed=0
[ 1357.918338] aaudio aaudio: Received timestamp update for dev=3a ts=13c2a256fd8 seed=0
And some errors when i try to open pavuucontrol mixer:
[ 1554.167998] aaudio: Backed up the buffer in 75388806ns [16640]
[ 1554.188094] aaudio: Started the audio device in 95484464ns
[ 1554.188110] aaudio_pcm_pointer while not started
[ 1554.188129] aaudio_pcm_pointer while not started
[ 1554.188461] aaudio_pcm_open
[ 1554.188530] aaudio_pcm_hw_params
[ 1554.188541] x86/PAT: pulseaudio:2668 map pfn RAM range req uncached-minus for [mem 0x79400000-0x79430fff], got write-back
[ 1554.190982] aaudio_pcm_trigger 1
[ 1554.192117] aaudio aaudio: Received timestamp update for dev=3a ts=169dcfa5542 seed=0
[ 1554.194244] aaudio: Started the audio device in 3254976ns
[ 1554.194292] aaudio_pcm_pointer while not started