UBUNTU 16.04 SINGLE INSTALL ON MACBOOKAIR 2014
NB: these are notes for my particular installation, YMMV
Installation:
“burn” the image on the usb stick, I tend to use usb-creator-gtk on ubuntu, some say dd-ing the image on the usb is ok,
insert the usb key on your applething, power on and press opt/alt: screenshot-from-2016-11-02-22-49-46
then select “EFI boot” and go on with the installation
Keyboard:
this is the holy grail: https://github.com/free5lot/hid-apple-patched
it permits you to finally swap the “fn” and “ctrl” keys.
install:
git clone https://github.com/free5lot/hid-apple-patched
cd hid-apple-patched
sudo dkms add .
sudo dkms build hid-apple/1.0
sudo dkms install hid-apple/1.0
edit the config file:
sudo nano /etc/modprobe.d/hid_apple.conf
add:
options hid_apple fnmode=2
options hid_apple swap_fn_leftctrl=1
options hid_apple swap_opt_cmd=1
apply and reboot:
sudo update-initramfs -u
sudo reboot
alternatively you can follow this guide, without the swapping of “fn” and “ctrl”: https://help.ubuntu.com/community/AppleKeyboard
INTERRUPTS:
a big performance problem I found was with ACPI interrupts,
find the problematic ones:
grep . -r /sys/firmware/acpi/interrupts/
if you an interrupt with thousands of calls, you can try to disable it,
BE AWARE THAT ANYTHING CAN HAPPEN
sudo echo “disable” > /sys/firmware/acpi/interrupts/gpeXX
source: https://wiki.archlinux.org/index.php/MacBook#kworker_using_high_CPU
add it as a systemd service:
nano /etc/systemd/system/suppress-gpeXX.service
add:
[Unit]
Description=Disables GPE XX, an interrupt that is going crazy on Macs
[Service]
ExecStart=/bin/bash -c ‘echo “disable” > /sys/firmware/acpi/interrupts/gpeXX’
[Install]
WantedBy=multi-user.target
enable it on boot:
sudo systemctl enable suppress-gpeXX
test it:
sudo systemctl start suppress-gpeXX
and check it has actually disabled the gpe:
cat /sys/firmware/acpi/interrupts/gpeXX
you should now read “disabled”,
it is better to test also a reboot.
POWER TUNING:
install powertop and run it:
sudo apt-get install powertop
sudo powertop –auto-tune
TODO: add it as a system service on startup
install TLP:
sudo apt-get install tlp tlp-rdw
source: http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#installation
GRUB TUNING:
follow: https://help.ubuntu.com/community/MacBookAir6-2/Trusty#Finetuning_Powersave_functionsTODO: add steps
BACKLIGHT and SUSPEND:
one issue is that the backlight does not automagically switch on after suspend/hibernate,
follow this guide: https://help.ubuntu.com/community/MacBookAir6-2/Trusty#Backlight
source: https://github.com/patjak/mba6x_bl
HIBERNATE:
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
add:
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
source: https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html
JAVA:
sudo apt install icedtea-8-plugin openjdk-8-jre
Install THUNAR file manager:
apt-get install thunar
xdg-mime default Thunar.desktop inode/directory