Thursday, March 9, 2023

C720 Linux Update

The three Acer C720 Chromebooks I wrote about in:
are all still running Linux just fine despite the one I'm typing on being more than 8 years old. Below the fold I have some good news and some no-so-good news.

I was becoming a little concerned by the fact that the 5.0-series kernel I was stuck with was getting long in the tooth. So as an experiment I wiped C720 #3 and:
  • Installed Mint 21.1 from scratch with LVM and full-disk encryption.
  • Installed Mint 21.1 from scratch without full-disk encryption and with encrypted home directory, and updated to the current 5.15.0-67 kernel.
Below the fold, my notes on these experiments.
  • With LVM and full-disk encryption the system sleeps and resumes correctly, but the problem that appeared with kernel 5.4.0-42 is still present, namely that with full-disk encryption the second cold-boot of the system fails having apparently flipped the developer mode bit so that the BIOS refuses to boot the non-Chrome OS.
  • Without full-disk encryption the system sleeps and resumes correctly, and can be shutdown and rebooted. So if I can live with just home directory encryption I can resume working with a current kernel.
  • The problem that appeared on Chromebook Linux wikis back in 2014 has re-appeared:
    after a resume /var/log/kern.log is continually spammed with messages from ehci-pci saying resume error -19.
    The fix described here seems to work. Create a file /usr/lib/systemd/system-sleep/c720-suspend-fix.sh:
    #!/bin/bash
    
    case $1/$2 in
      pre/*)
        # Unbind ehci for preventing error 
        echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
        ;;
      post/*)
        # Bind ehci for preventing error 
        echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
        ;;
    esac
    
  • Since full-disk encryption is unusable, the alternative is home directory encryption. But there's a problem there that Mint 20 inherited from Debian's switch to systemd:
    The move to systemd caused a regression in ecryptfs which is responsible for mounting/unmounting encrypted home directories when you login and logout. Because of this issue, please be aware that in Mint 20 and newer releases, your encrypted home directory is no longer unmounted on logout: https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1734541.
    Mint 21 still has this problem, but the fix described here works:
    • Comment out the lines about ecryptfs in both /etc/pam.d/common-password and common-session-noninteractive.
    • In /etc/pam.d/common-auth , change ecryptfs from optional to required.
    A reboot is required before the fix becomes effective.
So the current process for installing a C720 from scratch is:
  1. Re-install ChromeOS from the recovery disk. Do not configure it.
  2. Enter and configure developer mode by:
    • Turn on the Chrome OS device.
    • Press and hold the Esc + F3 (Refresh) keys, then press the Power button. This enters Recovery Mode.
    • Press Ctrl + D (no prompt). It will ask you to confirm, then the system will revert its state and enable Developer Mode. It clears the disk so with the expanded SSDs this takes a long time.
    • After reboot, press Ctrl + Alt + F2 to get a login prompt.
    • Use chronos as the username, it should not prompt you for a password.
    • Become superuser with sudo, use the command sudo su -
    • Execute crossystem dev_boot_usb=1 dev_boot_legacy=1
  3. Then install Mint 21.1 by:
    • After reboot with Mint 21.1 USB drive inserted, press Ctrl + L at the splash screen.
    • ESC to get the boot device menu.
    • Proceed with normal installation, do not encrypt disk, do encrypt home directory.
  4. Create /usr/lib/systemd/system-sleep/c720-suspend-fix.sh as above.
  5. Edit files in /etc/pam.d as above to get home directory unmounted on logout.
  6. Edit /etc/fstab to:
    /dev/mapper/mint--vg-root / ext4 discard,relatime,errors=remount-ro 0 1
    
  7. Install touchpad control by:
    • Execute:
      $ sudo add-apt-repository ppa:atareao/atareao
      $ sudo apt-get update
      $ sudo apt-get install touchpad-indicator
      
    • Install synaptics driver.
    • Create directory ~/.config/autostart and file touchpad-indicator-autostart.desktop in it containing:
      [Desktop Entry]
      Type=Application
      Exec=/usr/bin/python3 /usr/bin/touchpad-indicator
      Hidden=false
      NoDisplay=false
      Name[es_ES]=Touchpad Indicator Autostart
      Name=Touchpad Indicator Autostart
      X-MATE-Autostart-Phase=Applications
      X-MATE-Autostart-Delay=2
      X-MATE-Autostart-enabled=true
      X-GNOME-Autostart-Phase=Applications
      X-GNOME-Autostart-Delay=2
      

2 comments:

David. said...

Via msmash at /., the Wall Street Journal reports that Google has extended its support for Chromebooks to 10 years.

David. said...

Rupert Goodwins makes a good point in How to deorbit the Chromebook... and repurpose it for innovators, and El Reg's headline writers have fun in the sub-head:

"Better than a Pi? It’s an open and shut case"