Note: Adapted/inspired by this page
This guide will walk you through installed Arch Linux with a mainline kernel on a USB key suitable for booting on the Chromebook Plus (kevin).
Plug the USB key into your chromebook and run the following commands in the shell to create a new partition table and 2 partitions - one for the kernel and another for rootfs.
The numbers above will differ depending on the size of your USB key. Grab the value under the “start” column for the “Sec GPT table” row and insert it in the command below (<start_value>)
Your USB key is now formatted in such a way that the chromebook can book from it. Next step is to put something bootable on it.
The following will download the latest Arch Linux image for gru-kevin and flash the rootfs partition.
; cd /tmp ; wget http://os.archlinuxarm.org/os/ArchLinuxARM-gru-latest.tar.gz ; mkdir root ; sudo mount /dev/sda2 root ; sudo tar -xf ArchLinuxARM-gru-latest.tar.gz -C root
In order to test the image and your partition table, flash the kernel partition from the Arch tarball to your USB key
; sudo dd if=root/boot/vmlinux.kpart of=/dev/sda1 ; sync
Finally, unmount the root partition:
; umount root
Unplug the USB key from your workstation and test boot it on your kevin by pressing Ctrl+U at the developer screen. The device should boot to a login prompt (user: root, passwd: root).
; reboot
Back on your workstation, sync a linux-next kernel for maximum freshness.
Apply the following patches to enable display:
https://github.com/mmind/linux-rockchip/commit/9a35625d79210a8a919fdf6c8f878520134c3a6c
https://github.com/mmind/linux-rockchip/commit/0b50af4d2440404d5e10303cc84e43e84f84f374
seanpaul: ^^ These links are broken now (thanks to Brian Carnes for the report). I don‘t remember what they did, but I also don’t think they're needed any longer since rockchip display support is all in mainline.
You‘ll need to grab the kernel.keyblock and kernel_data_key.vbprivk files in order to package the kernel. They’re stored in Arch Linux's PKGBUILDs repo on github here. I put them in <kernel_root>/resources/gru-kevin/.
Also stored in <kernel_root>/resources/gru-kevin is the rk3399-gru-kevin.its file. Create and copy/paste the following into it:
/dts-v1/; / { description = "Chrome OS kernel image with one or more FDT blobs"; #address-cells = <1>; images { kernel@1 { data = /incbin/("../../.build_arm64/arch/arm64/boot/Image"); type = "kernel_noload"; arch = "arm64"; os = "linux"; compression = "none"; load = <0>; entry = <0>; }; fdt@1 { description = "rk3399-gru-kevin"; data = /incbin/("../../.build_arm64/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb"); type = "flat_dt"; arch = "arm64"; compression = "none"; hash@1 { algo = "sha1"; }; }; }; configurations { default = "conf@1"; conf@1 { kernel = "kernel@1"; fdt = "fdt@1"; }; }; };
Grab my build script from github, and add a build.ini file in the kernel root with the following (changing the bold parts to suit your environment):
Simply run the build_kernel.py script from the kernel root directory to build and flash your kernel. If all goes well, you should now have a USB key that will boot a mainline kernel with Arch Linux rootfs.