Compiling crust for pinephone on Postmarketos
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:
/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 -rWe can install these newly built packages by running:
sudo apk update && sudo apk upgrade -a
sudo apk add crustFinally, 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 EEMCIf 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 cardYou 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 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 dependanciesWhen 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://irc.oftc.net/ 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]