Page 1 of 1

[solved] PinePhone with sway: Xwayland unable to start

Posted: Sun Feb 01, 2026 7:28 pm
by viacheslavg
Hi,

I'm trying to setup Gentoo on PP with OpenRC.
As DE I'm trying to setup SXMO (wayland variant) together with tinyDM.

Partially it is working however I have troubles with starting Xwayland. Seems like it can't start because of some issue with EGL.

In tinydm logs I have

Code: Select all

Sxmo is not running
--- tinydm ---
Date:    Sun Feb  1 18:19:01 -00 2026
Session: /usr/share/wayland-sessions/swmo.desktop
Desktop: swmo
Exec:    sxmo_swayinit.sh
---
Sxmo is not running
deviceprofile file /usr/bin/sxmo_deviceprofile_pine64,pinephone-1.2.sh loaded.
00:00:00.142 [ERROR] [wlr] [render/egl.c:208] EGL_EXT_platform_base not supported
00:00:00.142 [ERROR] [wlr] [render/egl.c:523] Failed to create EGL context
00:00:00.142 [ERROR] [wlr] [render/gles2/renderer.c:499] Could not initialize EGL
00:00:01.223 [ERROR] [wlr] [backend/drm/util.c:65] Failed to parse EDID
[
  {
    "success": true
  }
]
2026-02-01 18:19:05 - [swaybg-1.2.1/main.c:278] Could not find config for output DSI-1 ((null) (null))
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
[
  {
    "success": true
  }
]
cat: /run/user/1000/sxmo.state: No such file or directory
xwayland glamor: failed to setup GBM backend, falling back to sw accel
XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) 
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE) 
00:00:02.417 [ERROR] [wlr] [xwayland/server.c:269] Xwayland startup failed, not setting up xwm
cat: /run/user/1000/sxmo.state: No such file or directory
18:19:10 sxmo_state.sh: transitioning to stage unlock
18:19:10 sxmo_state.sh: this state is not suspendable
/usr/bin/sxmo_deviceprofile_pine64,pinephone-1.2.sh
18:19:13 sxmo_migrate.sh: All configuration files are up to date
[
  {
    "success": true
  }
]
18:21:10 sxmo_state.sh: transitioning to stage lock
18:21:10 sxmo_state.sh: this state is not suspendable
[
  {
    "success": true
  }
]
18:21:19 sxmo_state.sh: transitioning to stage screenoff
[
  {
    "success": true
  }
]
18:21:19 sxmo_state.sh: idle suspender started with timeout 3
My setup is

Code: Select all

# emerge --info
Portage 3.0.77 (python 3.13.11-final-0, default/linux/arm64/23.0/desktop, gcc-15, glibc-2.42-r4, 6.15.3-pinephone aarch64)
=================================================================
System uname: Linux-6.15.3-pinephone-aarch64-with-glibc2.42
KiB Mem:     3059892 total,   2292916 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 24 Jan 2026 21:15:00 +0000
Head commit of repository gentoo: c4281f3f0b14ae51f5f90632adb0611b37b63fcb
Head commit of repository bingch: bb16ca6960bf4490b25717c1dcfe8f8125acf0a1

Head commit of repository gagara: 5f0c04f0af9788115d4365436bd41a9172bd57a1

Head commit of repository guru: bfeb965afb116e1b65ecd3a5489c5e5d07ca1b07

Head commit of repository robertgzr: c7df49aad3ccce4d1256b113eca8aa7fb6e9f3eb

sh bash 5.3_p9
ld GNU ld (Gentoo 2.45.1 p1) 2.45.1
app-misc/pax-utils:        1.3.10::gentoo
app-shells/bash:           5.3_p9::gentoo
dev-build/autoconf:        2.72-r6::gentoo
dev-build/automake:        1.18.1::gentoo
dev-build/cmake:           4.2.1-r1::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r102::gentoo
dev-build/meson:           1.10.1::gentoo
dev-lang/perl:             5.42.0-r1::gentoo
dev-lang/python:           3.13.11::gentoo, 3.14.2::gentoo
dev-lang/rust-bin:         1.92.0::gentoo
llvm-core/llvm:            21.1.8::gentoo
sys-apps/baselayout:       2.18-r1::gentoo
sys-apps/openrc:           0.63::gentoo
sys-apps/sandbox:          2.46::gentoo
sys-devel/binutils:        2.45.1::gentoo
sys-devel/binutils-config: 5.6::gentoo
sys-devel/gcc:             15.2.1_p20251122::gentoo
sys-devel/gcc-config:      2.12.2::gentoo
sys-kernel/linux-headers:  6.18::gentoo (virtual/os-headers)
sys-libs/glibc:            2.42-r4::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

bingch
    location: /var/db/repos/bingch
    sync-type: git
    sync-uri: git@gitlab.com:bingch/gentoo-overlay.git
    masters: gentoo
    volatile: False

gagara
    location: /var/db/repos/gagara
    sync-type: git
    sync-uri: https://github.com/gagara/gentooverlay.git
    masters: gentoo
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    volatile: False

robertgzr
    location: /var/db/repos/robertgzr
    sync-type: git
    sync-uri: https://git.sr.ht/~robertgzr/portage
    masters: guru gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/arm64/binpackages/23.0/arm64
    verify-signature: None

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="@FREE curl"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -pipe"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=1 --load-average=4 --autounmask-write"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG
_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live compress-index config-protect-if-modified distlocks ebuild-locks fixlafiles
 getbinpkg ipc-sandbox merge-sync merge-wait multilib-strict news parallel-fetch pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-wa
rn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://trumpetti.atm.tut.fi/gentoo/ http://distfiles.gentoo.org"
LANG="C.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j4 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="http://192.168.1.137/aarch64-packages http://192.168.1.171/aarch64-packages"
PORTAGE_COMPRESS="bzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --e
xclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp/"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa arm64 avif bluetooth branding bzip2 cairo cdda cdr crypt cups dbus dri dts dvdr elogind encode exif flac gdbm gif gles2 gles2-only gpm gtk gui iconv icu ipv6 jpe
g jpegxl lcms libnotify libtirpc mad mng mp3 mp4 mpeg ncurses nls ogg opengl openmp pam pango pcre pdf pipewire png policykit ppds pulseaudio qml qt6 readline screencast sdl seccomp sound sp
ell ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wayland webp wxwidgets x264 xattr xcb xft xml xv xvid zlib" ADA_TARGET="gcc_15" APACHE2_
MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cg
id dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdi
r usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2
 crc32 v8" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq supersta
r2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGE
TS="AArch64" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_13" PYTHON_T
ARGETS="python3_13" RUBY_TARGETS="ruby32 ruby33" VIDEO_CARDS="lima" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark i
pmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, 
LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STR
IP, YACC, YFLAGS
I have lima module

Code: Select all

# lsmod | grep lima
lima                   65536  0
drm_shmem_helper       20480  1 lima
gpu_sched              40960  1 lima
Any idea what is missing? Who is providing EGL_EXT_platform_base extension? Is it really missing or wlroots just can't find it because of some misconfiguration?

Posted: Sun Feb 15, 2026 9:25 am
by viacheslavg
Answering myself, just in case I will face the same issue in future :)

I was able to sort out the problem. In fact there was several issues:

1. EGL error in the logs

Code: Select all

00:00:00.142 [ERROR] [wlr] [render/egl.c:208] EGL_EXT_platform_base not supported
00:00:00.142 [ERROR] [wlr] [render/egl.c:523] Failed to create EGL context
indeed EGL was broken, I didn't have hw acceleration. After series of trials and fails it got fixed. Most likely (not sure 100%) it got fixed after correct setup of locales. i.e. after

Code: Select all

# locale-gen
2. Xwayland was failed to start because of this problem:

Code: Select all

XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
As it appears Xwayland was broken because it was compiled against broken xkbcomp. The issue is related to https://bugs.gentoo.org/967084 (see my comments releated to cross-compile there).

So, after fixing xkbcomp and rebuilding Xwayland it start working.

Posted: Tue Feb 17, 2026 12:56 am
by flexibeast
viacheslavg wrote:Answering myself, just in case I will face the same issue in future :)
Or if others face the same issue! Thanks for sharing how you solved it, and for marking it "[solved]". :)

Posted: Tue Feb 17, 2026 11:16 am
by szatox
viacheslavg, could you please share the details required for turning a stage4 tarball into a bootable disk image for pinephone?
Somehow, finding this information tends to be the most difficult part of making custom images for ARM devices.

Posted: Wed Feb 18, 2026 12:55 pm
by viacheslavg
szatox,

so far I haven't reach to the point of creating bootable image. As of now I'm trying to get working Gentoo setup on PP first. I'm going to research this topic later.

Meanwhile, did you get a chance to look at https://github.com/GenPi64/Build.Dist? These guys have nice bootable RPi images.
I hope it is possible to borrow some stuff from there.

Posted: Fri Feb 20, 2026 8:21 pm
by szatox
I don't think rpi images will help that much, rpi uses kinda EFI style fat partition and looking around pp I've seen at least 3 different bootloaders mentioned, with uboot being the most common.
AFAIR uboot requires a bit of quite obscure configuration, so even though I succeeded with making a working image for an arm board (not pp, but using uboot) a long time ago, I still don't know how it is supposed to work and where the magic numbers came from, and I absolutely wouldn't be able to reproduce it. When time comes for another attempt at making something useful, I'm back to square 1: researching the basics.
Cross-compilling stuff was the easy part of that exercise.

Re: [solved] PinePhone with sway: Xwayland unable to start

Posted: Thu Apr 02, 2026 8:58 am
by viacheslavg
szatox,

Eventually, I've made an bootable image for pinephone (https://codeberg.org/vhahara/gentoo-mobile/releases)
As of now I use this https://codeberg.org/vhahara/gentoo-mob ... d-image.sh quick and dirty script to create and image based on existing installation from sdcard. You can use it as a hint for your own experiments.
However, it uses prebuilt binary of u-boot.
Later I may update README in that repo with the details how to compile/configure/install u-boot for pinephone.