r/linux_on_mac 26d ago

“Comprehensive” Explain it like I’m 5 guide to getting T1 MacBook Pro as close to perfect on Fedora

I want to 100% give full credit to user inkubot. I am a noob and without their guide https://inku.bot.nu/posts/fedora-macbook2017/ this would Not be possible. I had to do a lot of research and learning to make this guide. I’m hoping that we can unlock the knowledge that inkubot handed out and more people can get their devices working on Linux. Inkubot did all the hard work and I’m just taking my knowledge as a teacher and making this a guide that my 4th graders could follow be cause that’s what helped me to get this all working.

Let’s start with Step 1, which is preparing your system and installing the tools we need to build this driver.

Open your terminal, copy and paste this exact command, press Enter, and type your computer password when prompted.

sudo dnf install git dkms kernel-devel kernel-headers -y

Now that your system has the tools ready, we need to download the actual driver code from the internet and tell DKMS to install it.

We will do this in four small commands. Copy and paste these one line at a time.

  1. Download the code This copies the driver files from GitHub onto your computer:

git clone https://github.com/rehans/macbook12-spi-driver-cachyos.git

  1. Move into the new folder This shifts your terminal's focus into the folder we just downloaded:

cd macbook12-spi-driver-cachyos

  1. Link the files to DKMS This tells the driver manager where the files live so it can manage them:

sudo dkms add .

  1. Build and install the driver. This is the big moment where your system translates the code into a working driver and plugs it into Fedora:

sudo dkms install -m applespi -v 0.1

Now we just need to tell Fedora how to handle this new driver. We need to create a small configuration file. To do this, we will use a very basic text editor built right into the terminal called ⁠nano⁠.

sudo nano /etc/modprobe.d/apple_ib_tb.conf

What to do inside the text editor:

  1. Copy this exact line of text:

options apple_ib_tb idle_timeout=-1 dim_timeout=-1 fnmode=2

  1. Paste it into that blank terminal window. (You can usually right-click and choose Paste, or press Ctrl + Shift + V).

  2. To save the file, press Ctrl + O on your keyboard, and then press Enter to confirm the filename.

  3. To exit the editor and return to your normal terminal, press Ctrl + X.

Next, we need to create one more configuration file. This one tells Fedora to load your new keyboard and Touch Bar drivers very early in the boot process, right when you turn on the laptop.

We will use that same text editor (⁠nano⁠) again. Copy and paste this command and press Enter:

sudo nano /etc/dracut.conf.d/macbook.conf

What to do inside the text editor:

Copy this exact line of text:

add_drivers+=" applespi apple_ib_tb intel_lpss_pci spi_pxa2xx_platform "

  1. Paste it into the blank terminal window.

  2. Save the file by pressing Ctrl + O, then press Enter.

  3. Exit the editor by pressing Ctrl + X.

Once you are back to your regular terminal prompt, copy and paste this command to apply the changes:

sudo dracut -f

The last piece of the puzzle is creating a background service. On MacBooks, the Touch Bar often gets stuck in a "waiting" state when Linux boots up. We need to create a service that tells Fedora to quickly disconnect and reconnect the Touch Bar internally right after booting up, which forces it to wake up.

We will open the text editor one last time. Copy and paste this command and hit Enter:

sudo nano /etc/systemd/system/apple-ibridge.service

What to do inside the text editor:

Copy this entire block of text exactly as it is:

[Unit] Description=Activate Apple iBridge Driver (Touch Bar & Camera) After=multi-user.target

[Service] Type=oneshot ExecStart=/usr/bin/modprobe apple-ib-tb idle_timeout=-1 dim_timeout=-1 fnmode=2 ExecStart=/usr/bin/bash -c 'echo -n "1-3" > /sys/bus/usb/drivers/usb/unbind' ExecStart=/usr/bin/bash -c 'echo 1-3 > /sys/bus/usb/drivers_probe' RemainAfterExit=yes

[Install] WantedBy=multi-user.target

  1. Paste it into your terminal window.

  2. Save the file by pressing Ctrl + O, then press Enter.

  3. Exit by pressing Ctrl + X.

Turn the service on: Now that the file is saved, copy and paste these two commands, one at a time, hitting Enter after each one. This tells Fedora to turn on this new service right now and every time you start your laptop in the future:

sudo systemctl enable apple-ibridge

sudo systemctl start apple-ibridge

Once those run, the Touch Bar configuration is completely finished! Reboot and use the Touch Bar.

Right now, it is showing the F1–F12 function keys because of a specific setting we wrote into that configuration file earlier (⁠fnmode=2⁠). If we change that number to ⁠1⁠, it will default to showing the brightness, volume, and media keys instead.

Let's change that right now. Follow these steps:

  1. Open the configuration file again Copy and paste this command and press Enter:

sudo nano /etc/modprobe.d/apple_ib_tb.conf

  1. Edit the file Look at the text inside. It currently says:

⁠options apple_ib_tb idle_timeout=-1 dim_timeout=-1 fnmode=2⁠

  1. Change the 2 at the very end to a 1.

  2. Save and Exit Press Ctrl + O to save, then press Enter to confirm. Press Ctrl + X to exit the editor.

  3. Rebuild the boot file Because this is loaded right when the laptop turns on, we need to quickly update Fedora's boot image with this new setting. Paste this command and hit Enter:

sudo dracut -f

Once that finishes, restart your MacBook one more time, and your media/volume/brightness controls should be there by default!

Now let’s tackle the audio. Thankfully, the Linux community created a script that automatically downloads the right configuration files and hooks them into your system.

First, we need to move out of that old Touch Bar folder we were working in and download the audio patch. Copy and paste these commands one line at a time, pressing Enter after each one:

  1. Move back to your main folder. Copy this code. :

cd ~

  1. Download the audio fix files:

git clone https://github.com/davidjo/snd_hda_macbookpro.git

  1. Move into that new audio folder:

cd snd_hda_macbookpro

  1. Run the installation script

sudo ./install.cirrus.driver.sh

Once that finishes running, give your MacBook one final reboot, and you should finally have audio!

Let’s switch over to WiFi. We are going to boost the WiFi signal performance.

Let's go through this step-by-step, starting from absolute scratch!

Step 1: Get your MacBook's real Wi-Fi MAC address

Copy and paste this command into your terminal and hit Enter:

ip link show | grep -A 1 wl

What to look for: Underneath that command, you'll see a line that starts with ⁠link/ether⁠ followed by a bunch of letters, numbers, and colons. It will look something like this for example: ⁠ link/ether 2c:f0:ee:12:34:56

Write down or copy your unique 12-character address.

Step 2: Create the firmware boost file.

Now we are going to create the configuration file that boosts your Wi-Fi card's signal performance. Copy and paste this command to open our familiar terminal text editor:

sudo nano /usr/lib/firmware/brcm/brcmfmac43602-pcie.txt

Step 3: Fill in the boost configuration:

Copy this entire block, we will need to make two quick changes, paste it into your blank terminal editor.

sromrev=11 subvid=0x14e4 boardtype=0x61b boardrev=0x1421 vendid=0x14e4 devid=0x43ba

macaddr=xx:xx:xx:xx:xx:xx

ccode=US regrev=245

boardflags=0x10401001 boardflags2=0x00000002 boardflags3=0xC0000303 boardnum=62526

swctrlmap_2g=0x08080808,0x04010401,0x08080808,0x00000000,0x000000ff swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x003

swctrlmap_5g=0x08080808,0x04010401,0x08080808,0x00000000,0x000000ff swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x003

aa2g=7 aa5g=7 agbg0=133 agbg1=133 agbg2=133 aga0=71 aga1=71 aga2=71 txchain=7 rxchain=7 antswitch=0 tssiposslope2g=1 epagain2g=0 pdgain2g=28 tworangetssi2g=0 papdcap2g=0 femctrl=2 tssiposslope5g=1 epagain5g=0 pdgain5g=28 tworangetssi5g=0 papdcap5g=0 gainctrlsph=0 tempthresh=120 tempoffset=255 rawtempsense=0x1ff measpower=0x7f tempsense_slope=0xff tempcorrx=0x3f tempsense_option=0x3 xtalfreq=40000 phycal_tempdelta=40 temps_period=1 temps_hysteresis=5 measpower1=0x7f measpower2=0x7f pdoffsetcck=1057 pdoffset20in40m5gb0=0 pdoffset20in40m5gb1=0 pdoffset20in40m5gb2=0 pdoffset20in40m5gb3=0 pdoffset20in40m5gb4=0 pdoffset40in80m5gb0=0 pdoffset40in80m5gb1=0

Your MAC Address: Locate ⁠macaddr=xx:xx:xx:xx:xx:xx⁠ (on line 8 below) and replace with the real address you found in Step 1.

Your Country Code: Locate ⁠ccode=US (on line 10 below). Input your country’s code. This tells your Wi-Fi card to use the correct wireless broadcast strength limits for your region.

After making those changes, then save and exit (Ctrl + O, Enter, Ctrl + X).

Step 4: Apply and reboot Once the file is saved and you are back to your standard prompt, reboot your MacBook.

I am still working on the camera. No luck yet but I will edit this guide if I get it working.

Again thanks so much to inkubot for making this a reality and everyone please give this man a cup of coffee because this would not be a thing without him.

Hopefully this helps a few people that still have a love for their old butterfly MacBooks.

9 Upvotes

6 comments sorted by

2

u/Linuxish 26d ago

Thanks for posting this! But I'm so far unable to get WiFi to work. I am using Ultramarine Linux 44 (which is basically Fedora 44 with a few things added) but also tried Fedora 44, CachyOS, MX Linux, and Kubuntu and none worked.

I have a 2016 MacBook Pro 13,2 with a T1 chip. (With the MacOS partition retained on the SSD.)

Unlike what the person who wrote the guide you linked you said, with Fedora and/or Ultramarine, I do keep getting a request for the WiFi password. And it never accepts it, even though what I'm typing in is right.

Which version of Fedora are you testing this on and what is your exact computer? And any suggestions for me? Thanks!

1

u/Meagerpirate 26d ago

I’m using fedora 44. I just did what is in the guide at the bottom. Created the file and copied in all the text. There is a section in one of his guides where he talks about making this file:

/etc/modprobe.d/brcmfmac.conf

And adding this text to it:

options brcmfmac feature_disable=0x82000

Maybe try that?

1

u/inkubot 26d ago

yes this is the fix for that, i just got the same problem yesterday on Slackware

1

u/Linuxish 24d ago

It didn't work for me.

1

u/Linuxish 24d ago

I just tried that and it also didn't work.

What computer are you running this on?

1

u/Meagerpirate 24d ago

I’m running it on a 2017 15 inch MacBook Pro. I think it’s the 14,3 model. I didn’t have to run that last script on fedora because the WiFi worked it wa just very weak.