User:Ollieparanoid/Run wlroots with fbdev



Documentation of my efforts to run wlroots with fbdev, so it runs on downstream kernels. I have created a pull request to wlroots with the feature, in which it was suggested to turn this fbdev backend into a third party backend. This will be the next step (if you'd like to help out, see ). Meanwhile, here are some notes on how to build my wlroots branch from source and running it on your phone.

Demo video
To get an idea of the performance, CPU usage etc. (there's a lot to be optimized), see this demo video running on the Nexus 4.

Update: the initial performance (as in the video) was pretty bad, thanks to helpful review comments it's much better now.

Caveats
This was tested with the Samsung Galaxy S2 (i9100) and Nexus 4 (lg-mako).

Change framebuffer mode to RGBA
If the colors are off, make sure that your kernel has RGBA configured as framebuffer mode. This is hardcoded for now, until wlroots uses its upcoming own swapchain. In the i9100 kernel, it was needed to set, the lg-mako kernel had this mode set by default. Search for RGBA in your device's linux pmaport.

Fix elogind not starting
On lg-mako, elogind was not starting up. When trying to start it manually (grab the command from the openrc service file), it would fail with: [  21.387150] elogind-daemon[1538]: Failed to determine whether /sys/fs/cgroup is a mount point: Symbolic link loop [  21.388341] elogind-daemon[1538]: Failed to mount cgroup at /sys/fs/cgroup/elogind: No such file or directory

To fix this, apply this patch to your kernel (as in ).

MR to fix this for lg-mako:

SSH may be broken on edge
As of writing, SSH was broken on edge : after authenticating, the phone would abort the connection. I worked around this by copying the pmaports relevant to the device I wanted to test from edge to current stable, and then built it against stable.

Can't flash big images to lg-mako
Although the userdata partition of lg-mako is 5.8 GB in size, fastboot refused to flash a fully blown phosh install to it. I worked around this by building an install with UI=none, and installing related packages afterwards with apk.

gnuchess is broken?
In my demo video I wanted to play chess. gnome-chess didn't work with gnuchess, but building the gambit-fruit chess engine from source worked. Put the gfruit binary in  and gnome-chess will pick it up and use it.

Upstream issue: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11983

Installing dependencies
To build wlroots, sway and phoc, install these packages. Set up USB Internet if necessary.

Clone sources
Then clone the relevant sources:

Build and install wlroots
Remember to always rebuild compositors against wlroots before running them!

Running a compositor
The only way I was able to set up the session properly, is by letting lightdm do it. Install, then edit   and make it point to some script you can easily edit (e.g.  ). Inside the wrapper script, put:

Set scaling
To change the scaling of Phosh, put this in your  (same works for sway with sway's config etc.):

[output:FBDEV-1] scale = 2

(Note that many pmaports use, that's the legacy path which also works but should be changed to   eventually. See phosh.in.)