Asus Chromebook C201

The Asus C201 is a pretty fast and lightweight ARMv7-A (Cortex-A17) based chromebook. Most distinguishing 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
Configure as usual, cf. Configuring the Linux kernel. Alternatively refer to the RockMyy repository to include Mali GPU drivers.

Build 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:

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.

Considerations

 * A USB ethernet dongle is recommended until Gentoo is running. Ensure the module is included with the kernel or built-in if using the Devsus script to create a bootable USB.
 * This laptop is speedy for its size, but still takes a long time to emerge larger packages. Heavy use of distcc and crossdev's armv7a-hardfloat-linux-gnueabi target during testing.
 * There is only 16GB of internal storage space available. Using an SD card for /home and a decent USB flash drive to compile larger packages on (firefox/libreoffice) is recommended.
 * Decide on using either a mainline kernel (>=sys-kernel/gentoo-sources-4.20 works) or the ChromeOS kernel (linux 3.14). Despite a large majority claiming loss of functionality on newer kernels, this was not the case during testing; in fact, it fixed several issues from harmless warning messages in logs to X locking up entirely.
 * Adding the arm_support overlay is recommended.
 * 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.

If planning to use the kernel on a USB drive, simply dd it to the internal storage and copy all modules from it:

Optionally, copy the firmware blobs previously backed up earlier to lib/firmware on the internal storage root.

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 sees no sense in upstreaming the file to.

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:

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
 * https://wiki.debian.org/InstallingDebianOn/Asus/C201
 * https://libreboot.org/docs/hardware/c201.html