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
- 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.
You'll need an existing arch install to do this
- 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)
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.
- 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.
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.
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
See MCMrARM's gist here: https://gist.github.com/MCMrARM/c357291e4e5c18894bea10665dcebffb
Create the three files and reboot.
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
Works out of the box with a compatible adapter