I recently installed Debian 9 on my Macbook Pro 7.1. I had to track in many forums some solutions to the problems of connection with Wifi and drivers of Nvidia. I decided to put together everything I discovered in one place. I hope this is useful.

*******1. Install Ubuntu in UEFI mode with the Nvidia driversI will not go into details here because there are lots of articles on the web showing you how to do this and end up with the nouveau drivers running your machine hot or with the black screen after installing the Nvidia drivers (e.g. www.rodsbooks.com/ubuntu-efi).

Please note however that the following instructions assume you have successfully installed and booted in UEFI mode. You can verify that by checking for existence of the directory /sys/firmware which is only created after booting in EFI mode.2. Find the right PCI-E bus identifiers

We need both the IDs for the graphics card and the PCI-E bridge that it is connected to. Issue the following command in a shell:

Have a look at (1) the line saying display and (2) the line with bridge right before that display line. Write down the PCI-E bus ids (format XX:YY.Z) of the bridge device (here 00:17.0) and the display device (here 04:00.0) and remember which is which. Note: Those IDs may be different on your machine, depending on your Mac model and revision.3. Create a GRUB script for setting the PCI-E registers during boot

Fire up a text editor with sudo nano /etc/grub.d/01_enable_vga.conf and copy/paste the content below. Replace 00:17.0 with the PCI-E ID of your bridge device noted in step 2. Replace 04:00.0 with the PCI-E ID of your display device noted in step 2.

GETTING WIFI TO WORKI installed the b43-firmware-installer package, which worked on the first boot. But in the second boot, the wifi networks disappeared and Network-Manager could not find any network.

# /etc/modules: kernel modules to load at boot time.## This file contains the names of kernel modules that should be loaded# at boot time, one per line. Lines beginning with "#" are ignored.applesmccoretemp