Categories
Hardware Software

Updating a Legacy MacBook Air to Manjaro Linux

I’ve got a 2015 MacBook Air version 7,2 which had been sitting on the counter for a few months untouched. My daughter was the last one to use this laptop and that was primarily for YouTube videos. Since she got her iPad for her birthday there hasn’t been much of a need of the MacBook. Never to let a perfectly good laptop go to waste. I had one the latest MacOS’s on it, but it wasn’t the latest. It was also a bit slow if you ask me. It’s a Core i5 2.5 Ghz with 8 GB of mem and a 128 GB SSD. So not a powerhouse, but a nice little laptop.

I run Manjaro Linux on my desktop PC so I am familiar with Arch and I had an installer USB ready. First thing I did was boot from the USB (you need to hold down the alt key while booting) to see if Manjaro would run. The “Live CD” version on the installer seemed to work great but no Wifi or networking. Of course, the installer needs wifi to update. I figured out that I could plugin my mobile phone via USB and it would provide networking support via the tether. I installed Manjaro and updated with all basic setting. Full wipe and install. I rebooted and happily it started without issue.

After a big smile an relief, I went about checking all the hardware to make sure everything was working. Arch Linux has a great webpage on installing and configuring Arch on MacBooks. The only bit of hardware that didn’t work was the web-camera. I followed this article to download, compile and install the required kernel module to use the web-cam. Remember that you must have kernel headers for your kernel loaded for the compilation to work! The first few times I’ve installed kernel modules in Manjaro/Arch, I’ve forgotten to install the proper kernel headers so it didn’t work properly. Anyways, I tested with the Cheese app after a quick reboot to ensure that everything was working fine.

Next, came the keyboard. I chose typical default US keyboard layout. Most of the function keys worked fine, volume, start/stop, mute, screen brightness and keyboard backlight brightness. Two function keys didn’t work out of the box. Those were for Expose and Mac Applications list. I went into Keyboard shortcuts and remapped the Expose key to Screenshot capture interactive since I don’t have a print key on this keyboard. I remapped the Applications function key to show all desktops in Gnome. Oh, by the way, I forgot to mention that I’m running Gnome 42 on Manjaro. You can choose different window managers/desktop environments for Manjaro and I’m most comfortable in Gnome from my days in Pop _OS and before.

Lastly, the trackpad, oh the trackpad. It was just frustrating to me that I was randomly doing right mouse clicks based on the location I clicked on the trackpad. My work laptop does this as well and it really bothers me. I like to click with my thumb on my right hand and it’s not always comfortable to go on the left side of the trackpad. I found the following Gnome setting that you must run in the terminal to change from “areas” clicking to “fingers”. Fingers means two fingers on the trackpad to right click which is way more natural for me.

gsettings set org.gnome.desktop.peripherals.touchpad click-method 'fingers'

Update 21-Aug-22: I’ve also added the mbpfan service to autostart on my MacBook Air running Manjaro Linux. More details on mbpfan here. This service uses the coretemp and applesmc kernel modules to read the system temp and ramp up the internal (puny) fan. I have also installed a few of Luke Smith’s voidrice utility scripts to monitor the weather forecast and system temperature from the menu bar. More details at https://lukesmith.xyz

Categories
Software

Building Asterisk from source + Cisco SoftKeys

I’ve had a collection of Cisco IP telephones setup in my home for a few years now. It was a covid-lockdown hobby project of mine to figure out how they work and get them setup. Literally 10’s of hours of being stumped trying to get a dial-tone out of them. I started with Cisco 7940 telephones (I have about a dozen of them), then I moved onto 9971 and 9951’s (I have 4 of them) and lastly I’ve moved to Cisco 8831’s (I have 3 of them). All phones I purchased used from Goodwill and the last set of phones seemed to come from a Mortgage broker (or something, I didn’t do too much research). Anyways, I wiped and cleaned the phones and created fresh SEP.cnf.xml files. For those that don’t know, Cisco Call Manager is the default PBX application that powers these phones in industry and it’s obviously propriety and heavy (aka bloat). In Cisco Call Manager, there are GUI’s for everything, so it would be relatively easy (I guess) to use but I never wanted to use it. I built my own PBX directly from Asterisk which is free (as in freedom). I originally used Ubuntu packages for Asterisk and then I switch to running it on a FreeBSD jail using the awesome FreeBSD package repositories and finally I switched to running it in an LXC container inside Proxmox running base Arch Linux. I used the equally awesome AUR (Arch User Repository) to install the Asterisk-cisco package (requires enabling AUR and in my case installing yay and all dependencies).

AUR asterisk-cisco
AUR package I compiled and installed

After I installed the package, I enabled the asterisk service in systemd — systemctl enable asterisk. I copied my sip.conf and extensions.conf configuration files from my previous Asterisk installation and restarted the LXC container to ensure it started up correctly. I connected my Cisco 8831 phone and did a quick call to test while I was watching the Asterisk console and voila it worked! Test call successful *BUT* the softkeys for Messages for instance still didn’t work ;-( These SoftKeys are the exact reason why I wanted to compile Asterisk from source with the brilliant usecallmanager.nz Asterisk source code patch. When I dug a bit further in the AUR package notes I saw the example configuration files that need to be copied to the TFTP server for the phones to consume and configure themselves at boot time. I copied the example files to my TFTProot filesystem on my ASUS wifi router. I then edited my SEP.cnf.xml configuration file and added the following section:

  <phoneServices useHTTPS="false">
    <provisioning>2</provisioning>
    <phoneService type="1" category="0">
      <name>Missed Calls</name>
      <url>Application:Cisco/MissedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="1" category="0">
      <name>Received Calls</name>
      <url>Application:Cisco/ReceivedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="1" category="0">
      <name>Placed Calls</name>
      <url>Application:Cisco/PlacedCalls</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
    <phoneService type="2" category="0">
      <name>Voicemail</name>
      <url>Application:Cisco/Voicemail</url>
      <vendor></vendor>
      <version></version>
    </phoneService>
  </phoneServices>

When I added this PhoneService stanza to my config xml file and then restarted the phone then everything worked! I’m sure a bunch more tweaking needed to “dial in” or “rice” my phone configuration. But, initial success for a Saturday with this project. I now have a working Asterisk IP telephone configuration with freshly firmware updated Cisco IP Telephone 8831 (black and white screen sadly) where the SoftKeys for Messages and Recent Calls work when using Asterisk as a PBX software!

Next steps will be to continue to rice my config and look for Cisco IP Telephone 8861’s which are a color screen and a bit newer. I’ve used 8861’s at work before and I like that phone, a very sharp and colorful display and they have a feature I think that you can do a redirection to mobile phone when away from the desk. Maybe I can get something similar working in my home.