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 at the bottom of /etc/rc.d/rc.local to a speed that you can hear, but which is not too noisy:
/bin/echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
/bin/echo 1 > /sys/devices/platform/applesmc.768/fan2_manual
/bin/echo 6000  > /sys/devices/platform/applesmc.768/fan1_output
/bin/echo 6000  > /sys/devices/platform/applesmc.768/fan2_output

AND also add the same lines to the bottom of /etc/acpi/actions/lm_lid.sh

Then, simply let your finger tips tell you whether the machine is running cool enough.

La voila!

Herman

Comments

Popular posts from this blog

PCB Mill

PCB Mill Kit My latest toy is a small PCB Mill, a CNC 3018 Pro, there are many available from Ali Express for the enormous sum of 285 Dirhams or so, which is about 70 Euro.  I thought that even if it didn't work at all, it would not be a big loss. Assembled CNC 3018 Kit It will help if you have a little previous workshop experience, but these machines are so simple and relatively slow moving, that any radio-geek can safely experiment. Carving With a V-bit in a Puddle of Oil Of course I can have boards made in China by Dirty PCBs , but what is the fun in that? The problem with making PCB antennas, is that you need to experiment to change the design 1 mm this way or that, to tune it just so and just such and having to wait 2 weeks for each experiment doesn't work.  A few hours playing with a router is more practical. It turned out to be a pretty nice little kit, made from aluminium and 1/4 inch Bakelite (paper reinforced phenol formaldehyde).  This Pre...

Driving A 900 MHz Quad Patch Array Antenna

A Circular Polarized Quad Patch Array for the 900 MHz ISM Band Driving a patch array antenna is a tricky and multidisciplinary affair - a combination of electrics, magnetics and mechanics - where theory meets reality.  Patch antennas are useful between about 1 and 5 GHz.  Below that, they are too big and above that, too small to be practical for the manufacturing tolerances of a hobbyist.  For L, S and C-band, a radio amateur can use patches with good effect, using not much more than tin snips and a nibble tool. 902-928 MHz ISM Band LCP Quad Patch Antenna The patch antenna theory can be explored with a simulation program such as NEC2: https://www.aeronetworks.ca/2018/07/patch-antenna-design-with-nec2.html You could make an array with any number of patches, but more than four would be a whole lot of hassle.  A SAR radar antenna may have 300 tiny little patches.  However, a two by two is about the limit of my patience. Any piece of metal within half ...

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...