Skip to main content

Linux On An Ancient Macbook Pro

Macs never die, sometimes you just wish they would, so you have an excuse to buy a new one.  This Macbook is a 2012 model with Retina display.  So it works very well indeed, but after 14 years, is not supported by Apple anymore.

I put a new battery in it, available from iFixit and now it will once again run all day on battery.  

There is a no nonsense Linux distribution, known as PCLOS, a distribution for Boomers and I guess I qualify!  https://www.pclinuxos.com/

PCLOS has no systemd and no SELinux or AppArmor, so it runs very fast and is excellent for antique machines.  

However, for best results, there are a few things to configure manually on an elderly Macbook Pro.

1. Enable scrolling on the touchpad:

# xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ bcm5974                                   id=11   [slave  pointer  (2)]
⎜   ↳ Genius Optical Mouse                      id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Apple Inc. Apple Internal Keyboard / Trackpad     id=10   [slave  keyboard (3)]

  # xinput list-props 11
Device 'bcm5974':
        Device Enabled (177):   1
        Coordinate Transformation Matrix (179): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (313):     1
        Device Accel Constant Deceleration (314):       2.500000
        Device Accel Adaptive Deceleration (315):       1.000000
        Device Accel Velocity Scaling (316):    12.500000
        Synaptics Edges (317):  -3898, 4428, 434, 6146
        Synaptics Finger (318): 70, 75, 0
        Synaptics Tap Time (319):       180
        Synaptics Tap Move (320):       535
        Synaptics Tap Durations (321):  180, 180, 100
        Synaptics ClickPad (322):       1
        Synaptics Middle Button Timeout (323):  0
        Synaptics Two-Finger Pressure (324):    283
        Synaptics Two-Finger Width (325):       7
        Synaptics Scrolling Distance (326):     243, 243
        Synaptics Edge Scrolling (327): 1, 0, 0
        Synaptics Two-Finger Scrolling (328):   0, 0
        Synaptics Move Speed (329):     1.000000, 1.750000, 0.016445, 0.000000
        Synaptics Off (330):    0
        Synaptics Locked Drags (331):   0
        Synaptics Locked Drags Timeout (332):   5000
        Synaptics Tap Action (333):     0, 0, 0, 0, 1, 3, 2
        Synaptics Click Action (334):   1, 3, 2
        Synaptics Circular Scrolling (335):     0
        Synaptics Circular Scrolling Distance (336):    0.100000
        Synaptics Circular Scrolling Trigger (337):     0
        Synaptics Circular Pad (338):   0
        Synaptics Palm Detection (339): 0
        Synaptics Palm Dimensions (340):        10, 200
        Synaptics Coasting Speed (341): 20.000000, 50.000000
        Synaptics Pressure Motion (342):        30, 160
        Synaptics Pressure Motion Factor (343): 1.000000, 1.000000
        Synaptics Grab Event Device (344):      0
        Synaptics Gestures (345):       1
        Synaptics Capabilities (346):   1, 0, 0, 1, 1, 1, 1
        Synaptics Pad Resolution (347): 92, 94
        Synaptics Area (348):   0, 0, 0, 0
        Synaptics Soft Button Areas (349):      0, 0, 0, 0, 0, 0, 0, 0
        Synaptics Noise Cancellation (350):     60, 60
        Device Product ID (305):        1452, 602
        Device Node (304):      "/dev/input/event12"

So, the magic is:
# xinput set-prop bcm5974 "Synaptics Two-Finger Scrolling" 1 1

Put a script in ~/.bashrc or bash_profile.

2. WiFi
The internal WiFi works out of the box, but it may die during an upgrade and then the only fix is to cycle power.
Alternatively, plug in an Edimax USB widget and configure it as WLAN1. If it would ever die, you can just yank it and put it back in.

3. Laptop Mode
Enable laptop-mode when on AC and when the lid closed, otherwise it may not be able to charge the battery. On this machine the battery status indicator bargraph works, but the text always says Fully Charged.

Edit laptop-mode.conf:
# vi /etc/laptop-mode/laptop-mode.conf

#
# Enable laptop mode when on battery power.
#
ENABLE_LAPTOP_MODE_ON_BATTERY=1
#
# Enable laptop mode when on AC power.
#
ENABLE_LAPTOP_MODE_ON_AC=1
#
# Enable laptop mode when the laptop's lid is closed, even when we're on AC
# power? (ACPI-ONLY)
#
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=1

4. Set Cmd keys to Control as well as the original Control keys:
System Settings
Keyboard
Keyboard
Click “Key Bindings”
Enable “Configure keyboard options”
Click Alt/Win Key Behaviour
Select Ctrl is mapped to Win keys (and the usual Ctrl keys)
Apply

5. Browsers
The Brave browser works better than the Firefox browser. It is faster and advertisements and pop-ups are blocked very effectively.

Since the Macbook Pro Retina display is very high resolution, the screen print is very tiny by default. Set the minimum display font size to 14 pt and the display zoom level to 150%, for a reasonable text size, or just press "Ctrl +" three or four times.

6. Fan speed control
I have found that the fans run too slow and the machine can overheat, causing your finger tips to feel warm.  If you ignore it, then the machine could suddenly blink a few times and shut down. This is obviously not good and needs a fix.

If you can find it, install mbpfan for automatic fan control on these old Macbooks.

Then edit /etc/mbpfan to set it a little cooler than the default:
low_temp = 50
high_temp = 60
max_temp = 85

Alternatively, set the fan speed manually in a little script in /etc/init.d to a speed that you can hear, but which is not too noisy:
echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
echo 1 > /sys/devices/platform/applesmc.768/fan2_manual
echo 6000  > /sys/devices/platform/applesmc.768/fan1_output
echo 6000  > /sys/devices/platform/applesmc.768/fan2_output

La voila!

Herman

Comments

Popular posts from this blog

OpenEMS with Octave and SciLAB

I wanted to do some advanced RF antenna development work and needed an electromagnetic field solver that is a bit more up to date than NEC2 .  Commercial solvers from Matlab , Ansys and others are hideously expensive (in the order of $20,000 to $50,000) and do not fit in the wallet of a hobbyist or a small consulting company.  Recently, openEMS became available and it fills the niche with a capable free tool.  In general, openEMS is a solver - a Finite-Difference Time-Domain (FDTD) numerical engine.  You interact with it through Octave , which is almost identical to Matlab .  You can watch a good video by Thorsten Liebig here: https://www.youtube.com/watch?app=desktop&v=ThMLf0d5gaE   Getting it to work is a little painful, but it is free, so bear with it - then save a backup clone, or a zipped copy of the whole virtual machine directory and NEVER update it, to ensure that it keeps going and doesn't get broken by future updates, right when you are ...

Parasitic Quadrifilar Helical Antenna

This article was reprinted in OSCAR News, March 2018:  http://www.amsat-uk.org If you want to receive Satellite Weather Pictures , then you need a decent antenna, otherwise you will receive more noise than picture. For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern .  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls. The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well ...

Yagi Antenna for 900 MHz ISM Band

I like tinkering with wire antenna designs, since they are simple and cheap to make.  Mr Yagi invented his antenna about 100 years ago, but there are still some things left to learn about it. 900 MHz ISM Band Yagi The 900 MHz ISM band ranges from 902 to 928 MHz.  Covering the whole band with a single Yagi antenna is difficult, since they are inherently narrow band devices.  Consequently some tweaking is required and the result below is a desensitized design that can be built and replicated quite easily, but you need a network analyzer - "To Measure, is to Know!" A Yagi generally consists of a Reflector, Radiator and one or more Director elements, arranged on a boom.  For a small Yagi, a wooden ruler works a treat, since one can easily mark the position of the wires.  The wire elements are fastened to the bottom of the ruler with hot glue.  The wire elements are  made from straightened out jumbo size paper clips.  The balun, is tw...