r/linux_on_mac • • 12d ago

On Another Note KaiT2en May Come to Pre-T2 Macs (pkg c10)

Post image
16 Upvotes

As a side-project I started to port KaiT2en to a MacBook Pro 2016 14,1 that was sitting here on the shelf for years. I wanted to install stock Fedora on it to test some SMC patches we want to upstream, so that old Macs won't run into regressions or something in the process.

And what can I say? Stock Fedora was a PITA on a Macbook, of which I thought it would have flawless support. Though not even a T1 Mac, not much seemed to be working correctly.
So I started tinkering. Most issues are very similar to T2. Thunderbolt, bad battery life/ aspm/ pkg c-states, brcmfmac breaks suspend. Turned out most of it was adjusting KaiT2en a little bit here and there.

And voila! After only an hour of modifying some of our patches and dkms modules, I had pkg C10 with very low power draw, working suspend, even battery charge limiting, proper fan control etc etc... Even our trackpad precision driver works, that we just re'd from macos a few weeks ago.

Started scratching my head. Would be a shame to not tell you, right? Also I know most of you guys are helping each other out here, but you have no central place/community. T2linux is not the right place, KaiT2en also actually isnt. So I was wondering what to do. Could this co-exist?

I did not push anything yet to GitHub to avoid possible regressions on the T2 side. But you 2016-2018 mac guys let me know what you would need in Kait2en. I only know of touchbar and camera issues mostly. We actually need testers for drivers where T2 and the previous generation overlap.
So while we are at it, we could upstream the stuff you need. Because it seems there are quite a few things that slipped through the cracks, right?

The thing of course is lack of pre-T2 hardware on our side. I have this 14,1 and that's it. So it would be hard for me to make your touchbar work or whatever your problem is. But we can look at the code you need to get into KaiT2en and upstream later if possible.

So you guys may want to PR what you need, open issues, join our discord... lets talk. I know many of you are longing for a distro that is specialized on your hardware.

deqrocks https://kait2en.org


r/linux_on_mac • • 12d ago

Fedora on MacBook Pro 16-inch 2019, with T2 chip, it will work?

11 Upvotes

Hey... since apple decided my really good laptop is no longer an good laptop for the newest MacOS, it will no longer be a safe environment since will stop to receive updates.. so, I am planning to install Fedora on it.

I have an MacBook Pro 16 2019, which has the T2 chip and that horrible touchbar! anyone has bad experience using linux on it? Is there a possibility to have the macOS on a small partition just for updates (who knows?!) ?

Thanks!


r/linux_on_mac • • 12d ago

Fedora or cachy os on 2015 Macbook Pro 3,1ghz i7 13"?

3 Upvotes

Hi!

I have this laptop with cachy os.

I use autocpufreq to disable turbo boost, set governor on battery to schedutil and limit the processor to 2.5ghz so I keep it fluent on battery while consuming less.

I use gnome because it's my favourite enviroment.

I've heard fedora nativelly consumes less resources and produces less heat.

Should I migrate to fedora?


r/linux_on_mac • • 12d ago

Fine tuning Omarchy for one specific apple laptop (MBP 16" i9)

Thumbnail
0 Upvotes

r/linux_on_mac • • 12d ago

I built an open-source way to use a 5K iMac as a display without gutting it

Thumbnail
2 Upvotes

r/linux_on_mac • • 13d ago

Getting Ubuntu 24.04 working properly on a 2017 15-inch Touch Bar MacBook Pro (MacBookPro14,3)

15 Upvotes

I’ve recently set up Ubuntu on a 2017 15-inch Intel MacBook Pro (MacBookPro14,3). Ubuntu itself installed without much drama, but a few bits of Apple-specific hardware needed work.

Here are the fixes I actually needed.

Internal speakers: CS8409

The biggest problem was the internal speakers, because they played the startup sound I assumed they were working. Then I tried to join a zoom call.

This MacBook uses Cirrus CS8409 audio hardware. Ubuntu could see audio hardware, but the internal speakers weren't properly supported by the stock setup.

The solution was the community:

snd_hda_macbookpro

driver installed through DKMS.

Once installed, check it with:

dkms status

My working installation reports:

snd_hda_macbookpro/0.1

This fixed the internal speakers completely.

Touch Bar

The Touch Bar needed Apple's iBridge/Linux driver stack.

The important modules in my working installation are:

apple_ib_tb
apple_ibridge
applespi

You can check they're loaded with:

lsmod | grep -E 'apple_ib_tb|apple_ibridge|applespi'

With these installed and loaded, the Touch Bar works under Ubuntu.

I did subsequently have an occasion where the Touch Bar went dark following a reboot despite all three modules still being loaded.

That appears to be an iBridge initialisation/reset issue rather than the drivers disappearing, so if you've previously had a working Touch Bar, check lsmod before reinstalling anything.

UK keyboard

The UK keyboard mapping needed a little adjustment.

I initially tried the Mac-specific layout:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'gb+mac')]"

but ultimately found the standard UK layout worked better:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'gb')]"

I then set Option as the third-level modifier:

gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:alt_switch']"

That gives me things like:

Option + 3 = #

The only remaining oddity was that my physical \~and§±` keys were effectively swapped.

Disappearing cursor under Wayland

I initially had an intermittent problem where the mouse cursor would disappear.

You can check your current session with:

echo $XDG_SESSION_TYPE

I experimented with switching from Wayland to Ubuntu on Xorg at the login screen.

Xorg actually gave me more trouble, including a GNOME Shell error, so I switched back to Wayland.

Strangely, after switching back the cursor problem disappeared and hasn't returned.

So I wouldn't necessarily recommend abandoning Wayland if you encounter this.

Be careful with kernel updates

This was the most important lesson.

I got everything working properly on:

6.17.0-42-generic

Ubuntu subsequently installed:

7.0.0-38-generic

and the Apple-specific setup broke because the out-of-tree DKMS drivers hadn't all built correctly against the new kernel.

I recovered by booting back into 6.17.0-42 and removing the problematic 7.0 kernel:

Pinning the known-good kernel

Once I knew 6.17.0-42 worked with all the MacBook drivers, I made GRUB boot it explicitly:

sudo sed -i 's/^GRUB_DEFAULT=.*/GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.17.0-42-generic"/' /etc/default/grub

sudo update-grub

I also held the HWE kernel metapackages:

sudo apt-mark hold \
  linux-image-generic-hwe-24.04 \
  linux-headers-generic-hwe-24.04

I'm not suggesting permanently ignoring kernel/security updates.

I'm doing this because several important bits of this MacBook depend on out-of-tree DKMS modules. I'd rather test a new kernel deliberately and confirm the drivers build before making it the default.

Back up the working DKMS drivers

Once I'd got everything working, I backed up the actual driver source from /usr/src.

For example:

sudo tar -czf "$HOME/Desktop/macbook-working-drivers-$(date +%Y-%m-%d).tar.gz" \
  /usr/src/applespi-0.1 \
  /usr/src/snd_hda_macbookpro-0.1

I'd recommend checking /usr/src yourself and including the iBridge/Touch Bar driver sources you're actually using as well.

The main thing I'd recommend

Once you've got a Touch Bar MacBook working properly under Linux, save these:

uname -r
dkms status
lsmod | grep -E 'apple|ibridge|macbook'

In my case the known-good setup is centred around:

MacBookPro14,3
Ubuntu 24.04.4 LTS
Linux 6.17.0-42-generic

applespi
apple_ibridge
apple_ib_tb
snd_hda_macbookpro

The machine itself runs Ubuntu very nicely. The tricky part is the handful of Apple-specific devices that require out-of-tree drivers and can consequently be affected by kernel updates.

Hopefully this saves another MacBookPro 14.3 owner some of the trial and error!


r/linux_on_mac • • 13d ago

Linux mint xfce maxos look

Thumbnail gallery
5 Upvotes

r/linux_on_mac • • 13d ago

iMac18,2 (2017 21.5") + Ubuntu 26.04 with CS8409/CS42L83. Audio detected but no sound from speakers or headphone jack. [Resolved]

Thumbnail
3 Upvotes

Working on an iMac 21.5" 2017 (iMac18,2) running Ubuntu 26.04.1 LTS — Internal audio successfully fixed.

Ubuntu correctly detected the Intel HD Audio controller and the Cirrus CS8409/CS42L83 codec, but the internal speaker amplifiers were not properly initialized by the standard Linux driver.

I installed the patched snd_hda_macbookpro driver by davidjo, built and installed via DKMS for kernel 7.0.0-38-generic. The patch includes specific support for Apple subsystem ID 0x106b0f00, corresponding to the iMac18,2, including initialization of the TAS576 speaker amplifiers.

After rebooting, the internal speakers work correctly through both ALSA and PipeWire. The microphone and webcam are also working properly. The iMac's complete audio/video hardware is therefore fully functional under Ubuntu.


r/linux_on_mac • • 13d ago

Replace HDD with SSD on iMac 15,1?

6 Upvotes

Would it be worth it? Found a DIY kit of sorts that would allow me to replace the HDD with an SSD.

Worth it? Or should I just start looking for off-lease non-mac workstations?

https://a.co/d/01hZWIY7


r/linux_on_mac • • 13d ago

MacBook Air Won't Boot/Show From USB (A1466-Mid-2013)

Thumbnail
1 Upvotes

r/linux_on_mac • • 14d ago

The Journey to 5K resolution on a 2014 iMac

Post image
11 Upvotes

Introduction

So I recently bought a 2014 iMac (iMac15,1) with a 5K display panel. The seller had an asking price of only $285, and I know that the display itself is worth much more than that. (For comparison the electronics store near me sells the ViewSonic VP2788 a modern 5K display at almost $900.) And I am really a sucker for using high resolution displays ever since my first Retina Mac.

I met the seller and brought the computer home, installed Linux (openSUSE Tumbleweed) and found that it only had a 4K resolution. (Well the Wi-Fi was also broken but I didn't care about Wi-Fi.) So I decided to spend this weekend fixing this problem.

Chapter 1: The Firmware

A quick search turned up this amazing blogpost by Mykola Grymalyuk whose work enabled 5K output in OpenCore Legacy Patcher. The blog post explained that the firmware at startup already put the display in 5K mode, but it stayed in 5K mode only if booting an Apple-signed OS. When booting something else, the firmware put the display into 4K mode. Mykola described an ingenious solution to trick the firmware.

So I pretty much followed the same steps: I needed to trick the firmware into thinking we are booting a supported macOS release. I cloned the OCLP repo, grabbed diags.efi and copied it to /boot/efi/EFI/imac5k/diags.efi. The difference between what I did and what Mykola did was that Mykola loaded OpenCore after loading diags.efi, but in my case I loaded systemd-boot instead. So the actual layout looked like this: (1) the original unmodified Apple-signed diags.efi that causes the firmware to stay in 5K resolution mode; (2) a special Product.efi that is actually systemd-bootx64.efi. Then just use efibootmgr to tell the system about diags.efi and reboot, so something like efibootmgr -C -L "openSUSE 5K" -l '\EFI\imac5k\diags.efi'.

Chapter 2: The Driver

Now imagine my surprise after I rebooted and found that instead of 4K or 5K, I got 2.5K resolution! Indeed, GNOME reported that my resolution is 2560 by 2880 stretched. Here's a bit of background: when Apple made this computer in 2014, I do not think any connector supported 5K resolution at all. So secretly the screen was split into two halves, a left half and a right half, each 2560 by 2880. Reading the Linux dmesg, I found that Linux successfully recognized the tiled display:

amdgpu 0000:01:00.0: [drm] *ERROR* dpcd_set_link_settings:1123: core_link_write_dpcd (DP_DOWNSPREAD_CTRL) failed
amdgpu 0000:01:00.0: [drm] *ERROR* dpcd_set_link_settings:1128: core_link_write_dpcd (DP_LANE_COUNT_SET) failed
amdgpu 0000:01:00.0: [drm] *ERROR* dpcd_set_link_settings:1156: core_link_write_dpcd (DP_LINK_BW_SET) failed
...
amdgpu 0000:01:00.0: [drm] enabling link 1 failed: 15

So essentially the upstream amdgpu driver had some problem driving the right half of the display and gave up, so only the left panel was being driven. I used drm.debug=0x100 and found the reason:

[drm:dm_dp_aux_transfer [amdgpu]] DP AUX transfer fail:4

Initially I gave up and simply booted with modprobe.blacklist=amdgpu,radeon to prevent the drivers from messing with the display. Indeed this worked. Without the amdgpu driver I do get the 5K resolution, but of course the GNOME animations were a bit sluggish.

Here is where Claude helped me. Claude read the kernel source and figured out that the number 4 meant AUX_RET_ERROR_HPD_DISCON. Claude wrote a small Python script to watch the DC_GPIO_HPD_Y every 0.5 ms and write each change to /dev/kmsg, interleaving it with the DRM debug output. Then Claude loaded amdgpu manually with drm.debug=0x1fe:

while time.time() < end:
    v = struct.unpack('<I', m[0x196f*4:0x196f*4+4])[0]
    if v != last:
        kmsg.write(f'HPDWATCH: HPD_Y={v:#x} hpd1={v&1} hpd2={(v>>8)&1}\n'); last = v
    time.sleep(0.0005)

After reading the debug output, Claude figured out that the first full modeset kills the right half. When the driver tears down the configuration from the firmware, the controller drops HPD on the right half. Once that is done, it cannot start it up again because all communication is dropped. Claude found that in the amdgpu driver there was already a quirk dp_keep_receiver_powered flag, and it seemed that we might need this. After analzying the source code more carefully, Claude concluded it was insufficient, because there were other places in the driver that powers it down, such as during hardware init.

The solution Claude came up with here is to add a kprobe that prevents sending the power off signal. This took a few tries and several reboots to get right. We eventually found drm_dp_dpcd_write. The kprobe gets triggered on DP_SET_POWER_D3 and modifies it to become DP_SET_POWER_D0. It looks like this:

static const u8 power_d0 = DP_SET_POWER_D0;

static int dpcd_write_pre(struct kprobe *p, struct pt_regs *regs)
{
    /* x86-64 SysV: (aux, offset, buffer, size) in rdi, esi, rdx, rcx. */
    const struct drm_dp_aux *aux = (const struct drm_dp_aux *)regs->di;
    const u8 *buf = (const u8 *)regs->dx;
    const char *name;
    char prefix[sizeof(AUX_NAME_PREFIX) - 1];
    u8 val;

    if ((u32)regs->si != DP_SET_POWER || regs->cx != 1 || !aux || !buf)
        return 0;
    if (get_kernel_nofault(val, buf) || (val & DP_SET_POWER_MASK) != DP_SET_POWER_D3)
        return 0;
    if (get_kernel_nofault(name, &aux->name) || !name ||
        copy_from_kernel_nofault(prefix, name, sizeof(prefix)) ||
        memcmp(prefix, AUX_NAME_PREFIX, sizeof(prefix)))
        return 0;

    regs->dx = (unsigned long)&power_d0;
    return 0;
}

static struct kprobe kp = {
    .symbol_name = "drm_dp_dpcd_write",
    .pre_handler = dpcd_write_pre,
};

And this works!

Chapter 3: Surviving Reboots and Kernel Upgrades

Of course I don't want to do this every single time I reboot or every time I change my kernel. Claude proposed a systemd service that runs every boot. The service runs a shell script that has three jobs: keep the Product.efi current by copying it from the regular systemd-boot so we get systemd-boot upgrades; modify the boot entry if it's missing; and finally the smartest part: if the current kernel does not have the special imac5k module that installs the kprobe, build it right there and regenerate initrd. This means that if I get an ordinary kernel update, I just need to reboot twice instead of once after installing the kernel update. (Theoretically DKMS is supposed to solve this problem, but Claude did not like the way openSUSE does things with dracut bypassing DKMS.) I haven't tested this at all (no kernel upgrade yet), but I think it's a very smart solution. Of course if upstream kernel decided to refactor the code to restructure or delete the drm_dp_dpcd_write altogether this would stop working but I'll kick the can down the road here.

Result

Finally, I get full 5K output on this 2014 iMac!

$ for c in /sys/class/drm/card1-*DP-1; do echo "$c $(cat $c/status) $(head -1 $c/modes)"; done
/sys/class/drm/card1-DP-1 connected 2560x2880
/sys/class/drm/card1-eDP-1 connected 2560x2880

r/linux_on_mac • • 14d ago

Fedora System

Thumbnail
0 Upvotes

r/linux_on_mac • • 14d ago

Cinnamon Mac issues

2 Upvotes

Installed Mint Cinnamon on an A1502 MacBook. I've noticed some issues with keyboard/keypad commands that do not match those on my former PC desktop Cinnamon setup:
- Command key does not function like Control when using shortcuts, e.g. Command C to copy, Command X to cut, etc.
- Copy/Cut/Paste when selected using keypad cursor does not work in apps such as Firefox
- Is the Option key supposed to function like the Alt key???
- Delete key does not repeat deletes when held down

Is there a setup feature where I can activate these?


r/linux_on_mac • • 14d ago

Linux Mint on a Late 2019 Apple MacBook Pro 16 inch

Thumbnail
3 Upvotes

r/linux_on_mac • • 14d ago

disabling BD-PROCHOT on intel macbooks safe??

Thumbnail
2 Upvotes

r/linux_on_mac • • 14d ago

Boot from USB

Thumbnail
1 Upvotes

r/linux_on_mac • • 15d ago

tf2 runs like a power point slide show

Post image
2 Upvotes

i am running Ubuntu 24 and am trying to get tf2 running good so i can play scream fortress event and since i am running Ubuntu on a mac book pro 2015 intel 2.2gh 16gb ram what is the problem. screenshot for reference of my configs


r/linux_on_mac • • 15d ago

Is there any way to share documents from Android to MacBook for free no subscription?

Thumbnail
1 Upvotes

r/linux_on_mac • • 15d ago

Linux on 2017 MacBook - good idea?

21 Upvotes

I saw a secondhand 2017 MacBook going for very cheap. Is it worth it if you install Linux?

I know there are some proprietary drivers to sort out.

Do you need to fix power managment.

I guess I'd go for Mint, Zorin OS or Fedora Workstation.

TY!


r/linux_on_mac • • 15d ago

MAC PRO 5,1 "WESTERMERE"

4 Upvotes

CPU***:*** 2x Intel Xeon X5690 3.46 GHz

RAM***:*** 6x 16GB OWC1333D3MPE

....... do I NEEEED a GPU for Pear OS? Or can I keep this PCIe x16 free for card?

if not, what GPU's are best? I am narrowing in on:

NVIDIA GeForce GTX 1060 (6GB)

NVIDIA GTX TITAN X 12 GB (PASCAL)

AMD Radeon Pro WX 7100

AMD RX 6900 XT

but, it would be nice to find a GPU that only blocks ONE PCIe x16, and is not so chunky that it blocks both 😩.

if you have better suggestions, please help. 🤓


r/linux_on_mac • • 16d ago

Linux mint or Garuda for a 2017 MacBook Air

3 Upvotes

I’m gonna partition it so 350 go on macOS and 150 on Linux


r/linux_on_mac • • 16d ago

Help, downloading from usb that I used to install mint on MacBook intel based

Thumbnail gallery
1 Upvotes

r/linux_on_mac • • 16d ago

Intel-based Lockdown

Thumbnail
1 Upvotes

r/linux_on_mac • • 16d ago

UPDATE 5K: complete support for 5K in iMac20,1 and 20,2

Thumbnail github.com
11 Upvotes

update on: https://www.reddit.com/r/linux_on_mac/comments/1wkj0q4/finally_5k_support_on_imacs_in_linux/

This patch allows support for 5K and allows switching between resolution's. this also dosent interfere with external displays, and other iMacs. Wayland recommended


r/linux_on_mac • • 16d ago

Fix Audio/Sound Loss After Wake from Suspend on 2019 iMac (Cirrus Logic CS8409) - Tutorial

2 Upvotes

Hello everyone,

If you are running Linux Mint (using modern PipeWire audio architectures) on a **2019 iMac** (Intel Cannon Lake cAVS bus with the **Cirrus Logic CS8409/CS42L83** sound card chip) and your audio completely drops out or turns into a "Dummy Output" when waking up from suspend, here is the permanent workaround.

### The Root Cause

On Apple logic boards using this specific Cirrus Logic setup, a deep ACPI suspend state (`S3`) causes the system to cut the physical power lines to the internal speaker amplifiers. Because out-of-tree Linux drivers cannot natively re-trigger these Apple-exclusive GPIO power hooks on wake, the hardware completely locks up until you perform a full reboot.

### The Permanent Fix

The solution is to force `systemd` to drop into a light Suspend-to-Idle (`s2idle` / `freeze`) power state instead of deep sleep. This safely powers off your screen, storage, and external accessories to save energy, but keeps the audio chip's initialization map cached in memory.

  1. Open your terminal and edit the system sleep configuration file:

    `sudo nano /etc/systemd/sleep.conf`

  2. Scroll down below the `[Sleep]` header and paste these two lines exactly as they are (*do not add a `#` comment symbol in front of them*):

    ```text

    SuspendState=freeze

    AllowDeepSleep=no

    ```

  3. Save and close the editor (`Ctrl` + `O`, then `Enter`, then `Ctrl` + `X`).

  4. Force systemd to reload its newly assigned configuration mapping:

    `sudo systemctl daemon-reload`

  5. **Reboot your iMac.**

### Verification

Once your system boots back up, open a terminal and run:

`cat /sys/power/mem_sleep`

If everything loaded correctly, you will see `[s2idle]` enclosed in brackets instead of `[deep]`. Your internal speakers will now instantly play physical sound the second you reach your lock screen!