Compiling crust for pinephone on Postmarketos

Published 2020-07-06 on Anjan's Homepage

Crust is now available from postmarketos' official repos! This post is now obsolete but is kept as an archive for how to test new kernels. Use at your own risk

Crust firmware enables acceptable battery life on the pinephone. For me, it is the last feature I need for the pinephone to be daily driver ready. Here is how to install the experimental crust branch on the pinephone so that you can give the postmarketos and sxmo team feedback.

1 Postmarketos Setup

First, install the crust packages from postmarketos. Note: I assuming you have setup abuild according to Alpine Linux's creating an Alpine package guide.

Add the following repositories to /etc/apk/repositories:


Note: Replace $BUILDUSER with the user that will be running abuild.

Next, build the new versions of device-pine64-pinephone, crust, and u-boot-pinephone packages from pmaports' feature/crust branch:

git clone
cd pmaports
git checkout feature/crust

Build the packages for crust using abuild:

cd device/community/device-pine64-pinephone && abuild -r
cd main/crust && abuild -r
cd temp/u-boot-pinephone && abuild -r

We can install these newly built packages by running:

sudo apk update && sudo apk upgrade -a
sudo apk add crust

Finally, as Danct12 says in the crust merge request thread - "upgrading the u-boot-pinephone package isn't enough, you'll need to run this in the command line":

If postmarketos is booting from EEMC:

sudo dd if=/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl.bin \
of=/dev/mmcblk2 bs=1024 seek=8 # for EEMC

If postmarketos is booting from SD card:

sudo dd if=/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl.bin \
of=/dev/mmcblk0 bs=1024 seek=8 # for SD card

You must reboot to have your changes take affect. To verify that you have installed crust correctly, run the following command and check if your output matches:

pinephone:~$ cat /sys/power/mem_sleep
s2idle [deep]

2 Sxmo Setup

Crust on sxmo is on an experimental git branch. To update sxmo's scripts to support crust, run the following commands:

sudo apk add libx11-dev xproto linux-headers # make dependancies for sxmo-utils
git clone
cd sxmo-utils
git checkout f/crust-screenlock-suspend # crust branch
make programs/sxmo_screenlock
sudo cp programs/sxmo_screenlock /usr/bin
sudo apk del libx11-dev xproto linux-headers # remove make dependancies

When you turn off the screen, the LED shows the power status of the phone. Purple is screenoff, red is crust. Triple click volup and you get red (crust). Triple click voldown and you get purple/blue toggle (screenoff/on) On irc pucilpet said: modem is receiving calls and texts but does not "ring". So you will see the call once unlocked or might even pick it up if you unlock mid-call.

Remember to repeat this process anytime there's an update to sxmo-utils' f/crust-screenlock-suspend branch or pmaports' feature/crust branch. Please document your experience in the pmaports crust merge request - I have notifications on for when commits are pushed. If you have issues with sxmo, drop by #sxmo on freenode or send a message to the sxmo mailing list.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~anjan/ [mailing list etiquette]

Articles from blogs I follow around the net

These articles/blogs do not represent my own opinions or views.

Linux development is distributed - profoundly so

The standard introduction to git starts with an explanation of what it means to use a “distributed” version control system. It’s pointed out that every developer has a complete local copy of the repository and can work independently and offline, often contra…

via Blogs on Drew DeVault's blog September 2, 2020

Eshell versus M-x shell

I’ve used and defended Eshell for years. Sadly, Eshell has some long standing issues that I grew tired of in the long run. So I’ve decided to switch to M-x shell and see how much of my Eshell workflow I could port. Language and the underlying shell pr…

via Pierre Neidhardt's homepage June 26, 2020

Thermoelectric Stoves: Ditch the Solar Panels?

Wood stoves equipped with thermoelectric generators can produce electricity that is more sustainable, more reliable, and less costly than power from solar PV panels.

via LOW←TECH MAGAZINE May 26, 2020

Generated by openring