├── nyan-big-fit.cfg └── readme.md /nyan-big-fit.cfg: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | description = "Chrome OS kernel image with one or more FDT blobs"; 5 | #address-cells = <1>; 6 | images { 7 | kernel@1{ 8 | description = "kernel"; 9 | data = /incbin/("arch/arm/boot/zImage"); 10 | type = "kernel_noload"; 11 | arch = "arm"; 12 | os = "linux"; 13 | compression = "none"; 14 | load = <0>; 15 | entry = <0>; 16 | }; 17 | fdt@1{ 18 | description = "tegra124-nyan-big.dtb"; 19 | data = /incbin/("arch/arm/boot/dts/tegra124-nyan-big.dtb"); 20 | type = "flat_dt"; 21 | arch = "arm"; 22 | compression = "none"; 23 | hash@1{ 24 | algo = "sha1"; 25 | }; 26 | }; 27 | }; 28 | configurations { 29 | default = "conf@1"; 30 | conf@1{ 31 | kernel = "kernel@1"; 32 | fdt = "fdt@1"; 33 | }; 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | GNU/Linux on Acer Chromebook 13 (aka CB5-311 or nyan-big) 2 | ========================================================= 3 | 4 | Prerequisites 5 | ------------- 6 | 7 | Build system: install dtc (device-tree-compiler), cgpt, uboot-tools, vboot-utils and Chrome OS developer keys (vboot-kernel-utils / chromeos-devkeys / etc) and a cross-compilation toolchain for ARM if building on another platform. 8 | 9 | 10 | Developer mode on Chromebook 11 | ---------------------------- 12 | 13 | 1) Power on while holding down the ESC and Refresh keys. 14 | 15 | 2) Enable developer mode by pressing Ctrl-D on the recovery screen. WARNING: this will erase user data from the Chromebook. 16 | 17 | 3) Enable booting from external media by running `sudo crossystem dev_boot_usb=1` from a terminal once the the system has booted. 18 | 19 | 20 | Build a custom kernel image 21 | --------------------------- 22 | 23 | On the build system: 24 | 25 | git clone https://chromium.googlesource.com/chromiumos/third_party/kernel -b chromeos-3.10 26 | cd kernel 27 | 28 | Get the USB firmware (from [this overlay](https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/overlay-nyan/sys-kernel/xhci-firmware/xhci-firmware-2014.11.06.00.00.ebuild)): 29 | 30 | wget http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/xhci-firmware-2014.11.06.00.00.tbz2 31 | tar xf xhci-firmware-2014.11.06.00.00.tbz2 32 | cp -R lib/firmware/ . 33 | rm -R ./lib/firmware/ 34 | 35 | Prepare the config file: 36 | 37 | ./chromeos/scripts/prepareconfig chromeos-tegra 38 | WIFIVERSION=-3.8 ARCH=arm CROSS_COMPILE=arm-none-eabi- make menuconfig 39 | 40 | The WIFIVERSION variable is required to build the drivers in `drivers/net/wireless-3.8`; the mwifiex driver in /drivers/net/wireless/ does not support the Chromebook's adapter. The ARM and CROSS\_COMPILE variables are only required if cross-compiling. CROSS\_COMPILE should be changed to the correct prefix for your toolchain. 41 | 42 | Set `Device Drivers > Generic Driver Options > External firmware blobs to build into the kernel binary` to `nvidia/tegra124/xusb.bin`. 43 | 44 | Change any other required settings. I've had some issues with HDCP negociation timing out when connecting a HDMI monitor, I would recommend disabling it. 45 | 46 | Now the kernel can be built: 47 | 48 | WIFIVERSION=-3.8 ARCH=arm CROSS_COMPILE=arm-none-eabi- make zImage 49 | WIFIVERSION=-3.8 ARCH=arm CROSS_COMPILE=arm-none-eabi- make modules 50 | 51 | If the build fails because of compiler warnings treated as errors (happens especially when you enable additional options in the kernel config), disable ``CONFIG_ERROR_ON_WARNING`` (*Kernel hacking -> Treat compiler warnings as errors* in `menuconfig`). 52 | 53 | Build the DTB file: 54 | 55 | WIFIVERSION=-3.8 ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- make tegra124-nyan-big-.dtb 56 | 57 | Available board revisions can be seen using the command 58 | 59 | ls arch/arm/boot/dts/tegra124-nyan-big-*.dts 60 | 61 | To find out which one your device has, run the following command in the Chrome OS shell: 62 | 63 | cat /proc/device-tree/model 64 | 65 | Build a Flattened Image Tree using the configuration file I provide: 66 | 67 | wget https://raw.githubusercontent.com/lgeek/gnu-linux-on-acer-chromebook-13/master/nyan-big-fit.cfg 68 | mkimage -f nyan-big-fit.cfg nyan-big-kernel 69 | 70 | Create a bootable vboot image: 71 | 72 | echo "root=/dev/mmcblk1p2 rootwait rw noinitrd" > ./cmdline 73 | echo blah > dummy.txt 74 | vbutil_kernel --arch arm --pack kernel.bin --keyblock --signprivate --version 1 --config cmdline --vmlinuz nyan-big-kernel --bootloader dummy.txt 75 | 76 | 77 | Partition an SD card 78 | -------------------- 79 | 80 | sudo cgpt create 81 | sudo cgpt add -b 34 -s 32768 -P 1 -S 1 -t kernel # 16 MB kernel image partition 82 | sudo cgpt add -b 32802 -s -t rootfs 83 | 84 | cgpt doesn't seem to create a protective MBR. If one is not already in place, it can be created with: 85 | 86 | sudo gdisk # and enter command w 87 | 88 | Copy data to the SD card 89 | ------------------------ 90 | 91 | sudo dd if=./kernel.bin of=p1 92 | sudo mkfs.ext4 p2 93 | sudo mount p2 /mnt/ 94 | 95 | Now you're ready to copy a GNU/Linux rootfs to the root partition. I use NVIDIA's [L4T](https://developer.nvidia.com/platform-software-development) rootfs because it's ready to run NVIDIA's Xorg driver. If you decide to use it as well, you'll need the 'Sample file system' and 'Driver Package' archives. Don't forget to install the kernel modules for the kernel you've just built: 96 | 97 | sudo INSTALL_MOD_PATH=/mnt/ WIFIVERSION=-3.8 ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- make modules_install 98 | 99 | Finally, unmount the rootfs, move the SD card to the Chromebook and boot the new system by pressing Ctrl-U at the boot warning screen. 100 | 101 | 102 | Misc notes 103 | ---------- 104 | 105 | * The packed kernel and the rootfs can presumably also be copied to the internal eMMC, but I have not tried that yet. 106 | * The touchpad needs the `xserver-xorg-input-synaptics` driver (which has multitouch support) to work. 107 | * ~~WiFi seems to occasionally disconnect when idle for a long time if [NetworkManager](https://wiki.gnome.org/Projects/NetworkManager) is used, [wicd](http://wicd.sourceforge.net/) seems reliable.~~ NetworkManager is now working reliably for me. Older versions of the mwifiex driver (including the one shipped with my device) crash when NetworkManager manages the `uap0` device. 108 | * OpenGL and XV hardware acceleration work correctly with the kernel interfaces exposed by the Chrome OS kernel; I have not yet tested CUDA. 109 | * The Chromebook's keyboard has a slightly different layout compared to standard keyboards: the function keys (from *Back* to *Volume Up*) map to F1 to F10 and there are no F11 and F12 keys, so any standard shortcuts using these keys must be remapped. There are no Insert, Delete, Home, End, Page Up and Page Down keys, which takes a while to get used to. 110 | * The Tegra K1 SoC in my Chromebook is a lower speed grade than the one used by [Jetson TK1](https://developer.nvidia.com/jetson-tk1), the maximum core frequency allowed by this kernel is 2.01 GHz. 111 | 112 | --------------------------------------------------------------------------------