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.

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]

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 irc:// 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.

Todo.txt-more: Efficiently managing your todo list and your time

Todo.txt More: Efficiently managing your todo list and your time Introduction I tend to get fairly enthusiastic when it comes to lists, even more so when there's a chance to optimise my productivity. The end of the year is a time for looking backward an…

via Proycon's website December 31, 2022

The PineTab2 is a new, faster Linux tablet - and it's not alone

In their December update, Pine64 announced the PineTab2, which is the successor to their PineTab from 2018. As a major change, the PineTab2 upgrades the slow A53-based A64 SoC with an A55-based Rockchip RK3566, the same chip that was used for the Quartz64…

via TuxPhones - Linux phones, tablets and portable devices December 19, 2022

I shall toil at a reduced volume

Over the last nine years I have written 300,000 words for this blog on the topics which are important to me. I am not certain that I have much left to say. I can keep revisiting these topics for years, each time adding a couple more years of wisdom and impro…

via Drew DeVault's blog December 1, 2022

Generated by openring