installing postmarketOS on a Duet 3


for a long while, i've always wanted a small tablet with keyboard and stylus that runs Linux proper. i've had my eyes on the Duet line from Lenovo for a while now, but didn't like the idea of having such a device shackled to the whims of Google. still, after hearing some advice from others about how easy it was to install a proper version of Linux on chromebooks these days, i decided to give one a go, and purchased on when it was on sale for less than $300.

so anyways, if you'd like to install postmarketOS on one yourself, here's what you'll need to do:

STEP 1: ENABLE USB BOOTING

in order to run whatever you want, you'll need to enable developer mode. it comes with one drawback — which is that upon rebooting there's a warning screen — but it's easier than trying to compile coreboot or whatever.

to enter developer mode, make sure it's turned off, then press and the power button and volume buttons all at the same time. it's fiddly and might not work the first time, but you'll know it works when you're greeted by a cool dark screen saying you're in developer mode.

after booting into developer mode, ignore the setup prompt, and instead press CTRL+ALT+F3. at the terminal, type in the following command:

~$
sudo crossystem dev_boot_usb=1 dev_boot_signed_only=0

congratulations! you can now boot from USB.

STEP 2: INSTALLING POSTMARKETOS

get a prebuilt image from here and put it on a USB drive. boot from it, then log in with the password 147147.

note that everything will be a bit fucky at this point. we're only here to get pmbootstrap and install to the eMMC storage.

~#
apk add pmbootstrap
pmbootstrap init
pmbootstrap install --disk=/dev/mmcblk1

note that the emmc storage may mount itself in a different spot, so use lsblk to double check.

once pmbootstrap is done installing, reboot off the internal storage and enjoy your newly Linuxed tablet!

STEP 3: FIX EVERYTHING

…wait, stuff's broken? well, yeah, okay, we haven't configured things yet.

to fix everything, we'll need to populate a few files.

/etc/udev/rules.d/61-cros-ec-accel.rules
ACTION=="remove", GOTO="sensor_end"

SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="platform", 
	ATTRS{modalias}=="platform:cros-ec-accel", 
	ENV{ACCEL_MOUNT_MATRIX}="0, 1, 0; -1, 0, 0; 0, 0, -1", 
	GOTO="sensor_end"

LABEL="sensor_end"
/etc/libinput/local-overrides.quirks
[Touchpad pressure override]
MatchUdevType=touchpad
MatchName=Google Inc. Hammer
AttrPressureRange=20:10

[Google Chromebook Krane Stylus Digitizer]
MatchUdevType=tablet
MatchDeviceTree=*krane*
MatchBus=i2c
ModelChromebook=1
AttrPressureRange=1100:1000
/etc/libwacom/google-krane.tablet
[Device]
Name=hid-over-i2c 0603:604A Stylus
ModelName=
DeviceMatch=i2c:0603:604a
Class=ISDV4
Width=5.35433
Height=8.54331
IntegratedIn=Display;System
Styli=@generic-no-eraser

[Features]
Stylus=true
Touch=false

once putting all that into place, run sudo libwacom-update-db and reboot. now you can enjoy a functional touchpad and pen.

BONUS TIPS:

  • you'll probably want to install Flatpak, as not every app you might want is available through the postmarketOS repos. some just don't have ARM versions, but many have ARM versions as flatpaks!
  • if you're getting weird certificate errors when using pmboostrap, make sure the system clock is set to the correct day.
  • if you want to install all the Noto fonts at once without typing them all in manually, you can use this command:
    apk search -qe 'font-noto-*' | xargs apk add
topics annoyance

your browser is stalking you.

this website is best viewed in browsers which do not implement the Topics API, such as Firefox.