guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guix on the ASUS C201PA


From: Timothy Sample
Subject: Guix on the ASUS C201PA
Date: Wed, 06 Mar 2019 02:20:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi guix-devel,

I was able to get Guix to boot on an ASUS Chromebook C201PA.  This model
of computer is pretty neat.  It’s an ARMv7 (32-bit) machine that can be
run with entirely free software.  There is even a free graphics driver
in the works [1].

I’ve attached a (messy) patch that adds a (hacky) bootloader definition
for Depthcharge and a Linux-Libre package that works on the machine
(using an unsupported version of Linux-Libre).  All those parenthetical
comments are supposed to suggest that this work is not really finished.
Now that the computer runs Guix, it should be straight-forward (if time
consuming) to fix some of these problems and arrive at something nice.

The main reason I’m posting this now is that I believe there is some
interest in this machine, and so maybe other people are also excited to
try it.  :)  Below are some brief installation instructions, and some
details about the patch.

To install, you first need to prepare the disk.  Gentoo has a good
guide [2].  The “cgpt” utility it mentions is provided by the
“vboot-utils” Guix package.  (Also, don’t forget to make a file system
on the second partition before mounting.)  After the disk is prepared,
use the “gnu/system/examples/asus-c201.tmpl” configuration template.  Be
sure that the bootloader and file-system parts point to the right disk.
Finally, you should be able to install Guix using the usual “guix system
init” command.  To be clear, if you mounted the file system on “/mnt”
and copied the configuration template to “asus-c201.scm”, you can run

    ./pre-inst-env guix system init asus-c201.scm /mnt

The two things this patch changes to get Guix to boot is the bootloader
and kernel.

For the bootloader, these machines use Depthcharge.  Depthcharge boots a
specially packaged and signed kernel image from a specially marked
partition.  This kernel image is written to the partition directly
without a file system.  Other than a bit of metadata about which kernel
partition to try to boot from (it supports an automatic fallback
feature), there is no configuration.  Luckily, Guix already has a
package for the tools that sign the kernel image and add the partition
metadata.

In order to make Depthcharge work, I had to bend Guix’s notion of a
bootloader a little bit.  I use the “bootloader-installer” procedure to
write the kernel image to disk.  In order to tell it which kernel to
write, I overloaded the “configuration-file-generator” to write the
kernel to a special “/boot/depthcharge/vmlinux.kpart” file, which the
installer procedure can write to disk.  This takes advantage of the fact
that Guix writes the configuration file before running the installation
procedure, which I wouldn’t have assumed had I not read the code.
(Which suggests that this is the wrong way to do it!)

There may be a way to improve this by bringing U-Boot into the booting
process.  The next version of U-Boot (to be released in April) will
support this machine directly.  I haven’t looked at it yet.
Alternatively, if using U-Boot directly causes problems, it’s possible
that Depthcharge could boot into U-Boot.

For the kernel, I tracked down a particularly stable version,
configuration, and patchset from a project called PrawnOS [3].  Support
for these machines is a little spotty.  I was unable to get Debian to
boot, and Arch Linux ARM would boot but only most of the time.  PrawnOS
is a project that targets these machines directly, and provides a
Linux-Libre-based system that seems to boot consistently.  After some
tinkering to make it build with Guix and run Guix’s initrd, I got Guix
to work nicely.  (Although it only seems to load the initrd from the
Libreboot version of Depthcharge and not the Google one.)

Unfortunately, PrawnOS currently uses Linux-Libre 4.17, which is not
supported.  Work is under way to use 4.19, which is still supported.
Arch Linux ARM uses Linux 4.20, but it is not as well tested as PrawnOS
on this machine.


-- Tim

[1] https://panfrost.freedesktop.org/
[2] https://wiki.gentoo.org/index.php?title=Asus_Chromebook_C201
[3] https://github.com/SolidHal/PrawnOS

Attachment: 0001-wip-Add-support-for-ASUS-C201.patch
Description: Patch for ASUS C201PA


reply via email to

[Prev in Thread] Current Thread [Next in Thread]