BY NICHOLAS BISHOP, SENIOR SOFTWARE ENGINEER
I started working with Neverware’s CloudReady team over a year ago, and along the way I’ve been surprised by many technical aspects of the operating system CloudReady is based on, ChromiumOS. Most of these things are easy enough to learn about via Google, but until I joined Neverware I just didn’t know much at all about Chromebooks and their operating system.
My first big surprise: ChromiumOS is based on Gentoo! Perhaps this is common knowledge among other Linux users, but I was surprised to find a high-profile Gentoo fork hiding in plain sight. Of course ChromiumOS has many differences from a typical Gentoo system (if there even is such a thing as a typical Gentoo system), but the operating system is essentially built via emerge commands just like Gentoo. (Aside: Gentoo recently switched from CVS to Git [https://www.gentoo.org/news/2015/08/12/git-migration.html], which I expect will help attract new contributors to the project. )
I recall being very confused initially about how the Chromium browser fits into the operating system build process. The repo initialization step downloads many source packages, but the browser isn’t among them. It turns out that the browser ebuild (chromeos-base/chromeos-chrome) is a little different from many of the other git-based packages; the ebuild can be set to download the source during the build or to use an existing clone managed by the developer. The ebuild then delegates the actual building to the browser’s normal build system (currently GYP [https://gyp.gsrc.io/], but it’s in the process of being migrated to GN [https://chromium.googlesource.com/chromium/src/tools/gn/]).
The browser repository is worth a special mention because it is really big. Big enough that Github and Bitbucket both fail to create mirrors of the code. That was initially annoying for us because we use Github for a lot of our work. We moved our browser repo over to Gitlab.com because they allow arbitrarily-large repositories. Unfortunately the massive repository made the Gitlab.com browser interface slow to a crawl, so we had to host our own copy of Gitlab. That turns out to be very easy to do; we now have Gitlab running on an EC2 instance and the performance has been great so far.
There are some additional surprises in the ChromiumOS plumbing. Many Linux users have less-than-fond memories of distros switching to PulseAudio. Not a problem for ChromiumOS! It has its own audio server called CRAS. Quoting the CRAS documentation: “The basic design combines the timer-driven wakeup scheme of pulseaudio with the synchronous audio callbacks of JACK”. I’m not very knowledgeable about sound servers, but it’s always interesting to see competing technologies.
One upcoming plumbing change that I’m looking forward to learning more about is the transition from X11 to Freon. Transitioning away from X11 is a common theme among many Linux distros; Ubuntu has been working on Mir and everybody else is looking to Wayland (including my beloved Fedora). ChromiumOS has a different solution. The Chromium browser already takes care of drawing the entire ChromiumOS UI (including the sign in wizard, the task bar, the app launcher, etc). This means that X11 is really only handling one window, so rather than replacing X11 with another display server like Wayland it will start interacting directly with the DRM/KMS APIs. For now CloudReady is still using X11, but I expect we’ll be experimenting with Freon builds in the coming months.