Create a gist now

Instantly share code, notes, and snippets.

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

Introduction

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 https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) 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 (older kernels need patches)
  • WiFi on MBP13,1 and MBP14,1

What doesn't work

  • WiFi on ,2 and ,3 models (though some folks have had success with some of the workarounds)
  • Suspend/Resume
  • Audio (two cards show up, and intel driver is loaded, but no sound)

Untested

  • Thunderbolt
  • DisplayPort

Details

Partitioning

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.

Booting

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.

Keyboard/Touchpad/Touchbar

For this we need the drivers from https://github.com/roadrunner2/macbook12-spi-driver.git (a clone of https://github.com/cb22/macbook12-spi-driver 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"
EOF

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
applespi
appletb
intel_lpss_pci
spi_pxa2xx_platform
EOF

Now get and build the drivers:

git clone https://github.com/roadrunner2/macbook12-spi-driver.git
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
popd

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

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

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 (all kernels), and MacBookPro13,3 with recent kernels, but requires a kernel patch on MacBookPro13,3 with older kernels (see also https://github.com/Dunedan/mbp-2016-linux/issues/2). Specifically, if you have any of these kernels you need to patch: < 4.14, 4.14 - 4.14.21, 4.15 - v4.15.5 (i.e. the issue was fixed in 4.14.21, 4.15.5, and 4.16). The following will create and install the patched apple-gmux:

mkdir apple-gmux
pushd apple-gmux

curl -o apple-gmux.patch 'https://bugzilla.kernel.org/attachment.cgi?id=192601'
curl -o apple-gmux.c 'https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/drivers/platform/x86/apple-gmux.c?id=refs/tags/v4.9.11'

patch < apple-gmux.patch

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

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

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

popd

sudo reboot

Other

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.

WiFi

WiFi works fine on MBP13,1 and MBP14,1. But the other models use a different chipset, and while on those the brcmfmac driver is automatically loaded, 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: https://bugzilla.kernel.org/show_bug.cgi?id=193121

In the mean time some folks have that one or both of the following hacks make the WiFi work well enough them (personally, while they do improve the situation, I have not found them to be sufficient enough for actual work, i.e. I still see many packet drops and connection failures - YMMV):

  • reduce the transmit power: sudo iwconfig wlp3s0 txpower 10
  • edit the firmware blob (/lib/firmware/brcm/brcmfmac43602-pcie.bin) and modify the regrev and ccode values (see the above bugreport for details)

Display

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).

Camera

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 https://github.com/Dunedan/mbp-2016-linux/issues/15.

Bluetooth

As of kernel 4.16 bluetooth works out of the box; older kernels need patches - see https://github.com/Dunedan/mbp-2016-linux/issues/29#issuecomment-331693489 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).

Note that as of 4.16 there are still issues on MacBookPro13,1 and MacBookPro14,1 - see the above bug for details on what additional patches are needed.

# 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:*
EVDEV_ABS_00=::95
EVDEV_ABS_01=::90
EVDEV_ABS_35=::95
EVDEV_ABS_36=::90
# 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_ABS_00=::96
EVDEV_ABS_01=::94
EVDEV_ABS_35=::96
EVDEV_ABS_36=::94
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,3:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,3:*
EVDEV_ABS_00=::96
EVDEV_ABS_01=::95
EVDEV_ABS_35=::96
EVDEV_ABS_36=::95
libinput:name:*Apple SPI Touchpad*:dmi:*
LIBINPUT_MODEL_APPLE_TOUCHPAD=1
LIBINPUT_ATTR_KEYBOARD_INTEGRATION=internal
LIBINPUT_ATTR_TOUCH_SIZE_RANGE=200:150
LIBINPUT_ATTR_PALM_SIZE_THRESHOLD=1200
--- 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 @@
.driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
+ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
{ 0, }
};
MODULE_DEVICE_TABLE(pci, nvme_id_table);
@Dunedan

This comment has been minimized.

Show comment
Hide comment
@Dunedan

Dunedan Jan 24, 2017

Very good overview, especially as I basically did the same with a focus on the MacBookPro13,2: https://github.com/Dunedan/mbp-2016-linux

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 (https://github.com/Dunedan/mbp-2016-linux#screen). 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 https://github.com/torvalds/linux/blob/v4.10-rc5/drivers/nvme/host/pci.c#L1619 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.

Dunedan commented Jan 24, 2017

Very good overview, especially as I basically did the same with a focus on the MacBookPro13,2: https://github.com/Dunedan/mbp-2016-linux

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 (https://github.com/Dunedan/mbp-2016-linux#screen). 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 https://github.com/torvalds/linux/blob/v4.10-rc5/drivers/nvme/host/pci.c#L1619 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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@Dunedan

Dunedan 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@tudorbarascu

tudorbarascu 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.

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

This comment has been minimized.

Show comment
Hide comment
@bubuntux

bubuntux 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
FILES="/etc/keyboard.conf"

and regenerating the img
mkinitcpio -p linux

but didn't work
halp!

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
FILES="/etc/keyboard.conf"

and regenerating the img
mkinitcpio -p linux

but didn't work
halp!

@Edweirdo256

This comment has been minimized.

Show comment
Hide comment
@Edweirdo256

Edweirdo256 Feb 28, 2017

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.

Edweirdo256 commented Feb 28, 2017

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.
Owner

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

This comment has been minimized.

Show comment
Hide comment
@mhkabir

mhkabir 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.

Thanks!
Kabir

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.

Thanks!
Kabir

@mhkabir

This comment has been minimized.

Show comment
Hide comment
@mhkabir

mhkabir 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 Mar 12, 2017

@mhkabir

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-...
Owner

roadrunner2 commented Mar 12, 2017

@mhkabir

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

This comment has been minimized.

Show comment
Hide comment
@mhkabir

mhkabir 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

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

This comment has been minimized.

Show comment
Hide comment
@Camicaze

Camicaze 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"

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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".

Owner

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".

@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w Apr 16, 2017

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.

B14ckSh4d0w commented Apr 16, 2017

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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
EOF
dracut --force
exit

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.

Owner

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
EOF
dracut --force
exit

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

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w 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?

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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
force_drivers+="nvme"
EOF
dracut --force
exit

and reboot.

Owner

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
force_drivers+="nvme"
EOF
dracut --force
exit

and reboot.

@legendtang

This comment has been minimized.

Show comment
Hide comment
@legendtang

legendtang Apr 21, 2017

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

legendtang commented Apr 21, 2017

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

@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 Apr 22, 2017

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

Owner

roadrunner2 commented Apr 22, 2017

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

@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w 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?

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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>.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.....
Thanks!!

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.....
Thanks!!

@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w Apr 23, 2017

@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.

B14ckSh4d0w commented Apr 23, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w 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...

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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/initrd.ls (there should be no errors, and about 2000 entries in the resulting /tmp/initrd.ls)

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
}
Owner

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/initrd.ls (there should be no errors, and about 2000 entries in the resulting /tmp/initrd.ls)

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
}
@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w Apr 25, 2017

@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/initrd.ls 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
booting
□

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?

B14ckSh4d0w commented Apr 25, 2017

@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/initrd.ls 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
booting
□

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?

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Apr 25, 2017

Sorry guys, I think I am missing a piece of the story.
I followed this guide: https://linuxnewbieguide.org/how-to-install-linux-on-a-macintosh-computer/
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
}

load_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 rd.live.image 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!

fannullone commented Apr 25, 2017

Sorry guys, I think I am missing a piece of the story.
I followed this guide: https://linuxnewbieguide.org/how-to-install-linux-on-a-macintosh-computer/
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
}

load_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 rd.live.image 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!

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Apr 25, 2017

Guys,
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?
Thanks!

fannullone commented Apr 25, 2017

Guys,
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?
Thanks!

@roadrunner2

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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).

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@nathanchilton

This comment has been minimized.

Show comment
Hide comment
@nathanchilton

nathanchilton Apr 29, 2017

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 isorespin.sh 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?

nathanchilton commented Apr 29, 2017

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 isorespin.sh 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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 Apr 30, 2017

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

Owner

roadrunner2 commented Apr 30, 2017

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

@ezdora

This comment has been minimized.

Show comment
Hide comment
@ezdora

ezdora 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?

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 May 3, 2017

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

Owner

roadrunner2 commented May 3, 2017

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

@B14ckSh4d0w

This comment has been minimized.

Show comment
Hide comment
@B14ckSh4d0w

B14ckSh4d0w May 4, 2017

@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!

B14ckSh4d0w commented May 4, 2017

@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!

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone May 7, 2017

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.....

fannullone commented May 7, 2017

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

This comment has been minimized.

Show comment
Hide comment
@ManWithCamera

ManWithCamera 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@cworth

cworth 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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).

Owner

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

This comment has been minimized.

Show comment
Hide comment
@cworth

cworth 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.

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

This comment has been minimized.

Show comment
Hide comment
@dfb8085

dfb8085 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

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

This comment has been minimized.

Show comment
Hide comment
@kjano

kjano 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 https://github.com/pvaret/rtl8192cu-fixes . @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

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 https://github.com/pvaret/rtl8192cu-fixes . @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

This comment has been minimized.

Show comment
Hide comment
@kjano

kjano Jun 14, 2017

@dfb8085, what I did was to download the Ubuntu 17.04 ISO (16.04 will work the same way), then use isorespin.sh to change the kernel to 4.11.4 (the command will be isorespin.sh -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.

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 isorespin.sh to change the kernel to 4.11.4 (the command will be isorespin.sh -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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@chisNaN

chisNaN 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"
and adding the flag CFLAGS_MODULE=-DDEBUG_TOUCHPAD_RANGES

except:

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

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

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"
and adding the flag CFLAGS_MODULE=-DDEBUG_TOUCHPAD_RANGES

except:

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

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

This comment has been minimized.

Show comment
Hide comment
@chisNaN

chisNaN 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

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

This comment has been minimized.

Show comment
Hide comment
@chisNaN

chisNaN Jun 29, 2017

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

chisNaN commented Jun 29, 2017

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

@dfb8085

This comment has been minimized.

Show comment
Hide comment
@dfb8085

dfb8085 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

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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 http://www.linuxliveusb.com/? 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.

Owner

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 http://www.linuxliveusb.com/? 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.

@drewjohnson2

This comment has been minimized.

Show comment
Hide comment
@drewjohnson2

drewjohnson2 Jul 25, 2017

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

drewjohnson2 commented Jul 25, 2017

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

@roadrunner2

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Aug 1, 2017

"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?

dylanprins commented Aug 1, 2017

"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?

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Aug 1, 2017

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"

dylanprins commented Aug 1, 2017

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"

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Aug 1, 2017

@chisNaN please read my comments

dylanprins commented Aug 1, 2017

@chisNaN please read my comments

@roadrunner2

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 Aug 1, 2017

@dylanprins

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>).

Owner

roadrunner2 commented Aug 1, 2017

@dylanprins

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>).

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Aug 1, 2017

@roadrunner2

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.

dylanprins commented Aug 1, 2017

@roadrunner2

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.

@peterychuang

This comment has been minimized.

Show comment
Hide comment
@peterychuang

peterychuang Aug 1, 2017

@roadrunner2

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.

peterychuang commented Aug 1, 2017

@roadrunner2

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 Aug 2, 2017

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

Owner

roadrunner2 commented Aug 2, 2017

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

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Aug 3, 2017

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?

dylanprins commented Aug 3, 2017

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?

@fleskesvor

This comment has been minimized.

Show comment
Hide comment
@fleskesvor

fleskesvor Aug 7, 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 commented Aug 7, 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.

@cstockton

This comment has been minimized.

Show comment
Hide comment
@cstockton

cstockton Aug 8, 2017

@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.

cstockton commented Aug 8, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@jbadomics

jbadomics 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.

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

This comment has been minimized.

Show comment
Hide comment
@cstockton

cstockton 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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

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

/boot/efi/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).

Owner

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

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

/boot/efi/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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@fleskesvor

fleskesvor 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/nvme0n1
|--/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
|-/dev/sda
|--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.

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/nvme0n1
|--/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
|-/dev/sda
|--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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@cstockton

cstockton 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: http://cdimage.ubuntu.com/lubuntu/releases/17.10 - here is a gist on the steps. Hope ya get it working!

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: http://cdimage.ubuntu.com/lubuntu/releases/17.10 - here is a gist on the steps. Hope ya get it working!

@stefan-langenmaier

This comment has been minimized.

Show comment
Hide comment
@stefan-langenmaier

stefan-langenmaier Aug 23, 2017

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
Properties:
  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 ------------

stefan-langenmaier commented Aug 23, 2017

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
Properties:
  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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@stefan-langenmaier

This comment has been minimized.

Show comment
Hide comment
@stefan-langenmaier

stefan-langenmaier Aug 31, 2017

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

stefan-langenmaier commented Aug 31, 2017

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

@dfb8085

This comment has been minimized.

Show comment
Hide comment
@dfb8085

dfb8085 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

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

This comment has been minimized.

Show comment
Hide comment
@Michael-Jing

Michael-Jing 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)

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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)?

Owner

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)?

@dylanprins

This comment has been minimized.

Show comment
Hide comment
@dylanprins

dylanprins Sep 7, 2017

@roadrunner2
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?

dylanprins commented Sep 7, 2017

@roadrunner2
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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@chaosbunker

chaosbunker 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

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

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

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

@roadrunner2

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@ghosalmartin

This comment has been minimized.

Show comment
Hide comment
@ghosalmartin

ghosalmartin Sep 21, 2017

Am guessing audio still doesn't work?

ghosalmartin commented Sep 21, 2017

Am guessing audio still doesn't work?

@kjano

This comment has been minimized.

Show comment
Hide comment
@kjano

kjano 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 22, 2017

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.....
Thanks!

fannullone commented Sep 22, 2017

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.....
Thanks!

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 23, 2017

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.....
Thanks!

fannullone commented Sep 23, 2017

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.....
Thanks!

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 23, 2017

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
/etc/X11/xorg.conf.d/00-keyboard.conf
[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"
EndSection
[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.....
Thanks!

fannullone commented Sep 23, 2017

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
/etc/X11/xorg.conf.d/00-keyboard.conf
[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"
EndSection
[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.....
Thanks!

@roadrunner2

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 24, 2017

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

fannullone commented Sep 24, 2017

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 25, 2017

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: https://linuxnewbieguide.org/how-to-install-linux-on-a-macintosh-computer/
  • 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!

fannullone commented Sep 25, 2017

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: https://linuxnewbieguide.org/how-to-install-linux-on-a-macintosh-computer/
  • 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!
@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Sep 28, 2017

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

fannullone commented Sep 28, 2017

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

@mealissa

This comment has been minimized.

Show comment
Hide comment
@mealissa

mealissa 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

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

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Oct 5, 2017

Experts,
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.....

fannullone commented Oct 5, 2017

Experts,
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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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".

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@iTechCydia

This comment has been minimized.

Show comment
Hide comment
@iTechCydia

iTechCydia Oct 8, 2017

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)

iTechCydia commented Oct 8, 2017

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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
Owner

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
@kiwigander

This comment has been minimized.

Show comment
Hide comment
@kiwigander

kiwigander Oct 10, 2017

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 isorespin.sh (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?

kiwigander commented Oct 10, 2017

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 isorespin.sh (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?

@mealissa

This comment has been minimized.

Show comment
Hide comment
@mealissa

mealissa Oct 10, 2017

@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.

mealissa commented Oct 10, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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).

Owner

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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?

Owner

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?

@kiwigander

This comment has been minimized.

Show comment
Hide comment
@kiwigander

kiwigander Oct 12, 2017

@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.

kiwigander commented Oct 12, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@mealissa

mealissa 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.

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

This comment has been minimized.

Show comment
Hide comment
@roadrunner2

roadrunner2 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.

Owner

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.

@fannullone

This comment has been minimized.

Show comment
Hide comment
@fannullone

fannullone Oct 15, 2017

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

fannullone commented Oct 15, 2017

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

@kiwigander

This comment has been minimized.

Show comment
Hide comment
@kiwigander

kiwigander Oct 16, 2017

@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.

kiwigander commented Oct 16, 2017

@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.

@Johnnie390

This comment has been minimized.

Show comment
Hide comment
@Johnnie390

Johnnie390 Oct 17, 2017

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.

Johnnie
proshot_2017_10_15_10_02_51

Johnnie390 commented Oct 17, 2017

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.

Johnnie
proshot_2017_10_15_10_02_51