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:

/home/$BUILDUSER/packages/main/
/home/$BUILDUSER/packages/community/
/home/$BUILDUSER/packages/temp/

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 https://gitlab.com/postmarketOS/pmaports.git
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 https://git.sr.ht/~mil/sxmo-utils
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/public-inbox@lists.sr.ht [mailing list etiquette]

Articles from blogs I follow around the net

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

A few ways to make money in FOSS

I work on free and open-source software full time, and I make a comfortable living doing it. And I don’t half-ass it: 100% of my code is free and open-source. There’s no proprietary add-ons, no periodic code dumps, just 100% bona-fide free and open source so…

via Drew DeVault's blog November 20, 2020

How to Make Biomass Energy Sustainable Again

From the Neolithic to the beginning of the twentieth century, coppiced woodlands, pollarded trees, and hedgerows provided people with a sustainable supply of energy, materials, and food.

via LOW←TECH MAGAZINE September 20, 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

Generated by openring