Last month Google and Samsung released the first commercially available product using the ARM® Cortex™-A15 SoC design: the new Series 3 Chromebook. Not only does the Chromebook have the new Samsung Exynos 5250 providing the core compute power, but it also has the new ARM Mali™-T604 providing the power to move all those pixels around. As with previous Chromebooks, it uses a custom operating system known as ChromeOS (which is based loosely on Gentoo Linux). If you've ever used either the Chrome or Chromium browser from Google you'll have no issues, as everything is orientated around the browser.
I'm not going to be doing a review of the new Chromebook, there are plenty of those available. What I am going to talk about is getting a full blown Linux environment onto the Chromebook. Why would someone wish to do this, instead of just using Chrome OS? The reasons will be wide and varied, my own reasons for doing so are for development and testing of applications and other items on the ARM architecture. ARM Cortex-A15 introduces some new extensions to the ARM architecture that many developers would find interesting, like support for hardware virtualization. To be able to leverage these extensions and to explore what the hardware can do, one needs to have a development environment that can facilitate such work. This is where having a full Linux environment comes in.
At the end of last month Linaro held their European conference in Copenhagen where many developers met to discuss ARM support for a number of open source projects. I spent some time with Marcin Juszkiewicz (a Canonical engineer seconded to Linaro) and Olof Johansson (a Chrome OS developer and a kernel maintainer for the arm-soc tree) in getting Linux running on the new Chromebook. Several developers have already succeeded in doing this, running a variety of Linux distributions – openSUSE/Ubuntu/Fedora/Debian are all reported to work well on the device (with some minor caveats). My intention here is to provide the steps needed to get a more traditional Linux distribution running on the Chromebook. These include the initial steps that Olof provided with some additional input from members of the ARM community like Marcin (thanks!).
There are a few pre-requisites needed to get the job done:
On your Chromebook1. In order to boot another operating system on your Chromebook you first need to enable the "Developer Mode", the Chromium project has the required steps needed. Please note that enabling "Developer Mode" will effectively re-format your device so ALL DATA WILL BE LOST.
2. Create a recovery image for the Chromebook (just in case). In a browser head to 'chrome://imageburner' and follow the steps.
3. Create a tarball of the Chrome OS root filesystem. This will come in handy as you will need some components from it and also serves as a good reference point.On the Chromebook open a terminal either in the browser with 'Ctrl+Alt+T' or a virtual terminal with 'Ctrl+Alt+->' (forward arrow, 3rd key from the left, top row, near the esc key).
There are numerous ways one can get the tarball off like scp'ing the tarball from Chrome OS to your desktop/laptop, I found the easiest way was copying to external media on the Chromebook. On your desktop/laptopThis is all done on a Linux machine (sorry I've not tried it on Windows or OSX)4. Make sure you have the 'gdisk' utility installed
5. Get your target root filesystem. Make sure that your target Distribution is built for Hard Float.
6. Extract the Chrome OS tarball.
7. Obtain a target SD Card (I am using a 32GB class 10 micro-SD card with adapter) Now that the pre-requisites are completed, it's time to move onto preparing the target SD card. Insert the card into your desktop/laptop and note the device id, running 'dmesg' from a terminal after inserting the card will show you something along the lines of 'sd 6:0:0:0: [sdX] Attached SCSI removable disk'
Replace 'sdX' with the correct id for your card. Ensure the target card is un-mounted and not ejected.
8. The first thing that needs to be done is to create a GPT partition table on the target card, from a terminal run
9. Using gdisk we set the sector alignment to 4M
10. Then create the target partitions, the first two are for the kernels, and the third is for the root file system. We are using two kernel partitions to make it easier to have a one kernel always working and another for testing, so should the testing kernel be fundamentally broken one can still boot the system with a working kernel.
11. We now need to create a filesystem for the root partition.
12. Now that we have the target card almost ready we need to extract our filesystem to the root partition. Mount the correct partition somewhere (in this case we are using '/mnt')
Replace the path to the root filesystem below with the correct one for your choice
13. As we are initially going to use the same kernel as Chrome OS, we will need to copy over the contents of '/lib/firmware' and '/lib/modules' to the root filesystem to get things working.
To get everything working under your Linux distribution some additional steps are needed as there may be a few items that do not work straight "out of the box" like Xorg, Touchpad & Sound.
14. The touchpad requires an additional configuration file called 50-touchpad.conf placed into /etc/X11/xorg.conf.d/ Using your preferred text editor create the required file
15. To get audio working copy the contents of '/usr/share/alsa/ucm' from Chrome OS
Then from within your new Linux powered Chromebook run: (DO NOT run it on your desktop/laptop)
16. We can now unmount the SD card
The next exercise is to get the kernel onto the SD card. This task is carried out on the Chromebook under Chrome OS. You will need to be very careful as it is possible to destroy the installed system and will need to re-install using the recovery image.
17. The kernel command line is going to be different to what is used for the installed ChromeOS, so the kernel blob will need to be repacked. Follow the earlier steps to get a terminal with a shell up.
18. Now move the target SD card to the Chromebook and write the kernel to the prepared kernel partitions
19. To be able to boot from your new SD card USB boot needs to be enabled (this also covers SD cards). From the terminal shell run
20. The last step is to mark the kernel partitions as known to be god so that the firmware will attempt to use them when you boot up. This marks both partitions as successful, and gives the first partition a priority of 10 and the second a priority of 5. Technically both creating a label and marking as successful aren't needed but it is good practice.
Once that is all done you are ready to boot into your preferred Linux distro. When you reboot the Chromebook you will be presented with the devmode screen, press Ctrl+U to boot from the SD card or Ctrl+D to boot Chrome OS from the internal disk.
Most distributions are now packaging up all the required components to make things slightly easier and also make things work better. So check your distribution's package archives for things like an updated alsa (to correctly provide the Daisy I2S profiles), xf86-video-armsoc (to provide better un-accelerated graphical support). xf86-input-cmt (to provide better touchpad performance), and possibly a few others.
Do you happen to run a Linux distribution that I've not mentioned, maybe you run a different operating system to Linux like FreeBSD? If you do, we'd love to hear from you. We'd also like to hear about how you use the Chromebook, especially if it isn't in a more traditional laptop scenario.
Thanks for the writeup! I believe step 17 is not quite correct. Shouldn't all the "-" be "--"? Not to be picky, but vbutil_kernel wouldn't accept it otherwise! Also, the directions are for a SD card; is it possible to use a USB stick instead? I tried that, but at the very end the /dev/mmcblk1* files didn't exist, but is there a different block device that one can use instead for a USB stick?