My favorite device is a Chromebook, without ChromeOS

My favorite device is a Chromebook, without ChromeOS

我最喜欢的设备是一台 Chromebook,但它不再运行 ChromeOS

I wrote in 2024 a blog post about a how cheap and low powered Chromebook was one of my favorite devices to use day to day. At the time I was praising how well ChromeOS worked, especially thanks Crostini, a full Linux VM that you can run inside ChromeOS. Two years later, things changed. 我在 2024 年写过一篇博客,讲述了一台廉价且低功耗的 Chromebook 如何成为我日常最喜欢的设备之一。当时我还在称赞 ChromeOS 的表现,尤其是得益于 Crostini——一个可以在 ChromeOS 内部运行的完整 Linux 虚拟机。两年过去了,情况发生了变化。

I still have the same Chromebook Lenovo Duet 3, and up until now I would sporadically use it. However the experience is getting worse each day: I need to constantly resize the VM disk a few MBs because otherwise Crostini would fail to start; I got corrupted characters in the Terminal app, because of a recent introduced bug, and thanks to that I needed to disable the 2D Canvas Acceleration in chrome:flags. None of those issues are deal breaker since they both have workarounds, but they’re all recent issues. 我依然在使用那台联想 Duet 3 Chromebook,直到现在我还会偶尔用它。然而,使用体验却一天比一天差:我必须不断地为虚拟机磁盘扩容几 MB,否则 Crostini 就无法启动;由于最近引入的一个 Bug,终端应用出现了乱码,为了解决这个问题,我不得不禁用 chrome:flags 中的 2D 画布加速。这些问题虽然都有变通方法,算不上致命,但它们都是最近才出现的。

I kind think that this is the result of Android and ChromeOS getting merged. Google seems to be focusing more in getting Android to work well as a desktop OS (and this shows, I have a Pixel 9 Pro and its Linux Terminal VM is getting better) than to improve ChromeOS. That makes sense, in some ways Android is a much more capable OS than ChromeOS, but on the other hand it is sad to see ChromeOS to wither in real time. 我觉得这可能是 Android 和 ChromeOS 合并的结果。谷歌似乎更专注于让 Android 成为一个优秀的桌面操作系统(这一点很明显,我有一台 Pixel 9 Pro,它的 Linux 终端虚拟机正在变得越来越好),而不是去改进 ChromeOS。从某种程度上说,这合情合理,毕竟 Android 在某些方面比 ChromeOS 功能更强大,但另一方面,眼睁睁看着 ChromeOS 日渐凋零,实在令人难过。

Since I was kind frustrated with ChromeOS, I decided to take a look at something that I knew supported my Lenovo Duet 3 for some time: postmarketOS. For those who don’t know, postmarketOS is an Alpine Linux based-distro focused in replacing the original OS from old phones (generally running Android) with a “true” Linux distro. They also seem to support some Chromebooks because of their unique architecture and, luckily, they support my device under the google-trogdor platform. 由于对 ChromeOS 感到沮丧,我决定尝试一下我早就知道支持联想 Duet 3 的系统:postmarketOS。对于不了解的人,postmarketOS 是一个基于 Alpine Linux 的发行版,专注于用“真正的”Linux 发行版替换旧手机(通常运行 Android)上的原始操作系统。由于 Chromebook 独特的架构,他们似乎也支持一些 Chromebook,幸运的是,我的设备就在他们的 google-trogdor 平台支持列表中。

I will not go too deep in the install instructions, I recommend following the official instructions plus this blog post for Duet 3 itself. I did go a step further and replaced the pmbootstrap install command with: $ pmbootstrap install --disk=/dev/mmcblk1 --fde --filesystem=btrfs 我不会深入讲解安装步骤,建议参考官方指南以及这篇针对 Duet 3 的博客文章。我多做了一步,将 pmbootstrap install 命令替换为:$ pmbootstrap install --disk=/dev/mmcblk1 --fde --filesystem=btrfs

The --fde flag enables Full Disk Encryption that I think it is a must have for a portable device. Keep in mind that this will ask the password at every boot and the password screen will always show in portrait instead of landscape orientation, one of the quirks of using a LCD panel for tablets instead of one for laptops. --fde 参数启用了全盘加密,我认为这对便携设备来说是必不可少的。请记住,这会导致每次开机时都需要输入密码,而且密码输入界面始终以纵向而非横向显示——这是将平板电脑 LCD 面板用于笔记本电脑时会出现的小毛病之一。

The --filesystem=btrfs uses the (in)famous btrfs filesystem instead of the default ext4. I don’t have strong opinions either in favor or against btrfs, but since this is a more traditional distro (e.g., it is not an immutable distro like NixOS), I think that having support for snapshots is a must. --filesystem=btrfs 使用了(臭)名昭著的 btrfs 文件系统,而不是默认的 ext4。我对 btrfs 没有强烈的偏好,但由于这是一个更传统的发行版(例如,它不像 NixOS 那样是不可变发行版),我认为支持快照功能是必须的。

This --filesystem=btrfs sets a pretty good subvolume layout too: 这个 --filesystem=btrfs 参数还设置了一个相当不错的子卷布局:

# sudo btrfs subvolume list /
ID 256 gen 321 top level 5 path @
ID 257 gen 341 top level 5 path @home
ID 258 gen 298 top level 5 path @root
ID 259 gen 111 top level 5 path @snapshots
ID 260 gen 13 top level 5 path @srv
ID 261 gen 9 top level 5 path @tmp
ID 262 gen 341 top level 5 path @var
ID 263 gen 13 top level 262 path @var/lib/portables
ID 264 gen 167 top level 262 path @var/lib/machines

To be clear, this @snapshots subvol is not used by anything by default. I am using it with btrbk to get daily backups though: 需要说明的是,默认情况下这个 @snapshots 子卷不会被任何程序使用。不过我正在配合 btrbk 使用它来进行每日备份:

$ cat /etc/btrbk/btrbk.conf
compat busybox
timestamp_format long
snapshot_preserve_min 2d
snapshot_preserve 7d
volume /
  snapshot_dir /.snapshots
  subvolume .

If you’re coming from Alpine the commands above seems suspicious. Why systemd? Well, postmarketOS supports systemd, mostly because of KDE and GNOME, and I since I am using the later and prefer systemd anyway, this was more of a blessing than a curse to me. Having systemd installed by default also made installing Nix a breeze in postmarketOS, I just needed to do: 如果你是从 Alpine 过来的,上面的命令看起来可能有些奇怪。为什么要用 systemd?嗯,postmarketOS 支持 systemd,主要是为了兼容 KDE 和 GNOME。既然我使用的是 GNOME 并且本身就偏好 systemd,这对我来说反而是件好事。默认安装 systemd 也让在 postmarketOS 中安装 Nix 变得轻而易举,我只需要执行:

# doas-sudo-shim is missing some flags that are needed for the nix-installer,
# so we need to replace it with proper sudo
$ doas apk add curl sudo !doas !doas-sudo-shim
# The new experimental Nix installer: https://github.com/NixOS/nix-installer/
$ curl -sSfL https://artifacts.nixos.org/nix-installer | sh -s -- install --enable-flakes

And yes, I decided to use GNOME because I think this form factor (a hybrid laptop/tablet) works perfectly with it. I always thought that GNOME was a well polished interface but it is kind limiting for a desktop environment (this is why I particularly prefer KDE for desktops). But this device is not a desktop and GNOME fits like a glove. 是的,我决定使用 GNOME,因为我认为这种外形(笔记本/平板混合体)与它完美契合。我一直认为 GNOME 是一个打磨得很好的界面,但作为桌面环境来说它有些局限(这就是为什么我在桌面上更喜欢 KDE)。但这个设备不是桌面电脑,GNOME 用起来非常顺手。

Do I recommend postmarketOS for this device? It depends on your needs. I recommend reading the Wiki entry for the device first. For example, the pen is not working for me (but it seems there is a workaround), neither docking (if I undock and dock the device again the device stays in portrait). I don’t use the pen so the first issue doesn’t matter to me, and for the second issue I disabled the rotation sensor like the Wiki says. Also the external display support is wonky. 我推荐在这台设备上使用 postmarketOS 吗?这取决于你的需求。我建议先阅读该设备的 Wiki 条目。例如,手写笔对我来说无法使用(但似乎有变通方法),底座连接也有问题(如果我拆下再重新连接,设备会保持纵向显示)。我不使用手写笔,所以第一个问题对我没影响;至于第二个问题,我按照 Wiki 的说明禁用了旋转传感器。此外,外接显示器的支持也有些不稳定。