Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)


This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on . And for Ubuntu users there's another tutorial focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - see the updated instructions below and make sure to update your clone of the roadrunner2/macbook12-spi-driver repo to get the latest drivers.

Summary Of Current State

What works

  • Booting (i.e Grub etc)
  • Recognizes disk on all models (older kernels may need patch for some models, though)
  • Keyboard, touchpad, and basic touchbar functionality
  • HiDPI detection
  • Accelerated video
  • Screen brightness control
  • Keyboard backlight
  • USB
  • Sensors (install lm_sensors package)
  • Camera
  • Bluetooth (with patched kernel)

What doesn't work

  • WiFi (technically it's there, but it's so bad as to be unusable)
  • Suspend/Resume
  • Audio (two cards show up, and intel driver is loaded, but no sound)


  • Thunderbolt
  • DisplayPort



If you want to keep your MacOS installation (generally a good idea if you can afford the disk space, because that's the only way to get/install firmware updates), then first boot into MacOS and resize the partition there, creating a new partition for the Linux installation. If you also want to have a Windows partition, see this comment below.

Warning: If you're not going to keep MacOS, either back up the EFI System Partition (and restore its contents to the new ESP after installation) or leave it intact (i.e. don't do a full disk install, but just use the space after the ESP). This partition (it's the first one) contains drivers/firmware/etc needed by Apple's EFI loader during boot, in particular to initialize the Touchbar.

Initial Installation

Since the internal keyboard and touchpad won't work until you have built and loaded the drivers, you'll need to plug in an external USB keyboard to do the initial setup and installation.


If you're booting a 4.11 or later kernel, no special params or patches are needed.

If you're booting a kernel < 4.11 and have a MacBookPro13,1, MacBookPro13,2, MacBookPro14,1 or MacBookPro14,2 (13inch models), which have the Apple NVMe controller, you'll need the kernel-nvme-controller.patch from this gist in order for the disk to be correctly recognized (MacBookPro13,3 uses a Samsung NVMe controller which is automatically detected correctly). Alternatively, instead of patching you can also do the following (for distros using something other than dracut to create the initrd you'll need to adjust the 2nd and 3rd lines appropriately):

echo 'install nvme /sbin/modprobe --ignore-install nvme $CMDLINE_OPTS; echo 106b 2003 > /sys/bus/pci/drivers/nvme/new_id' | sudo tee /etc/modprobe.d/nvme.conf
echo 'force_drivers+="nvme"' | sudo tee /etc/dracut.conf.d/disk.conf
sudo dracut --force --kver <kernel-version>

If you're booting a kernel < 4.10 then you'll need the following kernel param to boot properly: intremap=nosid. E.g.

sudo sed -i 's/\(GRUB_CMDLINE_LINUX=.*\)"/\1 intremap=nosid"/' /etc/default/grub
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Lastly, if you are booting a live CD or similar with a kernel < 4.9 then you will also need to add the nomodeset kernel parameter to your kernel line; you will then not have proper HiDPI detection or accelerated graphics.


For this we need the drivers from (a clone of which includes a preliminary touchbar driver and keyboard fixes). The following commands set this up.

First some extra packages:

sudo dnf install git kernel-devel dkms

Next we need to prepare for the modules to be included in the ramdisk (so they are loaded early during boot):

cat <<EOF | sudo tee /etc/dracut.conf.d/keyboard.conf
# load all drivers needed for the keyboard+touchpad
add_drivers+="applespi intel_lpss_pci spi_pxa2xx_platform appletb"

On distros using mkinitramfs instead of dracut you'll want to do the following instead:

cat <<EOF | sudo tee -a /etc/initramfs-tools/modules
# drivers for keyboard+touchpad

Now get and build the drivers:

git clone
pushd macbook12-spi-driver
git checkout touchbar-driver-hid-driver
sudo ln -s `pwd` /usr/src/applespi-0.1
sudo dkms install applespi/0.1

Next we need to set the proper dpi for the touchpad (download the 61-evdev-local.hwdb from this gist):

sudo cp ...the-downloaded-61-evdev-local.hwdb... /etc/udev/hwdb.d/61-evdev-local.hwdb

You can test the drivers by loading them and their dependencies:

sudo modprobe intel_lpss_pci spi_pxa2xx_platform applespi appletb

Finally, reboot to make sure it all works correctly:

sudo reboot

Screen Brightness Control

Screen brightness control works out of the box on MacBookPro13,1 and MacBookPro13,2, but requires a kernel patch on MacBookPro13,3 (see also The following will create and install the patched apple-gmux:

mkdir apple-gmux
pushd apple-gmux

curl -o apple-gmux.patch ''
curl -o apple-gmux.c ''

patch < apple-gmux.patch

echo -e '
obj-m += apple-gmux.o

\tmake -C /lib/modules/`uname -r`/build M=`pwd` modules
' > Makefile

mod=$(ls /lib/modules/`uname -r`/kernel/drivers/platform/x86/apple-gmux.ko*)
sudo mv $mod{,.orig}
sudo cp apple-gmux.ko /lib/modules/`uname -r`/kernel/drivers/platform/x86/
sudo depmod


sudo reboot


The touchpad defaults to using the bottom-left corner for right-clicks - to get 2-finger right click, install the Gnome tweak tool and change it in there.


The brcmfmac driver is automatically loaded. However, there are a number of issues with it, making it for all practical purposes unusable:

  • it only does 2.4GHz - no 5GHz channels are visible
  • it has an extremely low sensitivity - you must be within a few feet of the base station, and even at 5 feet distance it shows a weak signal.
  • it stops working after 10 or 15 or so minutes; turning WiFi off, waiting a several minutes, and then turning it back on generally gets it working again. Maybe a thermal issue?

Bug report:


The amdgpu driver works well and is automatically loaded on MacBookPro13,3. On the 13 inch models the use of the intel needs to be forced (see first comment below).


MacBookPro13,3/14,3: works out of the box on kernels 4.13 and later; on earlier kernels you need the following:

echo "options uvcvideo quirks=0x100" > /etc/modprobe.d/uvcvideo.conf

For MacBookPro[13,14],[12] you need the bcwc_pcie driver (mainline branch) - see also


As of kernel 4.16 bluetooth works out of the box; older kernels need patches - see and following discussion for details. But in short you'll need to:

  • Ensure your kernel is configured with CONFIG_BT_HCIUART_BCM=y
  • apply the patches from hci_bcm-4.13, hci_bcm-4.14, or hci_bcm-4.15, depending on whether you have a 4.13 or earlier, 4.14, or 4.15 kernel.
  • build and reboot
  • on 4.14 and earlier apply the service patch from the above comment and start the service as described there (not necessary on 4.15 and later).
# MacBook8,1 (2015), MacBook9,1 (2016), MacBook10,1 (2017)
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook8,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook9,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook10,1:*
# MacBookPro13,* (Late 2016), MacBookPro14,* (Mid 2017)
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,2:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,2:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,3:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,3:*
libinput:name:*Apple SPI Touchpad*:dmi:*
--- a/drivers/nvme/host/pci.c 2017-01-22 21:49:03.710949755 -0800
+++ b/drivers/nvme/host/pci.c 2017-01-22 21:49:23.490761505 -0800
@@ -2121,6 +2121,7 @@
{ 0, }
MODULE_DEVICE_TABLE(pci, nvme_id_table);

Dunedan commented Jan 24, 2017

Very good overview, especially as I basically did the same with a focus on the MacBookPro13,2:

Regarding the screen resolution issue: That appears to be a bug in the EDID data provided by the display. Happens on the 13,2 as well ( It could also be that the displays have a higher resolution as advertised, but as Xorg correctly probes the right resolution I suspect it being a bug.

Hardware accelerated graphics output is also no problem with the integrated intel graphics card on the MacBookPro13,2. I just had to force Xorg to pick the intel driver (with Debian). I did a quick try with 0ad and that runs really smooth with >50fps with highest graphical details and native screen resolution.
Settings the screen brightness works also out of the box with Debian. The UX isn't that nice, as there are no dedicated keys for doing it, as the Touch Bar isn't working yet and the integrated ambient light sensor isn't working either yet. But in KDE I can easily change it via the power management settings.

I have the problem from time to time that NVMe isn't properly working at boot and I have to restart to get it working. Do you have the same issue as well? I thought it could be related to the queue depth related workaround from which is in place for the MacBook8,1, but not yet for the MacBookPro13,x, but I haven't tried it out yet.

I also have no problem with the spurious events from the Touch Bar you mention, don't know why.


roadrunner2 commented Jan 24, 2017

No, so far I've not any issues with the disk at all - must be due to the different controller I guess.

Interesting about the intel graphics card: I don't see it at all on my system, for some reason. Here's where I looked:

$ dmesg | grep -i vga
[    0.620237] vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=none,locks=none
[    0.620239] vgaarb: loaded
[    0.620240] vgaarb: setting as boot device: PCI:0000:01:00.0
[    0.620240] vgaarb: bridge control possible 0000:01:00.0
[    1.077795] fb0: EFI VGA frame buffer device
[    1.627562] [drm:amdgpu_init [amdgpu]] *ERROR* VGACON disables amdgpu kernel modesetting.
[   11.912424] [drm:amdgpu_init [amdgpu]] *ERROR* VGACON disables amdgpu kernel modesetting.

$ lspci -nn | grep -i VGA
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 460] [1002:67ef] (rev ef)

How is it showing up on your system? Without a pci bus id, I don't know how I'd tell xorg to use the card.

Lastly, on my system the resolution (using the fbdev driver) shows up as:

$ xrandr 
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 3360 x 2100, current 3360 x 2100, maximum 3360 x 2100
default connected primary 3360x2100+0+0 0mm x 0mm
   3360x2100     90.00* 

$ xdpyinfo | grep -A4 ^screen
screen #0:
  dimensions:    3360x2100 pixels (889x556 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x25d

so wrong resolution and wrong physical size/dpi.

Dunedan commented Jan 25, 2017

Ok, I got the MacBookPro13,2 which only has the integrated Intel graphics and no additional AMD graphics. That it doesn't show up for you is probably related to that additional graphics chip. 😟

Regarding the wrong resolution with fbdev: I get the same if I boot with modesetting disabled. If I boot with modesetting enabled the screen becomes unreadable during boot, but Xorg starts properly and I get the correct resolution afterwards. If I then in addition force it to use the intel driver I get a pretty decent graphical experience.


roadrunner2 commented Jan 26, 2017

Well, your comment prompted me to test again, and it turns out that with the 4.9 kernel kms works 🎉 So thank you! And as you say, it then discovers the correct resolution, and even plymouth and gdm then properly detect HiDPI. I can then run both X and Wayland, and AFAICT graphics performance is good. I still don't see the Intel GPU, but at least the AMD one now works well.

tudorbarascu commented Jan 30, 2017

Hi and thanks for this nice walk-through. I got stuck at mv ...the-attached-dsdt.dsl.patch... dsdt.dsl.patch as I don't know where to get from ..the-attached-dsdt.dsl.patch..

Thank you!

I just noticed I had to "Download zip" on the upper right of this page.

bubuntux commented Feb 26, 2017

i'm not able to make it work on Arch

i'm using mkinitcpio instead of Initramfs, so not sure where or how to add the keyboard.conf

i already tried including it into file /etc/mkinitcpio.conf

and regenerating the img
mkinitcpio -p linux

but didn't work

I was able to get my MacBook Pro 13,3 working with these instructions. Unfortunately, the wireless card is still flakey. It sees it but when I try to attach to the SSID, it just drops me.


roadrunner2 commented Mar 4, 2017

@bubuntux Sorry for the late reply. I don't know Arch, but some searching indicates you need to do the following:

  • See Arch's DSDT page on how to use the modified dsdt (the first option looks best - note that there's no ssdt1.aml to copy here, just the dsdt.aml)
  • For the loading of the additional modules, add applespi intel_lpss_pci spi_pxa2xx_platform appletb to the MODULES in /etc/mkinitcpio.conf.

mhkabir commented Mar 11, 2017

@roadrunner2 @Dunedan Many thanks for your contributions! I managed to install Ubuntu 16.04.1 and got it booting using nomodeset.

I then upgraded to the mainline 4.10.1 kernel in order to get proper HiDPI detection and booting without nomodeset, but it gets stuck at fb0: EFI VGA frame buffer device. Any ideas on what's going on? Is there a proven kernel version which works? A description of your stable setup would be super-useful here.

I'm currently trying to get the keyboard and touchpad working, after which I shall be able to assist with bugfixing and potentially upstreaming these patches.


mhkabir commented Mar 11, 2017

Got it working by running a dist-upgrade. Now amdgpu initializes properly and I get correct HiDPI detection. I'm on kernel 4.10.1-041001-generic. I also got the touchar/touchpad/keyboard working after some hackery, because mkinitramfs wouldn't use the patched DSDT. I had to install dracut and generate a new image with the patched DSDT.


roadrunner2 commented Mar 12, 2017


I also got the touchar/touchpad/keyboard working after some hackery, because mkinitramfs wouldn't use the patched DSDT.

Do you have any idea why it didn't accept it? Any particular errors? Did you try running mkinitramfs with -v? Or are you saying that mkinitramfs ran fine but when the kernel booted it didn't pick up the new DSDT?

Assuming the latter, and that what dracut did was prepend an uncompressed cpio archive to initrd, then you can also achieve that with the following commands (assuming a regular, mkinitramfs generated /boot/initrd.img-...):

mkdir -p kernel/firmware/acpi/
cp ...dsdt.aml kernel/firmware/acpi/
echo 1 > early_cpio
find early_cpio kernel | cpio -H newc --create > initrd.img
cat /boot/initrd.img-... >> initrd.img
mv initrd.img /boot/initrd.img-...

mhkabir commented Mar 13, 2017

@roadrunner2 Thanks! mkinitramfs ran fine, but the new DSDT wouldn't be picked up.

I have made interesting progress here meanwhile : Dunedan/mbp-2016-linux#6

Camicaze commented Apr 10, 2017

Great summary, thank you for sharing! It seems like the statement "(MacBookPro13,3 uses a Samsung NVMe controller which is automatically detected correctly)." is not correct. My MacBookPro13,3's nvme doen not work out of the box and manually binding it with

echo 106b 2003 > /sys/bus/pci/drivers/nvme/new_id

does not work either. I will try to use the patch you named for the 13,1 and 13,2 to see if that helps. What model is the SSD you used? Mine is listed as "Apple SSD SM0512l"


roadrunner2 commented Apr 13, 2017

@Camicaze What is the pci id of your NVMe controller? (lspci -nn | grep NVMe ) On mine it's 144d:a804. Also, from the model number it seems you have the 512GB SSD? Mine is the 1TB and shows up as "APPLE SSD SM1024L".

Thanks for this awesome summary!
I just tried to get Fedora working on my MacbookPro13,1 and failed miserably, because of the nvme problem.
Using the commands modprobe nvme; echo 106b 2003 > /sys/bus/pci/drivers/nvme/new_id made it possible for me to get through the installation process, but it just won't boot afterwards, since the command is not a permanent solution.

My question is, how to boot the system to patch the kernel? Do I have to patch the files using the LiveUSB environment?
I'm relatively new to Linux, so I would be really glad if somebody could help me finding a solution.


roadrunner2 commented Apr 16, 2017

@B14ckSh4d0w Yes, you'll need to boot using the LiveUSB in order to fix things. However, I think you can avoid patching the kernel (untested, so please let me know either way). Once booted, mount the disk and run the following commands (assuming you mounted the disk on /mnt - otherwise substitute appropriately):

sudo chroot /mnt
cat <<EOF > /etc/modprobe.d/nvme.conf
install nvme /sbin/modprobe --ignore-install nvme $CMDLINE_OPTS; echo 106b 2003 > /sys/bus/pci/drivers/nvme/new_id
dracut --force

Then reboot. What this does is intercept the modprobe nvme operation to both load the module as well as add the desired id. If this works (as I think it does) then I'll update the instructions above.

B14ckSh4d0w commented Apr 17, 2017

@roadrunner2 Thank you a lot for your reply! At the beginning, I had a few difficulties performing the dracut --force command, but I just made a mistake while mounting the disk. (If anybody has this problem as well: here's a solution)

After running all commands without any error messages, I tried to boot the system but had no success.
The system starts the dracut emergency scripts after random: crng init done
At the end it says, that /dev/disk/by-uuid/... does not exist, which is my root partition.
Have you got an idea how to solve this problem?


roadrunner2 commented Apr 18, 2017

@B14ckSh4d0w I'm sorry this didn't work. Good to see you managed to figure out how to mount the stuff (yes, I glossed over that a bit). Hmm, I wonder if an explicit load of the nvme module is missing - try forcing it as follows (this is in addition to the modprobe change above):

... do your mounts ...
sudo chroot /mnt
echo <<EOF > /etc/dracut.conf.d/disk.conf
dracut --force

and reboot.

Great work but with one issue. The keyboard driver doesn't work on some keys of non-standard keyboard. Like Japanese one | and _

B14ckSh4d0w commented Apr 21, 2017

@roadrunner2 That's absolutely no problem. I've learned from my mistake so it was actually good to figure things out by myself.
I've tried forcing to load the module with the command above, but it didn't work either. It seems like the file /etc/dracut.conf.d/disk.conf is empty after running the command? I still get the same error message while booting.

Could it be possible, that Fedora is the problem? I installed an rc version of the 4.11 Kernel while chrooting (since the nvrm bug should be gone in this version), but with the new kernel it doesn't even start booting at all.


roadrunner2 commented Apr 22, 2017

@B14ckSh4d0w Argh! I can't believe I made such a stupid mistake - that was supposed to be a cat not an echo - disk.conf should definitely not be empty (so no wonder it didn't work) ☹️. Or the simpler way to put the right contents in that file (this time correctly using echo):

echo 'force_drivers+="nvme"' > /etc/dracut.conf.d/disk.conf

As not even starting to boot, that is probably some other issue then. If you're trying out the 4.11 kernel, you might want to remove that /etc/modprobe.d/nvme.conf we created earlier, though I don't think it should cause issues.


roadrunner2 commented Apr 22, 2017

@legendtang I recommend you look at and comment on cb22/macbook12-spi-driver#12

B14ckSh4d0w commented Apr 22, 2017

@roadrunner2 YOU ARE MY HERO! Finally I can use Linux. Thank you a lot! :-)

EDIT: Well, one problem goes and another one comes, haha. I updated the kernel to the latest version (4.10.10, not the experimental 4.11) but grub just won't load it. I can boot the old kernel (4.8.6) without any problems now, but choosing the new one ends up in a black screen right after hitting enter. I don't even get a single system message and nothing is written in the log files either, which I accessed with the command journalctl --boot=-1. Have you got an idea on that?


roadrunner2 commented Apr 22, 2017

@B14ckSh4d0w Great to hear that worked. As to booting 4.10.10: sorry if this is a stupid question, but did you rebuild the initrd for that kernel? If you run plain dracut --force it'll rebuild the initrd for the currently running kernel version - to rebuild for a different version use the --kver <version> option. E.g., assuming you're talking about Fedora 25's latest 4.10.10 kernel, the command would be:

dracut --force --kver 4.10.10-200.fc25.x86_64

You can determine the version by looking at the names of the files /boot/vmlinuz-<version>.


ghost commented Apr 23, 2017

Experts, I am very keen to run linux on my mbp-2016 but obviously I got stuck at the well known issues addressed in this project.
I got to the point to build a live USB for fedora25 ubuntu1404 and ubuntu1610 but obviously everything hangs at the beginning of the boot. I am very happy to hear that most of the problems are addresses. But I don't understand how to apply the fixes that you have found.
Can you kindly share a simple guide how to move forward.....

@roadrunner2 That's not a stupid question, don't worry! But yes, I did rebuild the initramfs by using the command above
(dracut --force --kver 4.10.10-200.fc25.x86_64). I rebuilt it several times now, but my mac just won't start doing anything after choosing the newer kernel.
I added the -v option to the dracut command and didn't get any error messages. So the build of the initrd seems to be ok.


roadrunner2 commented Apr 23, 2017

@B14ckSh4d0w and @ltosolini: I presume you've made sure that the linux command line in grub contains intremap=nosid? Furthermore you probably want to remove the quiet option there if present. Finally, try with and without nomodeset. (on F25 the grub.cfg can be found at /etc/grub2-efi.cfg - not sure where it is on Ubuntu for this platform.)

@ltosolini: Ubuntu 14.04 definitely won't work - the kernel is way too old; Ubuntu 16.10 appears to have the 4.8 kernel, so that should sort of work.

B14ckSh4d0w commented Apr 23, 2017

@roadrunner2 My grub.cfg already contains the command intremap=nosid, since this was on of the first things I did when the first boot succeeded. And I already tried removing the quite option and using nomodeset, without any success. It seems like grub doesn't even start loading the kernel.

I'm going to try another Fedora image now, since I tried to use Fedora Spin KDE Plasma Desktop before. Maybe I won't have any problems regarding the kernel with the normal Fedora Workstation.
I'll keep you updated. Have a nice day!
UPDATE: not working either. grrr...


roadrunner2 commented Apr 24, 2017

If nothing at all shows up even with quiet off, then this looks more like an issue with the kernel image or initrd, not with any missing drivers. Some things to check:

  • do the sizes of the /boot/vmlinuz-* and /boot/initramfs-* files look kosher? (all similar sizes, vmlinuz around 7M, initramfs around 2M)
  • Is the kernel image unmodified: check (there should be no output in both cases)
    • sudo rpm --verify kernel-core-4.10.10-200.fc25.x86_64
    • cmp /boot/vmlinuz-4.10.10-200.fc25.x86_64 /lib/modules/4.10.10-200.fc25.x86_64/vmlinuz
  • is the initrd sound:
    • sudo cat /boot/initramfs-4.10.10-200.fc25.x86_64.img | cpio -tv (should list some directories, the dsdt, and some microcode)
    • sudo /usr/lib/dracut/skipcpio /boot/initramfs-4.10.10-200.fc25.x86_64.img | gunzip -c | cpio -tv > /tmp/ (there should be no errors, and about 2000 entries in the resulting /tmp/

You could also try adding some output to your grub.conf along the lines of

 menuentry .... {
     echo loading kernel
     linuxefi /vmlinuz-....
     echo loading ramdisk
     initrdefi /initramfs-....
     echo booting

@roadrunner2 Thanks again for your reply. I did what you told me and everything seems to be alright:

  • the sizes of the /boot/vmlinuz-* (6.7M) and /boot/initramfs-* (19.7M) are okay (you meant 20M right?)
  • the kernel image check was successful (no output)
  • sudo cat /boot/initramfs-4.10.10-200.fc25.x86_64.img | cpio -tv gave me this output:
drwxr-xr-x   3 root     root            0 Nov  7 10:59 .
-rw-r--r--   1 root     root            2 Nov  7 10:59 early_cpio
drwxr-xr-x   3 root     root            0 Nov  7 10:59 kernel
drwxr-xr-x   3 root     root            0 Nov  7 10:59 kernel/x86
drwxr-xr-x   2 root     root            0 Nov  7 10:59 kernel/x86/microcode
-rw-r--r--   1 root     root        97280 Nov  7 10:59 kernel/x86/microcode/GenuineIntel.bin
192 blocks
  • sudo /usr/lib/dracut/skipcpio /boot/initramfs-4.10.10-200.fc25.x86_64.img | gunzip -c | cpio -tv > /tmp/ gave me a file with 1843 lines -> which you can find here (converted into a .txt file, so you can us the preview function of Dropbox)
  • and after adding the output lines and trying to boot it says
loading kernel
loading ramdisk

I've been waiting at this point for about 30min and nothing happens.
So apparently it successfully loads the kernel and the ramdisk, right? So what could go wrong after that, which causes the system to freeze?

Sorry guys, I think I am missing a piece of the story.
I followed this guide:
using a stock fedora25 64bit image to build a live USB media.
Then I mounted the usb drive on the same mac running macos and edit the grub.cfg adding 'intremap=nosid' and 'nomodset':

mbp:~$ cat /Volumes/ANACONDA/EFI/BOOT/grub.cfg 
set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video

set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'Fedora-WS-Live-25-1-3'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start Fedora-Workstation-Live 25' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz root=live:CDLABEL=Fedora-WS-Live-25-1-3 intremap=nosid nomodeset
	initrdefi /images/pxeboot/initrd.img
This way it is booting fine all the way to initial user selection screen but then I am stuck here because mouse and keyboard are not working.

If I boot this USB drive on another PC it boots fine but I see that it runs kernel 4.8 which I understand is too old for mbp; so what I don't understand now is how to upgrade the kernel if I can not use mouse and keyboard? And also how to do the other operations suggested in this thread if I don't have a workable system!

when I boot fedora25 from the live USB drive I get the grub menu and if I press 'e' on an entry I can edit that entry.
The problem is when I am done with editing, I have to press either CTRL-x or ESC to move forward but I am not able to find any key combination to get either CTRL or ESC. Any idea?


roadrunner2 commented Apr 25, 2017

@fannullone Kernel 4.8 should work well enough to get started, so that's not the issue. You get a working keyboard have essentially two options: either plugin in and use an external USB keyboard and mouse, or modify the initrd you're using to boot (/images/pxeboot/initrd.img) to contain the modified DSDT and the applespi and appletb drivers, as explained Keyboard/Touchpad/Touchbar section above.

As to editing grub at boot, that is a definite problem for which I have not found any solution so far either 😞 (ctrl does work for keys, such as ctrl-c, ctrl-a, and ctrl-e, but no idea why not for ctrl-x).


roadrunner2 commented Apr 25, 2017

@B14ckSh4d0w That initrd doesn't look right: it's A) missing the dsdt.aml in the header part (where you see the early_cpio and microcode files), and B) the main part does not contain the applespi or appletb drivers (nor even the spi_px2xx_platform driver). Having said that, that by itself can't be the reason why it's not booting (it would just mean you end up with the keyboard not working). Though, hmm, I do see a /etc/cmdline.d/20-force_drivers.conf in your initrd - if that specifies drivers that aren't actually in your initrd that might be an issue.

I am using a 13,1 and thus cannot see the SSD without a kernel patch, or kernel version 4.11. I found a utility called which makes it easy to update an Ubuntu/Mint ISO file with a newer kernel. This made it possible for Linux to see the SSD and install onto the MBP. However, I was not able to get the internal keyboard and touchpad to work. I'm probably missing a step.

So, to make things easier I thought I'd try Fedora to be able to follow your method better. How do you patch the installation media so that the Fedora installer can actually see the hard drive?


roadrunner2 commented Apr 30, 2017

@nathanchilton Re-creating the initrd as I describe in "Booting" section above should do the trick, I believe.

ezdora commented May 2, 2017

Hi, great work!

I have run fedora 26, in "MacBook 12" 2016, and everything work out of the box except:

  • keyboard
  • touchpad
  • audio

With your patches keyboard and touchpad are working.

Is there a way to get audio working?


roadrunner2 commented May 3, 2017

@ezdora I'm not aware of anybody having gotten internal audio working yet 😞

@roadrunner2 Hey! Sorry for my long inactivity, but I was really busy the last days. Anyway, I still wasn't able to get it working with any newer kernel. I took a look into the initramfs of the working kernel and it looks exactly the same:

sudo cat /boot/initramfs-4.8.6-300.fc25.x86_64.img | cpio -tv
drwxr-xr-x   3 root     root            0 Nov  7 10:59 .
-rw-r--r--   1 root     root            2 Nov  7 10:59 early_cpio
drwxr-xr-x   3 root     root            0 Nov  7 10:59 kernel
drwxr-xr-x   3 root     root            0 Nov  7 10:59 kernel/x86
drwxr-xr-x   2 root     root            0 Nov  7 10:59 kernel/x86/microcode
-rw-r--r--   1 root     root        97280 Nov  7 10:59 kernel/x86/microcode/GenuineIntel.bin
192 blocks

Also the 4.8.6 initrd (link) isn't that different compared to the 4.10.10 one.

Another thing I've tried is to use the Fedora 26 Alpha .iso (since it worked for @ezdora), but the Live USB isn't even booting. It's just the same as if I would try to boot Fedora 25 with an updated kernel.

So, after all, I will run Fedora in a virtual machine now (as a provisional solution).
But thank you anyway for all the effort you made! I really appreciate that. Have a nice day!

Sorry, I still don't get it, it seems to me a 'chicken and egg problem':
If I boot with Fedora25 and the keyboard/touchpad/touchbar is not working how can I possibly modify the initramfs as described in the 'keyboard/touchpad/touchbar' section?
I don't even think I can perform what described in the 'keyboard/thouchpad/touchbar' section remotely because by default ssh is disabled and of course I can not enable it without keyboard.....

ManWithCamera commented May 8, 2017

@fannullone, a USB keyboard should work just fine.

I haven't been able to get the internal keyboard/touchpad to work, but it seems that I am the exception.

I wonder if this has anything to do with it:
When patching the DSDT, I do not see this line

DefinitionBlock ("", "DSDT", 2, "APPLE ", "MacBookP", 0x00150001)

which is supposed to be changed to:

DefinitionBlock ("", "DSDT", 2, "APPLE ", "MacBookP", 0x00150002)

Instead, I have this:

DefinitionBlock ("dsdt.aml", "DSDT", 3, "APPLE ", "MacBookP", 0x00130001)

I don't understand what this change is meant to accomplish, so I'm not sure if I should mess with it or not.


roadrunner2 commented May 10, 2017

@fannullone As @ManWithCamera says, plug in a usb keyboard.

@ManWithCamera I guess you have a different model than I do, but that's ok: the point of this part of the patch is just to bump the version of the dsdt (otherwise it won't override the existing one, so if you left this as is that would explain why your new dstd isn't being used and your keyboard isn't working); i.e. change the 0x00130001 to 0x00130002.

cworth commented May 26, 2017

@roadrunner2 thank you so much for this work. Great.

I have a Macbook 13,3 and I had to remove the the first section covering 13,1 and 13,2 Macs from the patch in order for the hwdb to compile successfully (and thus the patch to work). Helped to read up on evdev and learn the command for triggering a manual hwdb recompile but not sure if that was necessary. I am running Debian Testing and haven't been able to get the amdgpu Pro driver to compile due to changes from the Stable distribution I think, but Xorg is running fine with the ati module and Debian's amdgpu kernel module (except for screen dimming, and the dpi was way off (96). startx -- -dpi 150 seems to make things about the right size.


roadrunner2 commented May 28, 2017

@cworth Thanks for the report on the hwdb - looks like I was missing an empty line there - sorry about. Fixed now.

I have not tried the amdgpu-pro driver, only the admgpu one in kernel 4.10 - I didn't need change the dpi when using that (though I did change the screen-resolution in gnome's display settings to get things a bit larger).

Lastly, I presume you followed the instructions in the "Screen Brightness Control" section above? And it still doesn't work? Did you verify the modified apple-gmux module is being used? (e.g. check the filename in sudo modinfo apple-gmux, and try explicitly loading your patched apple-gmux with sudo rmmod apple-gmux; sudo insmod ...../apple-gmux.ko).

cworth commented Jun 4, 2017

@roadrunner2 good to know empty line fixes the patch. Just had success adjusting the backlight for apple-gmux. And now, the touchbar buttons work too. I had to reinstall at least once so maybe that fixed it.

dfb8085 commented Jun 14, 2017

First I apologize if this is the wrong place but I know nothing about Linux and these commands are greek to me. I have a MacBook Pro 2016 13,2 and I just want to get 16.04 installed with keyboard and touchpad drivers. Can anyone give me step by step instructions on what to do and get it be loaded on a usb stick prior to booting up linux so it will be ready. Thanks in advance

kjano commented Jun 14, 2017

I am still trying to get the brightness working on my MacBook Pro 14 with Ubuntu 17.04 and Kernel 4.11.4 [Update: wget did the trick; works now]. In case you have trouble selecting a working usb wifi adapter: TEW-649UB did the trick for me; see also . @roadrunner2, in case you would like to update your text nosid seems no longer required from kernel 4.10 on (correct?).

"The touchbar driver is called appletb. It provides basic functionality, enabling the touchbar and switching between modes based on the FN key. Furthermore the touchbar is automatically switched off if no (internal) keyboard, touchpad, or touchbar input is received for 60 seconds; any (internal) keyboard or touchpad input switches it back on." Unfortunately my touchbar stays on, any idea why?

Thanks a lot to all of you and especially to @roadrunner2 and @Dunedan. Audio seems to be the last big issue (for me). Dual screen (USB-C to HDMI) works great.

kjano commented Jun 14, 2017

@dfb8085, what I did was to download the Ubuntu 17.04 ISO (16.04 will work the same way), then use to change the kernel to 4.11.4 (the command will be -i [your iso] -k v4.11.4), and finally use unetbootin (available for Linux and Mac) to create a LiveUSB. Next, you have to boot using Mac's option key and then follow @roadrunner2 instructions.


roadrunner2 commented Jun 15, 2017

@kjano Thanks for the pointer about intremap=nosid not needed anymore - verified that indeed 4.10 and 4.11 boot fine without it, and updated the doc.

Regarding the touchbar timeout, sorry, that info was a bit out of date - I've updated the README now.

Lastly, since you say you have a new MBP14,* model, could you possibly verify the touchpad has the same ranges as the corresponding 13,* model? To do that please get the latest drivers from repo, add CFLAGS_MODULE=-DDEBUG_TOUCHPAD_RANGES to the make modules command, and rebuild and reload the applespi driver; then move your finger to all edges of the touchpad and you should see the ranges being reported in dmesg; finally if you could report the largest (last) range printed here, I can make any necessary adjustments and send a pull request. TIA.

chisNaN commented Jun 29, 2017

Hello @roadrunner2 and @kjano (for ubuntu help and i did not know one could give kernel arg version to isorespin)

I am using ubuntu 17.04 on kernel 4.11.7 now

I am trying the "Keyboard/Touchpad/Touchbar" section

I have done all steps including "add the modules (listed in keyboard.conf) to /etc/initramfs-tools/modules"


  • installing kernel-devel (because i did not find equivalent on debian)
    sudo mv /boot/initramfs-uname -r.img{,.orig}
    because on my os there is only

and i don't really understand how to modify this command only by switching to correct filename because i am used to mv command has a second destination argument. (Thats what i did till now)

Furthermore instead of sudo dracut, i cd into /boot and executed

sudo mkinitramfs -o initramfs-$(uname -r)

which wrote me this file: initramfs-4.11.7-041107-generic
instead of an initrd file (is that ok? by just changing the filename i dont know if th os will recognize this)

Also i would like to notice that after executing the command:

sudo modprobe intel_lpss_pci spi_pxa2xx_platform applespi appletb

my touchpad and keyboard still does not work (normal demeanor?)

Now i have maybe a good news concerning the wifi chipset linked to the 2017 macbook 12 version:
I am connected since ~50 min now and the ping are not so high around 30 but sometimes more and yet no disconnection tough i have a very poor internet access here (and generally use my 4g smartphone to download big files)

Thanks in advance for your help and contrib

chisNaN commented Jun 29, 2017

eventually KEYBOARD & TRACKPAD WORKS for my config (i have spañish keyboard and it's seems ok for special chars)
so instead of sudo dracut i did:

cd /boot
sudo mv /boot/initrd.img-uname -r{,.orig}
(don't forget the special quote in above command)
sudo mkinitramfs -o initrd.img-$(uname -r)
sudo reboot

and i could login with the keyboard and use trackpad also)))

Screen brightness control works out of the box also on that model

BUT my windows bootcamp partition does not work anymore(((
i use refind
Blinitializelibrary failed 0xc00000bb

chisNaN commented Jun 29, 2017

For ubuntu users reading the thread i made a "for NOOB tuto" here

dfb8085 commented Jul 8, 2017

The Keyboard and mouse were working good till reboot. I am running a persistent USB and I went through the steps above and all was well till I rebooted the next time and all my work has disappeared. Now that I have to start over is there a way for me to save this to my persistent USB so that it will stay till the 4.11 comes packaged with ubuntu. MacBook Pro 13,2


roadrunner2 commented Jul 9, 2017

@dfb8085 Sorry to hear you lost your changes. The tutorial above assumes you're installing Linux on the disk. You can certainly modify the USB instead, but the details of that depend very much on the distro you're using: basically you'll need to find the corresponding places on your USB disk where the kernel, ramdisk, modules, etc are stored, and update those locations instead of the regular ones.

I don't know the Ubuntu Install/Live disk layout, so I'm not sure I help you with concrete instructions. You say have a "persistent USB" - does that mean you made it persistent as decribed in these instructions? Or are you using If the latter, then the FAQ there indicates that doesn't work for system updates, so you probably need to modify the base system it's based on.

E.g. looking at the Fedora Live USB I have, I see that the booted kernel image and ramdisk are in images/pxeboot/, so you'd want to update the ramdisk there; the full root filesystem is found at LiveOS/rootfs.img inside LiveOS/squashfs.img, so you'd need to ensure that is mounted and your modifications are made to that. The details for Ubuntu will be different, of course.

@roadrunner2 Are you aware if the 4.12 kernel will fix any of these issues?


roadrunner2 commented Jul 25, 2017

@drewjohnson2 AFAIK 4.12 does not contain anything particularly relevant to this. There are some Thunderbolt and USB-C improvements, but I'm not sure that they do much for us here.

"it stops working after 10 or 15 or so minutes; turning WiFi off, waiting a several minutes, and then turning it back on generally gets it working again. Maybe a thermal issue?"

Could this be harmfull for my MacBook?

And what do they mean with: " uname -r "

I mean i suppose that i have to fill in my username, but what do i have to do with "-r"

@chisNaN please read my comments


roadrunner2 commented Aug 1, 2017


Could this be harmfull for my MacBook?

Not sure; but so far I haven't noticed anything.

And what do they mean with: `uname -r`

That's a command that returns the version (release) of the currently running kernel (see man uname) - the backticks (`) cause the relevant part to be replaced with the output of the command. In short, you should type those commands in exactly as shown - don't replace anything. The only places where you need to manually replace something in the commands above is when I wrote something in <>'s (e.g. <kernel-version>).


Alright, thank you, Yeah I'm a complete noob with linux, so even installing a simple driver is a pain in the ass for me. I see that quite a lot of people are struggling with the problem that the bootcamp (Windows) partition won't work anymore, this is what i did to make it al work, first install Windows through bootcamp, but make the partition bigger (the size you want for windows + the size you want for Linux)

Then shrink the volume in Windows with the disk manager

And install Linux on that partition with your bootable USB.

Then just use rEFInd as bootmngr. In this way they don't "fight" with eachother.


I know this probably doesn't affect your machine, but I'm wondering if you may have any thoughts on the problem with the NVMe at boot time (from this comment and downward).

And thanks for the fix of the touchpad init, I'm using it on linux-next right now, and I'll let you know if I find any problems.


roadrunner2 commented Aug 2, 2017

@peterychuang I've seen that thread, but no, don't really have anything to add, except for a question which I'll post there.


roadrunner2 commented Aug 2, 2017

@dylanprins Thanks for that info - I'm sure other readers will find it useful.

Guess i was wrong.. Windows can't boot anymore, i have the same error as @chisNaN

"Blinitializelibrary failed 0xc00000bb" in rEFInd

Is there somebody who got a working triple boot MacBook pro 2017?

Maybe it's obvious but where should one put the boot loader when installing Linux on a new partition created from within MacOS?

I have a MacBook Pro 2016 model 15'' and I've tried to install KDE Neon with the 4.13-rc3 kernel and Kubuntu with 4.11.4, upgraded using isorespin.

With KDE Neon, I'm getting an error from ubiquity at the end of the install saying it was unable to create a boot loader. I tried placing it on the same partition as KDE Neon, on a separate small parition formatted as both efi and fat32 and even on the same partition as MacOS, but no dice. Starting ubiquity from a terminal and setting the -b option to skip that step, I can successfully install KDE Neon, but of course KDE Neon is nowhere to be seen when I boot the computer. I have rEFInd installed, so maybe I need to configure it to find the install somehow?

With Kubuntu, I didn't encounter any errors during the install, selecting the same partition for both Kubuntu and the boot loader, but after install I only got a black screen and was unable to boot into anything but the MacOS recovery partition (holding Command+R while booting the computer).

Neither live USB was able to boot into Linux without setting intremap=nosid, in spite of both having kernels > 4.10, and I had to attach an external keyboard and mouse to be able to do anything.

I'm definitely doing something wrong, but I don't understand what.

@fleskesvor I just installed gnome on my macbook pro 2016 and had the same issue when I first started, if you are still stuck I can post the steps I took to install it. I took a bit different of an approach than what I've seen here or here I think it's a bit simpler and can post them if you want.

jbadomics commented Aug 9, 2017

@roadrunner2 With my new MacBookPro14,2, the Ubuntu 16.04.3 installer is not recognizing my hard drive at all, even though I have a nice, empty FAT32-formatted partition ready for it. The USB stick with the installer is mounting as dev/sda, and neither gparted nor fdisk -l recognizes anything about the hard disk, not even the (unreadable) macOS partition. There is no /dev/sdb. Something to do with Apple's new FS? There is space available to the installer - I just can't get the installer to see it.

cstockton commented Aug 10, 2017

I've gotten ubuntu 17.10 and built the latest 4.13 kern, everything is stable currently but I can't get the amdgpu to power my 4k external display (LG31MU97) using a display port adapter (Starfield tech usbc -> dp).

It seems amds primary activity has been in the 4.12 kernel, I was able to boot into it but I think I may be missing some CONFIG_* options because it made no difference- though the drm is no longer spamming "clock recovery failed." errors it still doesn't power up the 4k monitor. Xrandr detects the resolution and mode, but fetching the edid data for my second monitor shows "too many extension blocks".

I'll pickup some new cables and see if that helps, if anyone has found a specific adapter that works I would love to know what kind. Thanks!

edit: I was able to get the 4k monitor running 4096x2160@60hz even though my monitor complains about the cable. All kinds of errors in dmesg about related to atomic access & buffers.. but it does work at least. I imagine it will be a while before this branch makes it to any stable ppa's, but if anyone knows a maintained one building these let me know.


roadrunner2 commented Aug 11, 2017

@fleskesvor Since these machines are EFI based, the bootloader does not get installed into a partition (or MBR) like for BIOS based ones. Instead, your distros installer should automatically be creating a top-level directory called EFI (exactly like that) on one of the partitions, and placing the appropriate grub files there (usually in an appropriately named subdirectory) - the EFI firmware will look for that directory on all partitions. You don't need to install rEFInd or other EFI boot manager, unless you really want to - Apple's boot manager works just fine (hold down the alt/option key after powering on to get the list of bootable OS's).

As I said, the EFI directory can be on any partition, as long as it's a top-level directory there. Here are two specific (working) examples of layouts:

/dev/sda3 mounted on /boot

|-- EFI
|   |-- dist1
|   |   |-- grub.efi
|   |   |-- grub.cfg
|   |   |-- ...
|-- vmlinuz
|-- ...
/dev/nvme0n1p5 on /boot
/dev/nmve0n1p4 on /boot/efi

          |-- fedora
          |   |-- grubx64.efi
          |   |-- grub.cfg
          |   |-- ...

I'm not familiar with KDE Neon, ubiquity, or Kubuntu, so I can't comment on the specifics of those. But they should recognize this is an EFI machine and do the right thing.

Needing an external USB keyboard and mouse is expected, until you build the applespi driver and load it.

Lastly, regarding still needing intremap=nosid: that's interesting, not sure what's going on there - maybe something special about the kernel used on the Live USB (we've similarly seen issues with Fedora's Live kernel (#23) which appears unable to boot properly (no display), despite everything booting fine once installed).


roadrunner2 commented Aug 11, 2017

@jbadomics There's an issue with recognizing the nvme device on the 13-inch MBP models - see the section "Booting" above. However, Ubuntu 16.04.03 uses an old kernel, IIRC, 4.4, so I think you'll have a bunch of issues with that. At the very least I recommend installing the hardware-enablement stack; better is probably to install 17.04, though.


roadrunner2 commented Aug 11, 2017

@cstockton Thanks for the info! I have yet to experiment with USB-C->DP adapter - I did try USB-C->HDMI but had no luck, though I didn't spend much effort on it.

fleskesvor commented Aug 13, 2017

@cstockton: Thanks for the offer. :) I would definitely appreciate simpler steps to get this working.

@roadrunner2: It seems rEFInd was wiped when I had to use the recovery partition, but holding down Alt works nicely for getting the option to boot my live USB, so I'm fine with that.

I'm not sure how to relate the layouts you drew to what I'm seing when I select the manual install option:

Device               Type  Size           Used
|--/dev/nvme0n1p1    efi     314 MB       unknown
|--/dev/nvme0n1p2            196687 MB    unknown
|--/dev/nvme0n1p3            650 MB       unknown
|--/dev/nvme0n1p4    efi     3141 MB      unknown
|--free space                134 MB
|--/dev/nvme0n1p5    ext4    299215 MB    unknown
|--free space                134 MB
|--free space                0 MB
|--/dev/sda1         efi     209 MB       209 MB
|--free space                1 MB
|--/dev/sda2         fat32   15789 MB     1940 MB
|--free space                0 MB

The /dev/nvme0n1p5 is the partition I want Linux on. The /dev/nvme0n1p4 is something I messed around with when I couldn't get things to work, and it turned out bigger than intended because the macOS disk utility was fighting me on the size.

The menu for the boot loader wants me to install that on either /dev/nvme0n1, /dev/nvme0n1p1, /dev/nvme0n4, /dev/nvme0n5, /dev/sda, /dev/sda1 or /dev/sda2.

How are you installing Linux if you're not using a live USB? Or are you using a specific kernel that's different from the ones I've used?

EDIT: Are you saying that instead of formatting my Linux partition as ext4, I should instead format it as efi or boot and install both the OS and boot loader on it? I haven't tried that.


roadrunner2 commented Aug 14, 2017

@fleskesvor I forgot to clarify one thing: if you're using Apple's EFI loader then the partition with the /EFI directory must be formatted as FAT or HFS+; if you use rEFInd then it has drivers for ext2/3/4. So in my first example I have rEFInd and /boot is ext4; in my second example I'm using Apple's EFI loader, and hence p4 is formatted at HFS+ and /boot is separate (again ext4).

Now, for your layout: you probably want to install the bootloader then into nvme0n1p4, since that appears to be an efi partition (presumably FAT), and the main OS on nvme0n1p5 (formatted as ext4 or xfs or whatever you want). With this I assume you're not using whole-disk encryption (well, more precisely whole-partition), since you won't have /boot on a separate partition.

Btw., I told MacOS to leave just one large partition (so there were 4 partitions at that point: the main EFI partition p1, MacOS on p2, recovery on p3, and p4 empty) and then let the Linux installer further split that last partition as desired.

cstockton commented Aug 16, 2017

@fleskesvor Sure, the main thing I did differently was select a newer distro and fix my boot params & upgrade my kernel / configure my machine before I booted out of the installer. For example I originally chose gnome but switched back to lubuntu over the weekend.. a horizontal panel on a 4k screen that can't be moved by default is unforgivable :)

Typically I install ubuntu server and lubuntu core without all the junk, but ubuntu-server isos are just full of bugs from my experience. The gnome & lubuntu 17.10 images worked fine (few small bugs). This one is what I used: - here is a gist on the steps. Hope ya get it working!

Hi and thanks for this nice writeup. It helped me a lot so far. At the moment I'm stumped with a problem with the Touchpad. I'm on a MacbookPro14,2, running the latest kernel 4.13.0-rc6 and have installed the spi driver. The keyboard and the touchbar are working fine so I assume I got them installed correctly.

The issue is now that clicking on the touchpad is registered but nothing else. That means for example I cannot move the mouse pointer.
Following is a log with evtest:

Input driver version is 1.0.1
Input device ID: bus 0x1c vendor 0x0 product 0x0 version 0x0
Input device name: "Apple SPI Touchpad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min    -6243
      Max     6749
    Event code 1 (ABS_Y)
      Value      0
      Min     -170
      Max     7685
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        5
    Event code 48 (ABS_MT_TOUCH_MAJOR)
      Value      0
      Min        0
      Max     2048
    Event code 49 (ABS_MT_TOUCH_MINOR)
      Value      0
      Min        0
      Max     2048
    Event code 50 (ABS_MT_WIDTH_MAJOR)
      Value      0
      Min        0
      Max     2048
    Event code 51 (ABS_MT_WIDTH_MINOR)
      Value      0
      Min        0
      Max     2048
    Event code 52 (ABS_MT_ORIENTATION)
      Value      0
      Min   -16384
      Max    16384
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min    -6243
      Max     6749
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min     -170
      Max     7685
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)
Testing ... (interrupt to exit)
Event: time 1503492996.718334, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503492996.718334, -------------- SYN_REPORT ------------
Event: time 1503492996.879580, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503492996.879580, -------------- SYN_REPORT ------------
Event: time 1503492997.114487, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503492997.114487, -------------- SYN_REPORT ------------
Event: time 1503492997.364271, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503492997.364271, -------------- SYN_REPORT ------------
Event: time 1503492997.501204, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503492997.501204, -------------- SYN_REPORT ------------
Event: time 1503492998.088361, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503492998.088361, -------------- SYN_REPORT ------------
Event: time 1503492998.426289, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503492998.426289, -------------- SYN_REPORT ------------
Event: time 1503492998.611674, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503492998.611674, -------------- SYN_REPORT ------------
Event: time 1503492998.732465, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503492998.732465, -------------- SYN_REPORT ------------
Event: time 1503492999.046810, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503492999.046810, -------------- SYN_REPORT ------------
Event: time 1503493000.287577, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493000.287577, -------------- SYN_REPORT ------------
Event: time 1503493000.497668, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493000.497668, -------------- SYN_REPORT ------------
Event: time 1503493000.634500, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493000.634500, -------------- SYN_REPORT ------------
Event: time 1503493000.827672, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493000.827672, -------------- SYN_REPORT ------------
Event: time 1503493004.382180, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493004.382180, -------------- SYN_REPORT ------------
Event: time 1503493004.559694, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493004.559694, -------------- SYN_REPORT ------------
Event: time 1503493005.024971, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493005.024971, -------------- SYN_REPORT ------------
Event: time 1503493005.218714, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493005.218714, -------------- SYN_REPORT ------------
Event: time 1503493005.404096, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493005.404096, -------------- SYN_REPORT ------------
Event: time 1503493005.468864, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493005.468864, -------------- SYN_REPORT ------------
Event: time 1503493005.702607, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493005.702607, -------------- SYN_REPORT ------------
Event: time 1503493005.864193, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493005.864193, -------------- SYN_REPORT ------------
Event: time 1503493006.169090, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1503493006.169090, -------------- SYN_REPORT ------------
Event: time 1503493006.330299, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1503493006.330299, -------------- SYN_REPORT ------------

roadrunner2 commented Aug 28, 2017

@stefan-langenmaier Sorry for the delay. my guess is there was an error initializing the touchpad - this would show up in dmesg - look for messages labelled applespi.

On the plus side I have just pushed an update with a number of fixes, including surrounding initializing the touchpad. I recommend pulling the latest code and try again.


roadrunner2 commented Aug 29, 2017

@stefan-langenmaier Btw., if you could report your success or failure with the latest code, either here or on cb22/macbook12-spi-driver#45, that would be much appreciated.

@roadrunner2 No worries! Your latest changes seem to fix the problem. My touchpad is working fine now.

dfb8085 commented Sep 4, 2017

So guys I been toying with this for a while. I have read the instructions and seems like kernel 4.11 is pretty much a must have. When and where can I download a distribution that already includes kernel 4.11 in order to bypass some of the extra hoops that one has to jump through. Thanks

Michael-Jing commented Sep 5, 2017

I have run ubuntu on MacbookPro for almost two years, And I find a very frustrating problem. From time to time I put the computer aside without connecting the power supply, so power will drain out soon since energy saving on Linux is way much worse than on Mac. And After power drain out, I will not be able to boot into the system any way (it may succeed if I try to boot again and again, hundreds of of times. And sometimes I tried to reset SMC or nvram, the result is even worse, the computer will not find the boot record)


roadrunner2 commented Sep 7, 2017

@dfb8085 Fedora 26 ships with 4.11, and after getting the latest updates it'll put you on 4.12. However, there are issues trying to boot the live images (see also Dunedan/mbp-2016-linux#25) - it works fine after installing, though. Arch is also on 4.11 or 4.12, I believe. I'm sure there are others too.


roadrunner2 commented Sep 7, 2017

@Michael-Jing I'm sorry, I'm not sure I can help - I have never seen that boot issue, either on my (much) older MBP or the 13,3. But it might help if you can describe the behaviour more accurately. You don't say if you're using Apple's efi manager, or rEFInd, or something else. Do get to the grub prompt (assuming you're using grub)? If so, how far does the boot get? If not, do you get to the efi manager's prompt (hold alt/option after powering on if using Apple's efi manager)?

I have a question, everything works fine, but there is one thing I'm very worried about. The fans of my MacBook Pro14,3 never speed up in Ubuntu, so I mean that they never get to higher speeds when the macbook gets hotter. I can get the fans spinning faster by changing the minimum speed of the two fans by editing the "fan1_min & fan2_min" files in /sys/devices/platform/applesmc.768/... manually.

Is this normal? or does it only change the fan speed when the macbook get really f*cking hot?


roadrunner2 commented Sep 10, 2017

@dylanprins: No, that's not normal: on my system they definitely spin up if, say, I'm compiling the kernel. The spin up isn't very aggressive, though, i.e. it will get noticeably warm before the fans increase their speed, though not excessively so IMO. However, some folks have experienced excessive warming too, and some prefer for the fans to kick in earlier - for both there is macfanctld and mbpfan. See the discussion on Dunedan/mbp-2016-linux#13 - basically my experience seems to align with Dunedan's, but you seem to be seeing some more in line with tudorbarascu's.

chaosbunker commented Sep 11, 2017

Thanks for putting this together @roadrunner2

i have been tinkering with my macbookpro13,3 and the first thing that worked was touchpad and keyboard (i used cb22's master because i followed @Dunedan's instructions

while trying to get the rest working i did dkms remove -m applespi/0.1 --all and reinstalled it from you repo according to your instructions. since then keyboard only works but touchpad doesn't

dmesg | grep applespi says this ...

[    1.570133] applespi: loading out-of-tree module taints kernel.
[    1.570144] applespi: module verification failed: signature and/or required key missing - tainting kernel
[    1.581803] applespi: No spi-master device found for device APP000D - waiting for it to be registered
[    1.581804] applespi: acpi-device probe done: APP000D
[    1.756972] applespi: Got spi-master device for device APP000D
[    1.834514] applespi: modeswitch done.
[    1.834626] applespi: spi-device probe done: spi-APP000D:00
[    1.834635] applespi: Added spi device spi-APP000D:00

i hope this is fixable somehow. i got screen brightness and touchbar working finally and don't really feel like reinstalling :-p

another thing i just realized that i haven't figured out is that i can't adjust the display proportions at all


roadrunner2 commented Sep 14, 2017

@chaosbunker That's odd: if touchpad initialization had an error, that would've been logged. What do you see in dmesg when you run the following:

sudo rmmod applespi ; sudo modprobe applespi debug=0x01

Regarding display proportions: I'm running wayland and gnome, and was able to change resolutions (I presume that's what you meant) just fine with the display settings.

Am guessing audio still doesn't work?

kjano commented Sep 21, 2017

@ghosalmartin to the best of my knowledge it does not. I also played around with HDAJackRetask but without any success. I am using an usb-c audio adapter but this is far from perfect.


roadrunner2 commented Sep 22, 2017

No, audio via the built-in microphone and speakers does not work; and AFAIK nobody has started looking into it yet, either.

I managed to install fedora26 on internal disks and it is booting fine (4.12.13-300.fc26.x86_64).
External USB keyboard and mouse are working fine but now I want to get internal keyboard and touchpad to work as well; so I started the procedure at the top of the blog, but I am stack at the following:
sudo mv ...the-attached-keyboard.conf... /etc/dracut.conf.d/keyboard.conf
I don't understand what is ...the-attached-keyboard.conf...
Kindly advice.....

I managed to install fedora26 on internal disks and it is booting fine (4.12.13-300.fc26.x86_64).
External USB keyboard and mouse are working fine but now I want to get internal keyboard and touchpad to work as well; so I started the procedure at the top of the blog, but I am stack at the following:
sudo mv ...the-attached-keyboard.conf... /etc/dracut.conf.d/keyboard.conf
I don't understand what is ...the-attached-keyboard.conf...
Kindly advice.....

following my previous post....I don't think I am on the right path:

[root@linux macbook12-spi-driver]# find / -name "*keyboard.conf"
find: ‘/proc/6169’: No such file or directory
find: ‘/run/user/1000/gvfs’: Permission denied
[root@linux macbook12-spi-driver]# cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
[root@linux macbook12-spi-driver]# ll /etc/dracut.conf.d/
total 0
[root@linux macbook12-spi-driver]# mv /etc/X11/xorg.conf.d/00-keyboard.conf /etc/dracut.conf.d/keyboard.conf
[root@linux macbook12-spi-driver]# dracut
/etc/dracut.conf.d/keyboard.conf: line 3: Section: command not found
/etc/dracut.conf.d/keyboard.conf: line 4: Identifier: command not found
/etc/dracut.conf.d/keyboard.conf: line 5: MatchIsKeyboard: command not found
/etc/dracut.conf.d/keyboard.conf: line 6: Option: command not found
/etc/dracut.conf.d/keyboard.conf: line 7: EndSection: command not found
dracut: Will not override existing initramfs (/boot/initramfs-4.12.13-300.fc26.x86_64.img) without --force

I am stuck on this step:
sudo mv ...the-attached-keyboard.conf... /etc/dracut.conf.d/keyboard.conf
I don't understand what is ...the-attached-keyboard.conf...
Kindly advice.....


roadrunner2 commented Sep 23, 2017

@fannullone Sorry for the confusion: you need to download the keyboard.conf from this gist - I've updated the instructions to hopefully make this clearer.

Bingo!! It is all working like a charm :-) Thanks everybody for this great great blog!!

Now the only one thing missing is audio, I hope soon we could get that as well.
Unfortunately I am not able to help on the development side but I am willing to support with testing..... have MBP 13.3


roadrunner2 commented Sep 24, 2017

@fannullone Regarding audio, it looks like we're getting bluetooth to work (Dunedan/mbp-2016-linux#29), so as a temporary measure with that you can at least stream audio to a BT speaker.

Btw, how did you install Fedora 26? Were you able to boot the live image? I'm asking because several folks have reported issues trying to boot it at Dunedan/mbp-2016-linux#25.

I installed Fedora26 on mbp13.3 following these steps:

  • create an extra partition on internal SSD squeezing macos and create the USB live install media following closely:
  • connected an external USB media and mouse and booted from in live install media: keyboard, mouse, video and wired ethernet were all working fine right away
  • installed fedora on internal free partition; I didn't use LVM but standard partition even if I don't think this makes any difference
  • rebooted and it came up fine
  • dnf upgrade and reboot
  • then I followed this blog to enable internal keyboard, mouse and brightness control;
  • rebooted and it is all working like a charm :-)
    To recap the following is working fine:
  • internal keyboard and touchpad
  • touchbar
  • internal screen, screen brightness control and external monitor
  • wireless through an USB wireless adapter, internal wireless is not detecting my home network
    Audio in not working.
    So I think I now have all that I need to start using my mac the way I like it:-)
    Looking forward for audio and internal wireless!

WRT to audio:
Jabra Evolve 30MS USB headphone is working splendid: hearphone, mike and controls :-)

mealissa commented Oct 2, 2017

Hello guys,
I can switch tty when i'm in console mode, but whenver i start X11 i'm no longer able o switch tty.
can you guys try to see if this is just in my case or something wrong with the touchbar module

Thank you all

I am happily running fedora26 4.12.14-300.fc26.x86_64

I just did a dnf upgrade, but while installing the new kernel I noticed this error:

Running scriptlet: kernel-core-4.13.4-200.fc26.x86_64                                                     67/67 
dracut-install: Failed to find module 'applespi'
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.FGa1kl/initramfs --kerneldir /lib/modules/4.13.4-200.fc26.x86_64/ -m applespi intel_lpss_pci spi_pxa2xx_platform appletb

Is it possible to make so, that when a new kernel is installed, all the modules from this blob are configured automagically.....


roadrunner2 commented Oct 8, 2017

@mealissa I'm using Wayland and able to switch vt's without issue, so I think your problem is related to your setup. You can verify the keyboard events for the keys are being generated by running "libinput-debug-events --show-keycodes".


roadrunner2 commented Oct 8, 2017

@fannullone Good point: I just sent a pull request (cb22/macbook12-spi-driver#47) to fix this; you can also re-fetch my clone to get this. Note that the message will still occur, but the initrd will get built a second time after the driver is built, this time including the driver.

Hi, I followed all steps for trackpad/keyboard/touch bar but I only get the Touch Bar to work. I'm on MacBook Pro 14,2 (French keyboard). Btw brightness control works fine out of the box. I'm using Kali Linux (based on Debian)


roadrunner2 commented Oct 9, 2017

@iTechCydia: Are the modules spi_pxa2xx_platform and intel_lpss_pci loaded? (if your kernel doesn't have them, you'll need to rebuild your kernel with a config containing CONFIG_SPI_PXA2XX=m and CONFIG_MFD_INTEL_LPSS_PCI=m).

If the modules are loaded and it's still not working, can you do the following and provide the output:

sudo rmmod applespi ; sudo modprobe applespi debug=0x51 dyndbg=+p
dmesg | grep apple

Hi all,
Thank you +++ to roadrunner2 for this gist and to all commenters.
I can't pretend to be a complete n00b as I've been using Linux as my main working OS for almost 15 years, the last 6 or so on Macs. But I'm no computer professional and know just enough to get into more trouble than the average person.
I'm trying to get SWMBO's new MacBook Pro 14,2 set up and have got a working keyboard, touchpad and F-key-touchbar thanks to instructions given above. It's running Ubuntu 17.04 Mint with kernel 4.14.0_rc3 via (ta, Linuxium). Boot manager is rEFInd.
She'll need to be able to use an external monitor but that remains to be tested.
RIght now the main frustration is wi-fi, which is unusable. The network SSID is recognised, I enter the network password, but after a minute of wheelspinning, I get asked for the password again, and again. . . The modules brcmfmac, brcmutil and cfg80211 are installed and the 43602 firmware is in the firmware folder.
It looks as if one USB-C port is going to have to be wasted on a Wi-fi dongle.
Is there any alternative driving method for the 43602, e.g. one of the older drivers or something with ndiswrapper?

@roadrunner2, firstly thanks for your answer. I cheked, everything seems to be fine, i can switch tty using external keyboard but not macbook one.
doing this "xmodmap -e 'keycode 68= XF86Switch_VT_2'" and pressing F2 from mac keyboard allow me to switch to tty2
but xmodmap -e 'keycode 68= F2 F2 F2 F2 F2 F2 XF86Switch_VT_2' only works from external keyboard.
really weird !
the point here is if i use "xmodmap -e 'keycode 68= XF86Switch_VT_2'" i can switch tty by pressing F2, but i want use ctrl+alt+f2 instead.


roadrunner2 commented Oct 11, 2017

@kiwigander: I'm sorry, but I'm not aware of any workaround for the wifi, other than the usb dongle. Feel free to add your voice to the kernel bug, though 😉.

I'd be interested in hearing your experience with the external monitor (is it DMPI, DP, etc, and how well it works).


roadrunner2 commented Oct 11, 2017

@mealissa: I presume running the libinput-debug-events command I mentioned indicates all 3 keys being sent when you type ctrl+alt+f2 on the keyboard? Are you also pressing fn, or are you running the touchbar with mode 0 or 2?

@roadrunner2: Ta, SWMBO has announced that she doesn't consider the wifi to be a major, as she's happy to carry a wifi dongle (and a USB-A to USB-C adapter). WRT the kernel bug, is there a page somewhere on "Filing a Kernel Bug for Idiots"? It would be very helpful.
Trying the external monitor proved - interesting. Sorry for the lengthy description to follow: brevity is not my strong suit.
TL-DR: External ASUS PB27UQ connected via USB-C=>Display Port works fine, with a catch.

The monitor works great with my late 2014 MBP and her late 2011? MBA.
Now recall that I'm using rEFInd to manage booting on the new MBP 14,2. After installing Ubuntu as I described above, I've got two options for booting it: ("right": boot\vmlinuz-4.10.0-35-generic.efi.signed from 91GiB ext4 volume [that's my root partition IIRC], and "left": EFI\ubuntu\grubx64.efi from EFI).
Prior to testing the external monitor I had settled on the right option as the left would stall for quite a while at Failed to find handle for ACPI object _SB.PCIO.0000 (and .0001 and .0002).
When I connected the external monitor via a USB-C to Display Port cable, the right Ubuntu boot option started OK, but after a couple dozen lines of startup messages, the screen suddenly changed to uninterpretable snow. The snow did change a bit, as if the video system had gone nuts but things were still happening, but it wouldn't settle into anything readable or usable within 10 minutes.
I disconnected the external monitor and rebooted - and the same fault persisted.
I tried rebooting into the left option, which did stall for the usual delay at the usual point, but once it completed, it drove the external monitor just fine.
The right option still goes nuts, so I assume somehow something got corrupted. I'll probably try a reinstallation - perhaps with Mint rather than Ubuntu (as Ubuntu Mate is a bit odd looking after working for years with Mint Mate).
The alternative is to leave SWMBO working in macOS and monitor progress in getting all the MBP gadgetry working in Linux. That's what I did myself originally in 2011 with the MBP when the then-current Ubuntu wouldn't give acceptable video resolution. Her major apps, besides the usual mail and browser, are Scribus, the GIMP, LibreOffice and Moneydance, all available for macOS.

If information from any log file would be useful, please give me detailed instructions.

mealissa commented Oct 13, 2017

@roadrunner2: with mode 2.

here is the output of xev:

`KeyPress event, serial 34, synthetic NO, window 0x1800001,
root 0x4a6, subw 0x0, time 16269402, (569,956), root:(569,956),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0x1800001,
root 0x4a6, subw 0x0, time 16269612, (569,956), root:(569,956),
state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

MappingNotify event, serial 34, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248

KeyRelease event, serial 35, synthetic NO, window 0x1800001,
root 0x4a6, subw 0x0, time 16270003, (569,956), root:(569,956),
state 0xc, keycode 67 (keysym 0x1008fe01, XF86Switch_VT_1), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

you can see XF86Switch_VT_1 but just nothing happen!!
if i use external keyboard the line starting with "MappingNotify event... " won't show up.


roadrunner2 commented Oct 13, 2017

@kiwigander Thanks for the info. Interesting about the two options: I guess the "right" one is booting directly into linux (i.e. without a bootloader, which is possible only on (U)EFI machines), rather than starting grub like the "left" option does. I see the "right" kernel is 4.10 - is the "left" one (via grub) also 4.10? In any case, it might help to try a newer kernel (Ubuntu 17.10 appears to have 4.13 - try taking one from there). What those 000[012] ACPI objects are, I have no idea though - don't see any such ones in the 13,* dsdt's nor in 14,1 (don't have one from 14,2). But that may not be the cause of the delay: check the dmesg output and see what's going on before and after the delay.

Regarding the wifi bug, see the section above on Wi-Fi - the link is there.

External monitor on my setup: Fedora26 on mbp13.3 works perfect. Can also rotate the external screen.

@roadrunner2 Sorry for the delay. Thank you for pointing out what I should have seen - the "right" kernel was 4.10. Yet I had respun the installation .iso with a 4.14.0rc3 kernel. At this point I'm admitting defeat, at least temporarily, and SWMBO will try out macOS once I get her data across from her current machine. I reckon that either Ubuntu 18.04 (which I assume will be an LTS version) or the first Mint to be based on it may offer an easier path back to Linux.
For what it's worth, although USB-C to DisplayPort worked for one external monitor, USB-C to Thunderbolt 2 to Mini-DP did not work for a similar (ASUS PB279Q) monitor.

Hello all,

an interesting and helpful topic this.

I am currently struggling with the following problem(s).

I would like to put Debian Buster as a dual boot option on a macbook pro (14.3 mid 2017, 15 inch 2.9 GHZ). Currently Debian has the 4.12 kernel as default.
Debian installs cleanly, but I cannot get Debian to boot without using nomodeset in the grub boot screen. If I DO NOT use nomodeset, I get the following (consistent) error messages -
... AE_NOT_FOUND (..../psparse-...) ACPI Error: Method parse/execution failed (_PR.CPU4._PDC)
Repeated many times for CPU0-7.

That's it, boot process hangs. See attached photo.

Obviously with the nomodeset setting, I have problems with various things that I would rather avoid...

Has anyone encountered something similiar and found a solution/workaround??

Any tips and/or pointers much appreciated.


@roadrunner2 what are the two sound cards called?

No takers? Nobody else experiencing these problems??


roadrunner2 commented Oct 20, 2017

@Johnnie390 Those parse errors are normal - I get them too, as well as the failed-to-find-handle and the bcm invalid-platform-data. So those aren't your issue. Can you confirm that the amdgpu driver is the one being used if boot with nomodeset? And what kernel config do you have related to that driver? (grep AMDGPU /boot/config-...).

In short, though, I've not heard of anybody having this issue.


roadrunner2 commented Oct 20, 2017

@nathanielsimonsen Not sure what exactly you're looking for but they show up as card0 and card1 under /proc/asound/. However, I just realized that the card1 directory is empty, so it looks like really only one sound card (/sys/class/sound/ also just shows one card).


roadrunner2 commented Oct 20, 2017

@mealissa Have you tried setting the touchbar mode to 0 or 2? (echo 2 | sudo tee /sys/class/input/input1234/device/fnmode) When doing so, does the MappingNotify event still show up? (Basically I'm wondering if pressing the FN-key is causing issues).

@roadrunner2 I have to use a script on my system (Acer c720) to get linux to recognize my sound card. By default, alsa sees card0 on my system, which is the HDMI port, and enables it as default. The work around is to set card1, which is the PCH device, to the default card. the file goes in /etc/asound.conf

pcm.!default {
type hw
card 1

ctl.!default {
type hw
card 1

Again, this is for my chromebook, so I don't know if it will work in your case or even if you've already tried something like this. Also, this issue looks more like it's a hardware problem than software, so I really don't know if this is useful at all. Anyways, I found out how to do this here:

rezwits commented Oct 25, 2017

I did a full install on my new MacBook 2017 12":

MacOS High Sierra (update)
Bootcamp Windows 10, shrink volume
reFind (with apfs.efi in drivers x64)
Ubuntu 17.10, added drivers

Everything was smooth until:
Blinitializelibrary failed 0xc00000bb

So I did some reading, and came across the fix, I guess for me at least, I am satisfied.
I came across the fix in a funny way. I was ready to scrap the whole thing for the 2nd time and I said well I'll try to modify the partition map. The reason it's funny is because in life you are told:

Don't Quit, Don't Give up, and If something is broke you don't break it more cause that's not gonna do anything.

Well I was like I quit, I give up, I am just going to "trash" what I have and if it works well then it works. This works:

Open a terminal and start sudo gdisk /dev/nvme0n1 (if it’s not installed, reboot into Linux, try again or install with sudo apt-get install gdisk)
Type p to view the partition table to verify you’re working on the correct disk. If not, type q to quit without saving your changes and try again with another device.
Type x to enter the experts’ menu.
Type n to create an empty protective MBR. Note that gdisk won’t confirm a change; it’ll just show you a new experts’ prompt.
Type w to save your changes. You’ll be asked to confirm this action. Do so.
Reboot into Linux (if not done already)



@roadrunner2 i tried both with 1 and 2, the MappingNotisafy is the same "xf86switch_vt_2" but nothing happens

mealissa commented Oct 30, 2017

@roadrunner2 here is some test i did trying to make it work!
xmodmap -e 'keycode 68 = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2'
ctrl+alt+f2 can't switch to tty2
xmodmap -e 'keycode 68 = F2 XF86Switch_VT_2 F2 F2 F2 F2 F2'
shift+f2 can't switch to tty2
xmodmap -e 'keycode 68 = XF86Switch_VT_2 F2 F2 F2 F2 F2 F2'
f2 can switch to tty2
this is 100% xorg issue! but no idea how to fix it!!

drocsid commented Nov 3, 2017

Trying this on ArchLinux here. I created a bootable usb drive using the most recent .iso and hit option at boot and see the option to EFI boot. Then I look and see Arch Linux archisso_x86_64 UEFI CD as the first option above UEFI Shell, EFI Default Loader, mac OS....

I think it's kernel 4.13 . But I get a blank screen. Usb is connected via apple usb / VGA adapter. Not sure how to pass kernel params, maybe from the shell?

kjano commented Nov 4, 2017

@nathanielsimonsen, I followed up on your suggestions (thanks for posting) but it did not help. The HDA Intel / Cirrus Logic Generic card is now set as default but other than that the speakers and headphone jack remain dead.

Trying to install the keyboard/trackpad drivers with no luck on backbox linux . I get the following output


ver$ sudo dkms install applespi/0.1

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=4.8.0-58-generic....(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.8.0-58-generic (x86_64)
Consult /var/lib/dkms/applespi/0.1/build/make.log for more information.

This is the output of the log.

backbox@backbox:~/Desktop$ more /var/lib/dkms/applespi/0.1/build/make.log
DKMS make.log for applespi-0.1 for kernel 4.8.0-58-generic (x86_64)
Mon Nov 6 15:44:09 UTC 2017
make -C /lib/modules/4.8.0-58-generic/build M=/var/lib/dkms/applespi/0.1/build modules
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-58-generic'
CC [M] /var/lib/dkms/applespi/0.1/build/applespi.o
/var/lib/dkms/applespi/0.1/build/applespi.c: In function ‘report_tp_state’:
/var/lib/dkms/applespi/0.1/build/applespi.c:911:30: error: invalid initializer
static ktime_t last_print = 0;
scripts/ recipe for target '/var/lib/dkms/applespi/0.1/build/applespi.o' failed
make[2]: *** [/var/lib/dkms/applespi/0.1/build/applespi.o] Error 1
Makefile:1491: recipe for target 'module/var/lib/dkms/applespi/0.1/build' failed
make[1]: *** [module/var/lib/dkms/applespi/0.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-58-generic'
Makefile:11: recipe for target 'all' failed
make: *** [all] Error 2

Any Ideas would be greatly appreciated

drocsid commented Nov 7, 2017

As per my comment above, no luck with ArchLinux Kernel 4.13 on my 2016 mbp 15". I don't see any advice regarding kernel parameters for 4.13, but I think I read above some issues regarding the GPU powering off if not booting macOS. Really a hard time starting up last years mac on linux.

drocsid commented Nov 7, 2017

Tried booting the fedora 27 beta iso image, and again the screen turns off. Then without any kernel parameter suggestions this contradicts the comments above that If you're booting a 4.11 or later kernel, no special params or patches are needed


roadrunner2 commented Nov 8, 2017

@drocsid You're most likely running into Dunedan/mbp-2016-linux#25 . We still don't know why that happens.


roadrunner2 commented Nov 8, 2017

@alexpol123 Sorry, haven't tested older kernels in a while. You should be able to fix it by simply removing the assignment, so it reads:

        static ktime_t last_print;

I'll test and push a fix in the near future.


roadrunner2 commented Nov 9, 2017

@alexpol123 If you pull the latest from my repo this is now fixed.

drocsid commented Nov 15, 2017

No luck with the debian daily debian-testing-amd64-netinst.iso but it did show the splash screen. No luck with debian-mac-testing-amd64-netinst.iso not even recognized by the boot selector. Next up Fedora-Workstation-netinst-x86_64-27-1.6.iso

drocsid commented Nov 16, 2017

No luck with Fedora-Workstation-netinst-x86_64-27-1.6.iso

@roadrunner2 Thanks a lot . Really appreciate it. I will try install it as soon as possible

drocsid commented Nov 16, 2017

Found the issue regarding my installs. Filevault2 disk encryption.

lppier commented Nov 18, 2017

I'm really cheesed off by the non-working wifi on my macbook pro 2016 15". Is there any resolution for this? :(

drocsid commented Nov 21, 2017

Is anyone booting linux with Filevault2 configured? I installed rEFInd after switching FV2 off. This worked until I re enabled FV2. I'm not sure but I assume FV2 re-installed the bootloader.

drocsid commented Nov 27, 2017

Described issues using rEFInd with FV2 on this issue: Dunedan/mbp-2016-linux#45

I have been happily running fc26 for a few months now, but fc27 is out there....
Anyone already using it who can share any feedback?


roadrunner2 commented Dec 12, 2017

@fannullone I upgraded to FC27 a week or so ago and haven't encountered any (new) issues.

Ok, I upgraded my MBP to FC27: the process was very smooth and everything that was working before is still working.
I utter here my new year wishes to get fixes for what is still not working:

  • bult-in audio
  • wifi
  • suspend/hibernate

coci commented Dec 24, 2017

i install ubuntu 17.10 on macbook pro 13,1
and when i use this :
sudo dnf install git kernel-devel dkms

terminal get error message 👍
command not found : dnf
what i do ?


roadrunner2 commented Dec 29, 2017

@coci Ubuntu is based on Debian, and hence uses dpkg+apt, not rpm+dnf. So try this instead:

sudo apt-get install git linux-headers dkms

Ubuntu also used mkinitramfs instead of dracut, so use the instructions for the former.

l1k commented Dec 31, 2017


Could you please test if commit l1k/linux@a695fcd allows backlight brightness control to function if


Hi there! I just got the latest macbook pro with touchbar, installed on a USB stick linux mint (sylvia 18.3), which came with kernel 4.10.xx). I've been using usb keyboard/mouse/ethernet so far to run linux. I then installed Ukuu to upgrade to the latest stable kernel (4.14.12 I believe), and I was able to follow your instructions up until the line sudo dkms install applespi/0.1 (I skipped the 'boot' section since I'm on 4.14). That command gives me an error: something along the lines of 'bad exit: 2'. The Makefile.log gives me an error saying something about "can't set OCR metadata" (line ~948 of the headers Makefile), saying that I should install libelf-dev, libelf-devel, or elfutils-devel. So I ran apt install libelf-dev (and I even installed something like 'elfutils-dev') but I'm still getting the same error. The make command keeps failing there. I've been looking for a solution all morning, but I'm new to linux and makefiles, so I'm not too sure what the issue could be 🤣
Any help or suggestion is greatly appreciated! Thanks


roadrunner2 commented Jan 14, 2018

@sciamano89 Hmm, I'm sorry, but I have no clue where that OCR error is coming from - that error really doesn't make a lot of sense, so I have to assume it's due to some Linux Mint specific dkms issue. Have you checked farther up the log if there were any other errors, and this OCR error is just some weird secondary error?

As the built in speakers are not working, I would like to connect my MBP running fedora27 to my stereo system.
Unfortunately I bought this one:
But it doesn't work either.
Any advice for an USB-C adapter to connect to the stereo that will work with linux?

kjano commented Jan 19, 2018

@fannullone, I have this one 'BC Master USB-C External Stereo Sound Adapter' and it works out of the box:

Do Bluetooth headsets output audio correctly? as a workaround for the no audio.

dolohow commented Feb 1, 2018

Do Bluetooth headsets output audio correctly? as a workaround for the no audio.


Is it possible to use the middle-button mouse action which on a standard linux PC performs a paste of the current selection?

cworth commented Feb 19, 2018

On my Macbook Pro 13,3, I turned on debug support for SPI drivers in the kernel (drivers->spi->Debug support fro SPI drivers), just assuming this would be a good idea, and the result was GB's of kernel.log files that eventually filled up my hard drive. Just a heads up for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment