Difference between revisions of "Acer C720 Chromebook"

From ArchWiki
Jump to: navigation, search
m (Unresolved Issues: systemd suspend is no longer an unresolved issue.)
(Hotkeys: Added description of hotkeys, subsection for Sxhkd, and additional hotkey bindings.)
Line 112: Line 112:
 
== Hotkeys ==  
 
== Hotkeys ==  
  
In order to fix the hotkeys it is necessary to use a userspace hotkey daemon like xbindkeys or sxhkd. The following is an sxhkdrc file that enables the audio and backlight keys (provided you've installed amixer and xbacklight.)
+
The c720 has function keys with [https://support.google.com/chromebook/answer/1047364?hl=en dedicated Chromebook shortcuts] within Chrome OS. By default these work as regular function keys, but they can be mapped to match their appearance.
 +
 
 +
=== Sxhkd configuration ===
 +
 
 +
Below is an [[Sxhkd]] configuration file that specifies behavior similar to the shortcut defaults in Chrome OS. Besides the sxhkd daemon, this requires [[Advanced Linux Sound Architecture|amixer]], {{Pkg|xorg-xbacklight}}, and {{Pkg|xautomation}}.
 +
 
 
{{hc|~/.config/sxhkd/sxhkdrc|
 
{{hc|~/.config/sxhkd/sxhkdrc|
 +
# Web browser Back/Forward shortcuts
 +
@F1
 +
  xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'
 +
 +
@F2
 +
  xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'
 +
 +
# Web browser Refresh shortcut
 +
@F3
 +
  xte 'keydown Control_L' 'key r' 'keyup Control_L'
 +
 +
# Awesome WM maximize current window
 +
# Adjust as necessary for different window managers
 +
@F4
 +
  xte 'keydown Super_L' 'key m' 'keyup Super_L'
 +
 +
# Awesome WM move one desktop right
 +
@F5
 +
  xte 'keydown Super_L' 'key Right' 'keyup Super_L'
 +
 
F6
 
F6
 
   xbacklight -dec 10
 
   xbacklight -dec 10

Revision as of 21:03, 16 January 2014

The Acer C720 Chromebook (and newer chromebooks in general) features a "legacy boot" mode that makes it easy to boot Linux and other operating systems. The legacy boot mode is provided by the SeaBIOS payload of coreboot. SeaBIOS behaves like a traditional BIOS that boots into the MBR of a disk, and from there into your standard bootloaders like Syslinux and GRUB.

Preview

You can watch the preview on what Arch on Acer C720 looks like https://www.youtube.com/watch?v=dEbCFlyUw5c

Installation

First enable legacy boot / SeaBIOS from the developer mode of Chrome OS. Then install and boot Linux as you would on a traditional x86 BIOS system.

Enabling Developer Mode

Warning: This will wipe all of your data!

To enter developer mode:

  • Press and hold the Esc+F3 (Refresh) keys, then press the Power button. This enters recovery mode.
  • Now, press Ctrl+D (no prompt). It will ask you to confirm, then the system will revert its state and enable developer mode.
  • Press Ctrl+D (or wait 30 seconds for the beep and boot) at the white boot splash screen to enter Chrome OS.

Enabling SeaBIOS

After changing to developer mode, configure Chrome OS so that you can log in.

To enable the legacy bios:

  • Open a crosh window with Ctrl+Alt+T.
  • Open a bash shell with the shell command.
  • Become superuser with sudo bash
  • Enable legacy boot with:
# crossystem dev_boot_usb=1 dev_boot_legacy=1
  • Reboot the machine

You can now start SeaBIOS by pressing Ctrl-L at the white boot splash screen.

Installing Arch Linux

Create a USB drive with the Arch Linux installer. Plug the USB drive into the Chromebook, and start SeaBIOS with Ctrl-L at the white boot splash screen. Press Esc to get a boot menu and select the number corresponding to your USB drive. The Arch Linux installer boot menu should appear. Follow your favorite installation guide.

A few installation notes:

  • For a 64-bit installation, use the 2013.10.01 ISO, and boot into the x86_64 installer with the mem=1536m kernel option.
  • A fresh DOS partition table on the SSD with one bootable 16GB root partition works. Note that this will wipe Chrome OS.
  • Choose GRUB as your bootloader, for now, instead of Syslinux.
  • After installing it's not Ctrl + D to boot OS it's Ctrl + L (To save you hours figuring out why you can't boot)

Xorg Video Driver

Use the xf86-video-intel driver.

$ sudo pacman -S xf86-video-intel

Touchpad Kernel Modules

Enabling the touchpad currently requires building a set of patched Haswell Chromebook kernel modules. Fortunately, ChrUbuntu provides a script for automatically building and installing these modules: cros-haswell-modules.sh.

A modified version for Arch Linux is available here cros-haswell-modules-archlinux.sh (tested with Linux 3.12.6).

$ wget http://pastie.org/pastes/8540561/download -O cros-haswell-modules-archlinux.sh
$ chmod +x cros-haswell-modules-archlinux.sh
$ ./cros-haswell-modules-archlinux.sh

Add the Xorg touchpad configuration below for better usability.

/etc/X11/xorg.conf.d/50-cros-touchpad.conf
Section "InputClass" 
    Identifier      "touchpad peppy cyapa" 
    MatchIsTouchpad "on" 
    MatchDevicePath "/dev/input/event*" 
    MatchProduct    "cyapa" 
    Option          "FingerLow" "10" 
    Option          "FingerHigh" "10" 
EndSection

Reboot for the touchpad to become operational.

Touchscreen (C720P model)

If you're using a touchscreen-enabled model (such as the C720P), you may use a modified version of the previous script to install patched modules for the touchscreen as well

It is available here cros-haswell-modules-archlinux.sh (tested with Linux 3.12.6).

$ wget http://pastie.org/pastes/8581310/download -O cros-haswell-modules-archlinux.sh
$ chmod +x cros-haswell-modules-archlinux.sh
$ ./cros-haswell-modules-archlinux.sh

Power Key and Lid Switch Handling

Ignore using logind

Out of the box, systemd-logind will catch power key and lid switch events and handle them: it will do a poweroff on a power key press, and a suspend on a lid close. However, this policy might be a bit harsh given that the power key is an ordinary key at the top right of the keyboard that might be pressed accidentally.

To configure logind to ignore power key presses and lid switches, add the lines to logind.conf below.

/etc/systemd/logind.conf
HandlePowerKey=ignore
HandleLidSwitch=ignore

Then restart logind for the changes to take effect.

$ sudo systemctl restart systemd-logind

Power key and lid switch events will still be logged to journald by logind. See http://www.freedesktop.org/software/systemd/man/logind.conf.html for additional handling options.

Fixing suspend

You can add kernel boot parameters which will enable suspend and resume to work correctly.

/etc/default/grub.cfg
GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic"

Then rebuild your grub config.

Hotkeys

The c720 has function keys with dedicated Chromebook shortcuts within Chrome OS. By default these work as regular function keys, but they can be mapped to match their appearance.

Sxhkd configuration

Below is an Sxhkd configuration file that specifies behavior similar to the shortcut defaults in Chrome OS. Besides the sxhkd daemon, this requires amixer, xorg-xbacklight, and xautomation.

~/.config/sxhkd/sxhkdrc
# Web browser Back/Forward shortcuts
@F1
  xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'

@F2
  xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'

# Web browser Refresh shortcut
@F3
  xte 'keydown Control_L' 'key r' 'keyup Control_L'

# Awesome WM maximize current window
# Adjust as necessary for different window managers
@F4
  xte 'keydown Super_L' 'key m' 'keyup Super_L'

# Awesome WM move one desktop right
@F5
  xte 'keydown Super_L' 'key Right' 'keyup Super_L'

F6
  xbacklight -dec 10

F7 
  xbacklight -inc 10

F8
  amixer set Master toggle

F9 
  amixer set Master 10- unmute

F10
  amixer set Master 10+ unmute

Audio

The following is an .asoundrc file that enables system speakers / headphones and HDMI audio out. Simply uncomment one portion and comment out the other to switch.

~/.asoundrc
# Standard
pcm.!default {
  type hw
  card 0 
  device 0
}

ctl.!default {
  type hw
  card 0 
}

# HDMI 
#pcm.!default {
  #type hw
  #card 1 
  #device 3
#}

#ctl.!default {
  #type hw
  #card 0 
#}

Unresolved Issues

  • The 64-bit installer in Arch Linux installation ISOs newer than 2013.10.01 causes an immediate system reset
  • Syslinux fails to set the bootable flag with syslinux-install_update -i -a -m. After setting the bootable flag manually in fdisk and installing Syslinux to the MBR with syslinux-install_update -i -m, SeaBIOS boots syslinux, but syslinux then complains about a missing OS. Use GRUB for now.