Asus Chromebook C201

The Asus C201 is a pretty fast and lightweight ARMv7-A (Cortex-A17) based chromebook. Its most distinguishing feature is that it is one of only a few devices already supported by Libreboot. That is, the factory firmware (coreboot) can optionally be replaced with entirely libre firmware. Instructions on how to do this can be found on the Libreboot website.

Specifications

 * SoC: Rockchip RK3288
 * CPU: Quad-core ARM Cortex-A17 @ 1.8 GHz
 * GPU: Mali T764
 * Board name: Veyron Speedy
 * Audio: Rockchip I2S
 * Screen: 11.6" @ 1366x768
 * Ram: 2gb/4gb
 * Firmware: coreboot
 * Coreboot payload: deptchcharge
 * Filename of device tree binary: rk3288-veyron-speedy.dtb

What works and what doesn't
Mainline support is close to complete, so using should yield the best overall experience of all options.

Additional hardware requirements

 * USB ethernet adapter

Obtain installation media
Create the installation media manually. Alternatively have a look at Devsus.

Preparing the device
To be able to boot from external media like USB drives, the Asus C201 first needs to be switched into developer mode.

This can be achieved by pressing ++ when the device is switched off to enter the.

Pressing + and then following subsequent on-screen instructions enables the.

Finally one of the parameters needs to be modified: Boot the device and enter Chrome OS'  shell, e.g. by opening Chromium Browser and hitting ++. Enable booting from external media:

Booting the installation media
Power on and when the boot screen is displayed press + to boot from the installation media. Log in (in case the installation media was manually created following the instructions referred to above the username is ‘root’ and the password is ‘gentoo’).

Configuring the Network
Begin with configuring the network.

Preparing the install media
Once a network connection is established make sure Portage is prepared:

Then make sure the required tools ( and ) are installed:

Preparing the disks
A GPT (GUID Partition Table) is mandatory.

Recommended partition layout and size:

Cf. Handbook: Preparing the disks

Depthcharge, the chromebooks’ bootloader, requires some specific parameters to be set. These signal the bootloader the presence of a valid kernel partition:

Mount the root partition:

Installing the Gentoo installation files
Choose an stage3 from the main website's download section or consider going for an  stage3 from the Hardened musl project. Follow Installing the Gentoo installation files from the Handbook.

Installing the Gentoo base system
Skip "Mounting the boot partition", apart from that follow the Handbook for Installing the Gentoo base system.

Configuring the Linux kernel
Install the tools required for deploying the kernel (, and ):

Configure as usual, cf. Configuring the Linux kernel. Alternatively refer to the RockMyy repository to include Mali GPU drivers.

Building the kernel and device tree binaries
From the kernel build directory, copy the zImage and the target device's device tree binary to the desired working directory. Replace with the filename of the target device's device tree binary, e.g.  for the Asus Chromebook C201 (which is based on Rockchip's RK3288 SoC and a board with the codename "Veyron Speedy").

Optional: Creating a Custom Initramfs
Follow instructions from the Custom Initramfs article. Embed the initramfs into the kernel or create it as a separate file (cf. Custom Initramfs - Creating a separate file):

Creating the FIT image
Change to the directory where the kernel, the device tree binary and (optionally) the initramfs are located:

Create the configuration file ("") for the Flattened Image Tree (FIT) with the following content. Again replace with the filename of the target device's device tree binary, e.g.  for the Asus Chromebook C201.

Pack the FIT image:

Preparing verified boot
Create a file ("kernel.flags") for the CMDLINE parameters:

Sign and pack the kernel:

Installing the kernel
Install the modules, keeping them small to save some space:

Install the kernel image to the kernel partition:

Configuring the system
Consult the Handbook again for Configuring the system.

Installing system tools
Stick with the Handbook: Installing system tools

Finalizing
Finalize the new Gentoo installation according to the handbook. To use wifi remember to install :

Also keep in mind that the built-in wifi requires proprietary firmware.

Built-in wifi
Built-in wifi requires the proprietary binary firmware blob, provided by ):

Furthermore the aforementioned binary expects a nvram,. Create it with the content provided by the ChromiumOS project: https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/overlay-veyron/chromeos-base/chromeos-bsp-veyron/files/firmware/brcmfmac4354-sdio.txt

The ChromiumOS project considers this file belonging to the BSP (Board Support Package) and considers upstreaming the file to as being pointless.

For additional background information regarding this nvram, consult the Linux Wireless wiki.

ACPI
This handles alternating between speaker and headphone jack when one is plugged in, as well as lid suspend when the charger is unplugged. Power button support can be added if desired, though keep in mind the device will simply turn on again when the lid is closed.

Pulseaudio configuration
Add the following if using Pulseaudio:

See InstallingDebianOn/Asus/C201#Audio for further information. VEYRON-I2S shipped with alsa, so it's unlikely to need to add Google's UCM files.

HDMI is not tested. It appeared under 3.14 as RockchipHDMI, but is missing under 4.13. Possibly a kernel config or UCM issue.

Keybinds
xbacklight doesn't work, however, a backlight device exists. This script can be used in tandem with xbindkeys as a replacement for xbacklight:

Provide the delta for the backlight as an argument, positive or negative.

This file is read-only by default, add this script to the local service if desired:

This script needs to be marked executable by doing

If reassigning the function keys for another purpose is desired, edit the /usr/share/X11/xkb/symbols/pc file.

In the following example, the search key (LWIN) has been remapped to Caps and set some of the function keys to much-needed movement keys. Also, the power button was remapped to the Delete key:

Restart X for these changes to take effect.

To remove old files in /var/lib/xkb:

Tips and tricks

 * There is only 16GB of internal storage space available. Consider using an SD card for /home and to compile larger packages on.
 * Backing up the ChromeOS partition (mmcblk0) is highly recommended, however it is not difficult restore ChromeOS after a failure. Create a restore USB medium through desktop Chrome or download the files manually to write to a USB drive.
 * Do not disable cros' developer mode! If the kernel fails to boot, the machine will not be able to boot from the install medium and will be forced to "powerwash" the Chromebook. Even if the kernel boots, crossystem/mosys is needed to change these flags. This is the solution if this happens on Libreboot, though wait for partition 5 to complete instead.

Known issues
If the bluetooth module is loaded at any time and the system is suspended, both the bluetooth and wireless driver will stop working. A temporary fix is to blacklist the btsdio module:

does not work here. Query /sys/devices/virtual/thermal/thermal_zoneX/temp to get temperatures. This will average the two CPU sensors up and output in a sane format:

does not display the correct discharge time. This can be obtained through upower:

External resources

 * https://notabug.org/dimkr/devsus
 * https://github.com/Miouyouyou/RockMyy
 * http://www.synkhronix.com/journal/gentoo-chromebook
 * http://www.galexander.org/chromebook
 * https://wiki.debian.org/InstallingDebianOn/Asus/C201
 * https://libreboot.org/docs/hardware/c201.html