mbpfan-josie

304 commits
3 branches
0 tags GPL

mbpfan-josie

This is my fork of mbpfan, itself an enhanced version of Allan McRae mbpfan.

This fork is focused on Gentoo Linux on older Intel Macs. My current machine is a MacBook Pro 11,4 (Retina 15", mid-2015), so that's what I test on. The board is a Mac-06F11FD93F0323C5, the i7 4770HQ/16GB RAM/Intel Iris Pro 5200 one (I swapped out the stock Radeon dGPU one due to issues at the time with older AMD cards on Linux).

Other distributions and Mac models are not supported or tested by this fork. If you need broader support, use upstream mbpfan.

Requirements

  • Gentoo Linux with OpenRC (the primary target).
  • Kernel modules applesmc and coretemp.
  • Root privileges to run the daemon.

Load the modules at boot with OpenRC:

# /etc/conf.d/modules
modules="applesmc coretemp"

If you use systemd on Gentoo instead, the installed /etc/modules-load.d/mbpfan.conf loads coretemp; add applesmc there too if your kernel does not autoload it.

Build

make

This produces bin/mbpfan and bin/mbpfan-tests.

Install

sudo make install

Installs:

  • /usr/sbin/mbpfan
  • /etc/mbpfan.conf
  • /etc/init.d/mbpfan (OpenRC)
  • /etc/modules-load.d/mbpfan.conf
  • /usr/share/doc/mbpfan/README.md
  • /usr/share/doc/mbpfan/COPYING
  • /usr/share/doc/mbpfan/COPYING.LESSER
  • /usr/share/man/man8/mbpfan.8.gz

Run

Foreground:

sudo mbpfan -f -v

As an OpenRC service:

sudo rc-service mbpfan start
sudo rc-update add mbpfan default

Configuration

Edit /etc/mbpfan.conf. See the comments in that file for the temperature thresholds and fan speed overrides. Send SIGHUP to reload the configuration.

Tests

sudo make tests

The tests read the real applesmc/coretemp sysfs paths, so they only pass on supported Mac hardware.

License

GPL-3.0-or-later. See COPYING.

Bundled settings and strmap code is LGPL-3.0-or-later by Per Ola Kristensson; see COPYING.LESSER and the notices in the source files.

Credits

Based on:

Uses Per Ola Kristensson's ANSI C settings/strmap.

AI use: I use LLMs for code generation and troubleshooting. Usually local Qwen instances or DeepSeek via OpenRouter.