Tuesday, January 3, 2017

Travels with a Chromebook

Two years ago I wrote A Note Of Thanks as I switched my disposable travel laptop from an Asus Seashell to an Acer C720 Chromebook running Linux. Two years later I'm still traveling with a C720. Below the fold, an update on my experiences.

As I wrote two years ago, I started by replacing ChromeOS with HugeGreenBug's port of Ubuntu 14.04. This gave me almost exactly the UI I was then running on my desktop, so I was happy with one exception:
I'm still not used to the much bigger touch pad, and keep accidentally moving the cursor by touching the touch pad with the balls of my thumbs.
This turned out to be a permanent irritation (but see below for what I should have done to fix it). Although the combination of the C720 and Ubuntu 14.04 gave sterling service for a long time, I started noticing an occasional crash. One of them was a very spectacular snow crash, which caused me to suspect a hardware problem. It was a day and a half before a trip, so I resorted again to Amazon's same-day delivery for a second C720. By the time it arrived all seemed well again with the first one, so I left with it and had no problem on the trip.

Now I had two C720s, so I could experiment with alternate Linux ports. I installed GalliumOS on the second one, and worked with it for a while. It was totally crash-free, being based on Xubuntu 16.04 was significantly more up-to-date, and it was certainly lean-and-mean. Derrick Diener's GalliumOS: The Linux Distro Specially Designed for Chromebook is a good review of GalliumOS.

But I just couldn't come to terms with the XFCE desktop and the way the touchpad had been configured to mimic the ChromeOS touchpad. I'd traded one irritation for two. Then I found Mark Solters' Ubuntu 16.04 on the Google Pixel 2, which reported:
I hit upon trying Linux Mint 18 “Sarah”, currently beta. This version of Mint is 16.04 based, and the installer boots on the Pixel 2!
So I downloaded Linux Mint 18.1 "Serena" - Cinnamon (64-bit), wrote the .iso to a USB drive, popped it into the first C720 and powered up. The Mint live system came right up! I played with it for a while. Everything seemed to work, and the Cinnamon UI was a lot more to my taste than XFCE. Worth a try. After backing up my files from 14.04, I double-clicked on "Install Linux Mint".

After you answer the questions about keyboard and time zone and so on, the install starts with a worrisome long pause with the spinning cursor, but then things proceed normally with a progress bar. After it finished and I rebooted, I had a default Linux Mint system with 19GB of free space.

My next step was to connect to my WiFi network and
sudo apt-get update
sudo apt-get upgrade
which updated 12 packages. I have no travel for the next month and a working if slightly irritating environment on C720 #2, so I can take the opportunity to clean things up and customize a nice fresh environment on C720 #1. For the programming environment I needed:
  • git - the LOCKSS Program is converging on gitlab.com and gitlab CE.
  • emacs - which I still use for programming although I also use vi.
  • The JDK, ant, libxml2-utils and junit - needed to build the LOCKSS software.
  • Docker
For more general needs I added:
  • TeX Live- still my favorite environment for writing papers.
  • KeePassX - everyone should use a password safe.
  • gnucash
  • zoom.us - a program committee I'm on uses this for distributed meetings, it works really well.
So far, everything else I need is in the default install. At this point I have 17GB free. Not a lot, but as in the 14.04 days I will travel with an external SSD that holds my development environment.

Then I closed the lid, had a cup of tea, and opened the lid again. Things seemed to be working but, as I quickly discovered there was a problem. It turns out that the Mint kernel shows symptoms that appeared on Chromebook Linux wikis back in 2014:
  • Suspend/resume works the first time, but the next time the screen locks but the processor keeps running indefinitely. Shutdown behaves similarly.
  • And after a resume /var/log/kern.log is continually spammed with messages from ehci-pci saying resume error -19.
Not good. I tried various fixes found by Google-ing but none worked. Then I had an inspiration. I had two machines:
  • C720 #2 with a working kernel and a userland I didn't like.
  • C720 #1 with a broken kernel and a userland I liked.
All I needed to do was to get C720 #1 to boot the GalliumOS kernel not the Mint one. I re-installed vanilla Mint 18.1 on C720 #1 then here is what I did to it.

Stage 1 was to get the GalliumOS fixes relevant to the suspend/resume issue into the Mint userland:
  • Check out the CalliumOS config files for Haswell by:
    git clone https://github.com/GalliumOS/galliumos-haswell
  • Copy each of the files into its appropriate place.
Stage 2 was to get the GalliumOS kernel installed on C720 #1:
  • Create a file /etc/apt/sources.list.d/additional-repositories.list containing the line:
    deb http://apt.galliumos.org/ xenon main
  • Copy the file /etc/apt/trusted.gpg.d/galliumos.gpg from C720 #2 to C720 #1.
  • Run synaptic, reload, search for linux-image-galliumos, mark it for installation, apply.
  • Set the grub bootloader to display its menu by default so that if something goes wrong you can boot the Mint kernel using the "advanced options" menu item. Edit /etc/default/grub to read:
  • Reboot, and the system comes up:
    $ uname -r
Now suspend/resume works just the way it does on GalliumOS!

Three years ago redditor SuccessInCircuit posted List of fixes for Xubuntu 13.10 on the Acer C720. Some of these fixes still seem to be relevant:
  • GalliumOS follows SuccessInCircuit's advice to optimize for the C720s SSD. So I edited the root file system entry in /etc/fstab to be:
    /dev/mapper/mint--vg-root / ext4 discard,relatime,errors=remount-ro 0 1
  • I find it necessary to disable the touchpad while typing. SuccessInCircuit says to do this with syndaemon, but there is a better way for Ubuntu 16.04, installing a touchpad control applet in the tray:
    $ sudo add-apt-repository ppa:atareao/atareao
    $ sudo apt-get update
    $ sudo apt-get install touchpad-indicator
  • Brave souls have upgraded the M.2 SSD, reinstalled ChromeOS, then installed Linux, but I'm not yet up for that despite the lack of space.
I'm now working on building the nice fresh environment on C720 #1 before my next trip. If I encounter anything else interesting I'll comment on this post.

No comments: