MacBookAir (6,2) on Ubuntu 15.10 (Wily Werwolf)

This page aims to describe the steps needed, to fully enable all features of the 6-th Generation MacBookAir (release date: mid 2013) when using Ubuntu 15.10, Wily Werwolf.

You can find out, what model you have by typing at the terminal:

sudo dmidecode -s system-product-name

If you have a different model, please go here and find the right wiki.

Overview

Anything not mentioned here probably already works out of the box. If not, please refer to the Ubuntu Apple Users forum.

Feature

Support status

LCD Panel

works

Suspend & Hibernate

needs manual install. See Backlight

Shut-down and Reboot

works

Keyboard functions (Brightness,volume,...)

works

Touchpad (appletouch)

works

Wireless (AirPort)

needs manual install. See Wireless (AirPort)

Bluetooth

works

iSight

won't work

Sound

works

Microphone

works

External Monitor

works

Thunderbolt 

not yet documented

 SD card slot 

works

HFS+ (OS X disc partition) 

works (mounts read-only)

 Fan Control 

works (according to tlp stat)

 Sensors (temps & fans) 

works (according to tlp stat)

 GPU Power Save 

 works 

Basic Installation Instructions

Common things about installing and maintaining Ubuntu on Intel-based Macs: Intel CPU-based Macintosh Generic Installation Instructions

Prerequisites

1. MacBookAir6,2

  • Check on OSX with:
    sysctl hw.model
    Check on linux with:
    sudo dmidecode -s system-product-name

2. Apple USB-Ethernet Adapter

3. USB-Stick (2GB at least)

4. ubuntu-15.10-desktop-amd64.iso.

Partition Harddisk

1. Boot Macbook Air into OSX

2. Open Disk Utility

  • open /Applications/Utility/Disk\ Utility.app

3. Select "Macintosh HD" \> (Tab)Partition

  • Add (+) 3 more partitions 2nd Partition: Set 30-40GB for Ubuntu "/" 3rd Partition: Use as much space as left for "/home" 4th Partition: Set 4GB for Linux Swap partition

Prepare USB-Stick

1. In OS X

2. Download iso image to ~/Downloads

3. Open Terminal (a detailed description can be found here.

  • cd ~/Downloads
    # convert iso
    hdiutil convert -format UDRW -o ubuntu-15.10-desktop-amd64.img ubuntu-15.10-desktop-amd64.iso
    
    # open Disk Utility to format USB stick
    open /Applications/Utilities/Disk\ Utility.app
    # format the USB stick with MS-DOS VFAT
    
    # check which /dev/diskX contains the USB stick - here it is "disk1"
    diskutil list
    # then unmount the usb-stick
    diskutil unmountDisk /dev/disk1
    
    # write img to usb stick - /!\ BE CAREFUL THAT disk1 REALLY IS YOUR USB-STICK
    sudo dd if=ubuntu-15.10-desktop-amd64.img.dmg of=/dev/rdisk1 bs=1m

Install Ubuntu

1. Restart and press "Alt"-Key on startup.

2. Make sure that the USB-Ethernet Adapter is inserted.

  • (With a network connection the bcmwl-kernel-source module does **NOT** get downloaded during the installation process.) Select first USB-device labled "EFI-Boot" and press "Enter". Select "Install Ubuntu"

3. Choose "Something else" for partitioning.

  • Please check the sizes in the list according to the partitioning for the step above. OSX Disk Utility leaves unallocated partitions inbetween which usually are arround 128MB in size. Do not try to delete these "blank" partitions. - 2nd partition should be ext4 formatted and mounted "/". - 3rd partition should be ext3 formatted and mounted "/home". (I use ext3 in order to use fuse-ext2 from OSX; ext4 is yet not supported) - 4th partition should be swap (no format and mountpoint required) Proceed ...

4. The installation process should run through smoothly.

5. Restart with pressed "Alt"-Key.

6. Restart again. Now a Ubuntu labled "/efi/vmlinuz ... .efi" should be shown.

  • Select this an start it, now the grub-menu should be displayed. Select "Ubuntu". Now Ubuntu should boot.

Wireless (AirPort)

Requires an Apple USB-Ethernet Adapter.

Log into ubuntu 15.10 and open a terminal (Ctrl+Alt+t).

Attach Apple USB-Ethernet Adapter. Update all packages:

sudo apt-get update
sudo apt-get upgrade    

Install wlan driver

sudo apt-get install bcmwl-kernel-source

Now networks should be found.

Sound

Works. You may want to change default ALSA sound card (needed for Lubuntu) - put this in /etc/asound.conf:

defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

iSight

iSight HD webcam does not work as Apple changed to PCI for higher resolution raw images. The camera is not recognized as USB device. The current iSight-Firmware cutter does not help here.

Touchpad (appletouch)

Works.

External Monitor

Works via thunderbolt --\> DVI out of the box.

Bluetooth

Works.

Function Keys

Works. See also AppleKeyboard#Corrections page for fine tuning.

To change Function keys such that they are used as first key

echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all
sudo reboot

Finetuning Powersave functions

With the procedures enabled below ~10h on battery can be achieved.

1. Install powertop and tlp

  • For detailed Instructions on tlp refer to tpl wiki.

    sudo apt-get install powertop tlp

2. Run powertop autotune

  • # add missing file - otherwise powertop auto-tune will report error
    sudo mkdir -p /var/cache/powertop/
    sudo touch /var/cache/powertop/saved_parameters.powertop
          
    sudo powertop --auto-tune

3. Adjust /etc/default/tlp (only changes are shown)

  • DISK_IDLE_SECS_ON_AC=0
    DISK_IDLE_SECS_ON_BAT=1
    MAX_LOST_WORK_SECS_ON_BAT=15
    DISK_APM_LEVEL_ON_BAT="1 1"
    RUNTIME_PM_ALL=1
    Restart tpl with
    sudo service tlp restart
    Check if settings took effect with powertop.

4. Enable more powersaving options

  • Put this script 99macbookair6 under /etc/pm/power.d/99macbookair6

    sudo cp 99macbookair6 /etc/pm/power.d/99macbookair6
    Create a new file
    sudo vi /usr/bin/powersave
    ----
    powertop --auto-tune
    /etc/pm/power.d/99macbookair6 true
    Make executable
    chmod a+x /usr/bin/powersave
    Add a new systemd service
    sudo vi /etc/systemd/system/powersave.service
    ----
    [Unit]
    Description=powersave
    
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/powersave
    
    [Install]
    WantedBy=multi-user.target
    Enable the new service
    sudo systemctl enable powersave.service

5. Enable i915 powersaving

  • sudo tlp stat
      ...
      /sys/module/i915/parameters/i915_enable_rc6  = -1 (use per-chip default)
      /sys/module/i915/parameters/i915_enable_fbc  = -1 (use per-chip default)
      /sys/module/i915/parameters/lvds_downclock   =  0 (disabled)
      /sys/module/i915/parameters/semaphores       = -1 (use per-chip default)

    Add the following line in /etc/default/grub

    GRUB_CMDLINE_LINUX_DEFAULT="pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 acpi_backlight=vendor"

Then run sudo update-grub and reboot. After that:

  • sudo tlp stat
      ...
      /sys/module/i915/parameters/i915_enable_rc6  =  1 (enabled)
      /sys/module/i915/parameters/i915_enable_fbc  =  1 (enabled)
      /sys/module/i915/parameters/lvds_downclock   =  1 (enabled)
      /sys/module/i915/parameters/semaphores       = -1 (use per-chip default)

Backlight

There is a strange bug with backlight. All settings (using F1, F2 keys) work great but after suspend your can only get 0% or 100% backlight.

Patrik Jakobsson wrote a kernel module that directly programs the backlight driver and it works!

If you don't want to compile by yourself, use the attached deb file <attachment:mba6xbl-dkms_1.0.0_all.deb>. Please note that the deb file only contains the sources but no binaries.

1. Install Build-Essentials and headers

  • sudo apt-get install build-essential linux-headers-generic

2. Download mba6xbl-dkms_1.0.0_all.deb and install it with

  • sudo dpkg -i mba6xbl-dkms_1.0.0_all.deb
  • Note: You'll need to repeat this installation step each time you kernel gets updated.

3. Load the module:

  • sudo modprobe mba6x_bl

4. Log out and log back in. It should load automatically on next boot.

Display

Display colors are not true by default. To have right color profile, you should consider import ICC color profile from your OSX installation, located on your OSX partition at /Library/ColorSync/Profiles/Displays.

You can import this profile from System-Settings into the Color settings pannel.


CategoryMac


MacBookAir6-2/Wily (last edited 2015-10-31 13:24:24 by spezimass)