Difference between revisions of "Acer C720 Chromebook"

From ArchWiki
Jump to navigation Jump to search
(Touchpad kernel modules: add information about linux-chromebook 3.16)
(Touchscreen (C720P model): remove information about old kernels, it's arch, we shouldn't care, add details about 3.17rc)
Line 171: Line 171:
 
=== Touchscreen (C720P model) ===
 
=== 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.
+
If you're using a touchscreen-enabled model (such as the C720P), you may use a modified version of the previous touchpad script to install patched modules for the touchscreen as well.
 
 
It is available here: [http://pastie.org/8834223 cros-haswell-modules-archlinux.sh] (tested with Linux 3.13).
 
For kernel 3.12 or earlier, the earlier script can be found [http://pastie.org/pastes/8581310 here]. For kernel 3.14, a script can be found [http://pastebin.com/hvPR5Hcp here].
 
 
 
$ wget http://pastebin.com/download.php?i=hvPR5Hcp -O cros-haswell-modules-archlinux.sh && sed -i "s/\r//g" cros-haswell-modules-archlinux.sh
 
$ chmod +x cros-haswell-modules-archlinux.sh
 
$ ./cros-haswell-modules-archlinux.sh
 
  
 
For kernel 3.16 the above script has moved to a GitHub repository.  The script no longer uses the /tmp directory for downloading and compiling, so you'll have to clean up after using.
 
For kernel 3.16 the above script has moved to a GitHub repository.  The script no longer uses the /tmp directory for downloading and compiling, so you'll have to clean up after using.
Line 186: Line 179:
 
  $ sh ./touch.sh
 
  $ sh ./touch.sh
  
For the 3.15.7+ kernel, before running the touch.sh script you must checkout the last 3.15.X revision via the command
+
Latest RC of kernel 3.17 already support the touchscreen so the script will not be needed.
 
 
$ git checkout 38a6d12ea7696fdbb9045faed68bdd404456002d
 
  
 
=== Fix Audio ===
 
=== Fix Audio ===

Revision as of 15:57, 18 September 2014

zh-cn:Acer C720 Chromebook

Warning: This article relies on third-party scripts and modifications, and may irreparably damage your hardware or data. Proceed at your own risk.

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.

Installation

First enable legacy boot / SeaBIOS, this can either be done by enabling the pre-installed version of SeaBIOS or by installing a custom ROM. The pre-installed SeaBIOS route has the advantage of being officially implemented by Google whereas the custom ROM route has other advantages such as being more up-to-date, reducing the boot time, removing the Developer Mode screen and enabling VMX. After accessing SeaBIOS you will be able to install and boot Linux as you would on a traditional x86 BIOS system.

Note: If you intend to stay using pre-installed SeaBIOS route and think you won't appreciate having to press Ctrl + L every time you boot to reach SeaBIOS then you can set coreboot to boot to SeaBIOS by default so it isn't necessary to press Ctrl + L; this currently must be done inside of Chrome OS and requires removing the write-protect screw so if you would like to do this then it may be a good idea to remove the write-protect screw now so that you will not have to reinstall Chrome OS later with recovery install media. If you would like to do this now then you can do so by removing the bottom panel of the laptop by removing the 12 visible screws and another one underneath the warranty sticker, then separating the plastic starting at the back and finally completely removing the write-protect screw from the motherboard, which is labelled as #7 in this picture.

Enabling Developer Mode

Developer Mode is necessary to access the superuser shell inside Chrome OS; which is required to make the changes to the system to allow you to boot through SeaBIOS.

Warning: Enabling Developer Mode will wipe all of your data.

To enable Developer Mode:

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

Accessing the superuser shell

After you have enabled Developer Mode you will need to access the superuser shell.; how you do this depends on whether you've configured Chrome OS or not.

Accessing the Superuser shell without Chrome OS configuration

If you haven't configured Chrome OS, just press Ctrl + Alt + F2 (F2 is the "forward" arrow on the top row, →), you'll see a login prompt.

  • Use chronos as the username, it should not prompt you for a password.
  • Become superuser with sudo bash.

Accessing the superuser shell with Chrome OS configuration

If you have configured Chrome OS already:

  • Open a crosh window with Ctrl + Alt + T.
  • Open a bash shell with the shell command.
  • Become superuser with sudo bash

Enabling SeaBIOS

This method will allow you to access the pre-installed version of SeaBIOS through the Developer Mode screen in coreboot.

  • Inside your superuser shell enter:
# 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.

Boot to SeaBIOS by default

If you want to make SeaBIOS default, you must do the following:

Warning: If you do not remove the write-protect screw then your system will become corrupted, on empty battery Chrome OS is forced to recover and you lose your Arch Linux. If you would like to remove the write-protect screw then you can do so by removing the bottom panel of the laptop by removing the 12 visible screws and another one underneath the warranty sticker, then separating the plastic starting at the back and finally completely removing the write-protect screw from the motherboard, which is labelled as #7 in this picture.
  • Inside your superuser shell enter:
# sudo su
# set_gbb_flags.sh 0×489

Installing Arch Linux

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Duplicated content (Discuss in Talk:Acer C720 Chromebook#)

Create an Arch Linux Installer USB drive then 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 and installation can proceed as normal.

Note: Choose GRUB as your boot loader for now instead of Syslinux. See Known Issues

64-bit installation with the newest 2014.07.03 ISO

Create a new FAT32 partition on your USB drive e.g. with gparted and label it as ArchLinux.

Warning: Without the label it won't work
  • Mount the new partition (replace x with the correct letter as shown with sudo fdisk -l and username with your own username)
# mount /dev/sdx1 /mnt/ -o uid=username,gid=users

Install GRUB2 on the USB drive

# grub-install --no-floppy --root-directory=/mnt /dev/sdx

Create a new directory in /mnt/boot

# /mnt/boot/archlinux-20140703-dual

Mount the archlinux-2014.07.03-dual.iso

$ mkdir ~/iso
# mount -o loop archlinux-2014.07.03-dual.iso ~/iso

Copy the mounted files to the usb drive

$ cp -r ~/iso/arch/* /mnt/boot/archlinux-20140703-dual

Create the grub.cfg file

/mnt/boot/grub/grub.cfg
menuentry "Arch Linux 64 Bit" {
 linux /boot/archlinux-20140703-dual/boot/x86_64/vmlinuz archisobasedir=/boot/archlinux-20140703-dual archisolabel=ArchLinux
 initrd /boot/archlinux-20140703-dual/boot/x86_64/archiso.img
}

Xorg video driver

Install the xf86-video-intel driver.

Touchpad

Touchpad kernel modules

Kernel 3.16.1 should be the last kernel that requires these patches, as a fix has been merged into 3.17-rc1.

Install patched kernel

Install linux-chromebookAUR from AUR

Manually build the modules

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Low quality scripts (Discuss in Talk:Acer C720 Chromebook#)

Enabling the touchpad currently requires building a set of patched Haswell Chromebook kernel modules.

Warning: Do not use pastebin.com. It appears to be the most popular site but it is slow, full of adverts, formats the text badly (it will mess up your code) and many people can not even open the site due to aggressive spam filters.
  • kernel 3.16.1, simply run this script after installing these packages:
$ pacman -S wget sudo patch make gcc git


Touchpad Configuration

  • Edit the Xorg touchpad configuration file

Add the Xorg touchpad configuration below for better usability (increases touchpad sensitivity).

/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

If you want to remove the "right-click" behavior from the touchpad from the bottom right area (you can still right-click with two finger clicks), you should comment out the following section from /etc/X11/xorg.conf.d/50-synaptics.conf

/etc/X11/xorg.conf.d/50-synaptics.conf
#Section "InputClass"
#        Identifier "Default clickpad buttons"
#        MatchDriver "synaptics"
#        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
#       To disable the bottom edge area so the buttons only work as buttons,
#       not for movement, set the AreaBottomEdge
#       Option "AreaBottomEdge" "82%"
#EndSection
  • Use a graphical tool

Synaptiks is a touchpad configuration and management tool for KDE. It provides a system settings module to configure basic and advanced features of the touchpad. Although it is said to be currently unmaintained and seems to crash under KDE 4.11, it works well with this Chromebook under KDE 4.12.2. Another utility, kcm_touchpad, does not work at all.

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 touchpad script to install patched modules for the touchscreen as well.

For kernel 3.16 the above script has moved to a GitHub repository. The script no longer uses the /tmp directory for downloading and compiling, so you'll have to clean up after using.

$ git clone https://github.com/masmullin2000/arch-c720p.git
$ cd arch-c720p
$ sh ./touch.sh

Latest RC of kernel 3.17 already support the touchscreen so the script will not be needed.

Fix Audio

Create /etc/modprobe.d/alsa.conf

/etc/modprobe.d/alsa.conf
option snd_hda_intel index=1

Create this specific ~/.asoundrc file

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

ctl.!default {
  type hw
  card 1
}

pcm_slave.slavej {
  pcm "hw:1"
  channels 2
  rate 44100
}

pcm.plugj {
  type plug
  slave slavej
}

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

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

To fix FlashPlugin audio with PulseAudio use this specific .asoundrc file

~/.asoundrc
# Standard
pcm.pulse {
  type pulse
}

ctl.pulse {
  type pulse
}
pcm.!default {
type pulse
#  type hw
#  card 1
 # device 0
}

ctl.!default {
type pulse
 # type hw
  #card 1
}

pcm_slave.slavej {
  pcm "hw:1"
  channels 2
  rate 44100
}

pcm.plugj {
  type plug
  slave slavej
}

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

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

Fixing suspend

The following are instructions to fix the suspend functionality. There have been a few alternatives discussed and those may work better for some. [1] [2]

NOTE: Lid suspend doesn't work directly after boot, you need to wait a little.

Create the following cros-acpi-wakeup.conf file.

/etc/tmpfiles.d/cros-acpi-wakeup.conf
w /proc/acpi/wakeup - - - - EHCI
w /proc/acpi/wakeup - - - - HDEF
w /proc/acpi/wakeup - - - - XHCI
w /proc/acpi/wakeup - - - - LID0
w /proc/acpi/wakeup - - - - TPAD
w /proc/acpi/wakeup - - - - TSCR

Then, create the following cros-sound-suspend.sh file. Only the EHCI binding/unbinding lines are listed below; see the alternatives linked above for additional sound suspend handling if you experience issues.

/usr/lib/systemd/system-sleep/cros-sound-suspend.sh
#!/bin/bash

case $1/$2 in
  pre/*)
    # Unbind ehci for preventing error 
    echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
    # Unbind snd_hda_intel for sound
    echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
    echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
    ;;
  post/*)
    # Bind ehci for preventing error 
    echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
    # bind snd_hda_intel for sound
    echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
    echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
    ;;
esac

Make sure to make the script executable:

# chmod +x /usr/lib/systemd/system-sleep/cros-sound-suspend.sh 

Then add the following kernel boot parameters. Different combinations have been mentioned, with tpm_tis.force=1 being the most important.

/etc/default/grub
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.

Improving WLAN and BT performance

The C720 comes with a AR9462 WLAN+BT chip. Both Bluetooth and WiFi can use 2.4 GHz, which can cause interference. You can enable Bluetooth coexistence to improve the performance of the card. Additionally, you can enable power savings and antennae diversity to reduce power usage and boost performance:

/etc/modprobe.d/ath9k.conf
options ath9k btcoex_enable=1 ps_enable=1 bt_ant_diversity=1

Post Installation Configuration

For information on general Chromebook post installation configuration (hotkeys, power key handling ...) see Chromebook#Post_Installation_Configuration.

Known issues

Syslinux

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.

Unbricking with Raspberry Pi

Get yourself an SOIC clip [3], and hook up the SOIC clip and jumper wires [4] [5] [6]

Install flashrom. Enable spi:

# modprobe spi_bcm2708
# modprobe spidev

Backup ROM:

flashrom -r backup-rom.bin -VVV -p linux_spi:dev=/dev/spidev0.0

Flash the new ROM:

flashrom -w new-rom.bin -VVV -p linux_spi:dev/dev/spidev0.0

See [7] for BeagleBone instructions.

See also