Macports error on OSX High Sierra

If you updated to high sierra and are reinstalling your ports, you may run into:

--->  Building osxfuse
Error: Failed to build osxfuse: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_fuse_osxfuse/osxfuse/main.log for details.

Look in that main.log

:debug:build Failed to locate 'lbzip2' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?

There’s an unlisted requirement of lbzip2. Install it.

$ sudo port install lbzip2

After installing lbzip2, try to install the package again, then check the main.log

:info:build /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle, 9): Library not loaded: @rpath/libclang.dylib (LoadError)

Chances are it failed with the above error. Basically, the build script couldn’t find the libclang library. There is some in-depth discussion on the cause and workarounds at: To fix this, we’re going to add an aditional symlink to the library, as Xcode has a broken address for the library by default.

$ sudo ln -s /Applications/ /usr/local/lib/libclang.dylib

Once the symlink is created, install your failed ports again. In future you may need to remove the link as it may interfere with other builds once Apple’s Xcode is fixed.

Wireless card stops working on Linux

2 Tips, especially for ath9k users:

Tip 1 – Unload and Reload your driver

Have you tried turning it off and turning it on again? No, seriously. Unload and reload the driver. I had an ath9k card that would work again for hours after doing this:

$ modprobe -r ath9k
$ modprobe ath9k

Eventually it stopped working and I replaced it with a D-Link DWA-131. I could have tried tip 2 first:

Tip 2 – Turn off hardware encryption

The parameter name varies between drivers, but the method is largely the same:

Create/Edit driver options file:

$ sudo nano /etc/modprobe.d/ath9k.conf

Put contents:

options ath9k nohwcrypt=1

Then reboot.

MX83 Ignition switch contacts and starter relay mod

After identifying and replacing the starter solenoid contacts in my mx83 I still had intermittent starting problems.

Voltage drop at the starter solenoid, but not other circuits, indicates a fault in the starter solenoid circuit. When powering the starter solenoid directly from the battery with a test wire it pulled in hard without a problem.

Older Toyotas don’t run a starter relay, Instead they run all the starter solenoid power through the ignition and neutral switches. Over time the copper contacts degrade, the grease dries out, and the wiring goes high resistance. Once this occurs the circuit can’t deliver the 10-15A required to pull the solenoid in.

There are fixes for this:

  • Replace or clean the ignition switch
  • Replace or clean the neutral switch
  • Test all the wiring
  • Install a starter relay

All the detailed information for these is available elsewhere, I’ll post links and list some pointers:

Replace or clean the ignition switch

Unless yours is totally ruined (cracked case or worn through contacts) don’t replace it.

This section is now updated with my own photos and more instruction. Older Toyota forums are sadly disappearing, this is relevant for old Celicas, Corollas, Camrys, Supras, Taragos, Previas, etc.

  1. Take the ignition switch out
  2. Pry each leg of the white case up very gently, it’s brittle.
  3. Note: Be careful when disassembling, the black plastic carrier is loaded with springs and balls for the detent of the switch. It shoots apart. You don’t need to take it out of the housing.
  4. Take the contacts off the carrier
  5. Wipe the contacts (including the posts) clean with brake cleaner or similar
  6. Lightly sand the contacts and apply fresh dielectric grease
  7. Clip back together and reinstall


  • Don’t worry about putting match marks on the case – it can only clip together one way – that’s why all the clips/legs of the case are different sizes.
  • Don’t worry about the orientation of the contact discs – between the square and round locating tabs they can only go in one way.

This helped a lot, but didn’t 100% solve my problem.

Replace or clean the neutral switch

When they go bad jiggle the shifter in park or neutral and see if it starts. It can be cleaned like the ignition switch, but it’s under the car and will need the shift linkage removed to get it out. Refer to TSRM for lining up the switch when reinstalling.

Although I could not find a specified resistance in the TSRM, my resistance was low and the problem persisted with the switch bypassed.

Test all the wiring

Make sure you’re getting power at the solenoid. Visually inspect the starter and gearbox wiring harness for damage. The next step would be to pull out your dash. Unless you have no power at the solenoid, don’t hunt wiring.

Edit: US spec cars have an immobilizer and a starter relay. The immobilizer switches signal ground on the relay. The wiring diagram (TEWD) is available online (Link updated Aug ’18).

Install a starter relay

The mx83 is conventional, but it will need to pass a small amount of current through the relay coil, as the ECU’s neutral switch sense circuit normally grounds through the starter coil. I used a normal automotive relay and it was fine.

Image from linked article

  • I like how short the wiring is and the grounding of the relay.
  • I recommend a fused relay. I used a 30A rated relay with an inbuilt fuse holder, swapped down to a 20A fuse.
  • Put it in a position where it’s not going to get wet, oily, or dirty
  • Observe the high current feed into the relay is unfused, make sure the connector isn’t going to slip off or shake loose.
  • Use fully insulated spade connectors which fit super snug on the relay and solenoid terminal.

MX83 Cressida starter solenoid contacts

My starter solenoid contacts wore out. Here is info for a Cressida/Crown/Supra with a denso starter.


Although the denso starter solenoids are fairly common, I wanted to make sure I was ordering the right parts. Many rebuild kits on ebay and amazon are vague in their application list, and vague is never good.

I checked my part number of my starter solenoid as 28150-41060 as used on 5M, 6M, 7M, RZ engines. As I couldn’t find a rebuild kit listing exactly that part number, I took it apart and here are the dimensions I measured:

  • ~20.65mm Plunger body diameter
  • ~36.8mm Plunger ring contact diameter
  • ~96.65mm Overall rod length including top hat
  • 8mm diameter terminal posts outside the body of the solenoid
  • Extended wing (‘C’ shape) contacts – ~21.5 mm wide. Type 1 on the photo below:


This is valid for 28150-41060 only. If yours is a different P/N I encourage you to measure it – you need to take it apart anyway. When getting a kit, make sure to get one that includes a plunger, as the ring on it is a wearing contact too.