Wayland Linux 5.2 Gnome3 on Rockpi4!

Seriously I kid you not and if you can not be bothered with DiY the below is an image I will keep updating as things improve
The image above has got a bit fat with me themeing Adapta and various bits but the default below is still quite slim.

Start with Manjaro minimal as this gives us all the latest packages of Arch and much of the hard work of the RockPi4 image has been done for us.

Currently its running 5.1 but after a sudo pacman -Syu a full update/upgrade will take us to 5.2
5.2 has some boot delays that also seemed to escape the 5.2 window so we will have to put up with them.
What is great though is Manjaro run RC versions and when 5.3-rc1 is in the wild we can upgrade through pacman and hpefully incrementally see the end of a couple of bugs.
5.2 and Mesa 19.1.2 still have some problems dunno but they seemed to miss the window so we are going to jump ahead and grab the current master which is mesa 19.2.0-devel
First we will install Gnome as the default is wayland and it will cut down the libs we need for the mesa build

sudo pacman -S gnome  gnome-software-packagekit-plugin gnome-nettool archlinux-appstream-data 

Then we build the latest and most working mesa

sudo pacman -S bc python-pip flex bison base-devel ncurses cmake xorg-util-macros git valgrind llvm
sudo pip install scikit-build mako
# Install scikit-build mako first before meson ninja
sudo pip install meson ninja
git clone https://gitlab.freedesktop.org/mesa/mesa.git -b master
cd mesa
mkdir build
meson -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro -Dlibunwind=false -Dprefix=/usr build/
ninja -C build/
sudo ninja -C build/ install
sudo systemctl enable gdm.service
sudo reboot

Apart from annoying boot delays enjoy and play!

If you have a 2gb RockPi4 use zram and even if you have more.

git clone https://github.com/StuartIanNaylor/zram-config
cd zram-config
sudo sh install.sh
nano /etc/ztab

I have 2gb if 4gb just double the mem_limit and resultant disk_size (2000M 6000M)

# swap  alg     mem_limit       disk_size       swap_priority   page-cluster    swappiness
swap    lzo-rle 1000M           3000M           75              0               1000

# dir   alg     mem_limit       disk_size       target_dir              bind_dir
#dir    lz4     50M             150M            /home/pi                /pi.bind

# log   alg     mem_limit       disk_size       target_dir              bind_dir                oldlog_dir
#log     lzo-rle 50M             150M            /var/log                /log.bind               /opt/zram/oldlog

sudo reboot
If not anything else you can test out the new lzo-rle compression supposed to be extremely light and fast.
Mem_limit is the max allocated to zram disk size is harder as its a virtual size so we are expecting approx 3:1 compression

[rock@rockpi4 ~]$ zramctl
/dev/zram0 lzo-rle         3G 27.7M  8.4M 11.7M       6 [SWAP]
[rock@rockpi4 ~]$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       393Mi       503Mi       779Mi       1.1Gi       783Mi
Swap:         2.9Gi        29Mi       2.9Gi

With wayland you can run gtk+ apps and ones that use clutter/clutter_gtk with
GDK_BACKEND=wayland gnome-calculator for GTK+ apps like gnome-claculator or
GDK_BACKEND=wayland CLUTTER_BACKEND=wayland cheese for clutter apps like cheese
To be honest I am a bit bemused if an app needs it or not basically if it crashes on run try the above
Edit the desktop files in /usr/share/applications to suit.

Your last image didnt boot on my rockpi4. Ive tested kde with the idea of switching to wayland… Anyway, the lack of wifi on these manjaro builds ( even my usb wifi device wont work) prevent me to try out this amazing work. I will wait some more months.

I haven’t looked since 5.2 but 5.2.1 is out but it still has some really big boot delays so likely that as it was booting fine.
To be honest I got a bit carried away with Gnome and it runs smooth but I went a bit crazy with theming, Adapta theme and various bits and actually you really notice it.
Strangely Panfrost seems to be running OpenGL faster via X11 and doesn’t have all the app compatibility problems.
I haven’t really tested so could be wrong but the Manjaro images on 5.2.1 are working fine the above was built as soon as 5.2 was released but fixes where quickly released in 5.2.1 and it was the kernel not Manjaro.
Manajaro are going to stick mainline but there is a DTS error where the top USB is set to OTG so if testing USB make sure its not that port.
The WiFi/BT is the crappy Broadcom chip that was on the Pi3 that has been sold and repackaged several times now and now called APxxxx something.
It always had problems with BT & Wifi running at the same time and the sdio always needed tweaks dunno if these have been done or not.
I know its working but after time fails and a likely quick fix is just to disable the BT.
I am waiting for 5.3 as there are a huge rake of patches in there that are more related to the kernel than the Rockpi that should solve the boot delay but if testing get a serial console and check the output of why it isn’t booting.
5.3 is prob 2 month way minus a couple of days, but those fixes are likely to turn up into 5.2 as even though released in certain aspects still seems slightly broken.
So not really sure current Manjaro is the same as they released with 5.1 it needs a pacman -Syu for update and a reboot.
I would actually stick with X11 for now as I am totally bemused that performance seems to be better than wayland by about 30%!