Skip to contentSkip to conversation

Add display manager and required configs

PATCH In review [email protected] 2 participants 4 messages Mar 12, 2025 – Mar 18, 2025

lore
Share & tools
lore
#0 lore raw

cover Add display manager and required configs

From: Randolph Sapp <[email protected]>

Add emptty and relevant configs to replace weston-init. This is a modified version of the proposal I made to oe-core to get around a sequencing bug that's been around for a while, but has recently become an issue for us.

As it stands weston-init has no idea what drm devices it should wait on or bind to. We could introduce a udev rule to track tidss and pvrsrvkm registered devices and introduce systemd dependencies around those new .device units, or we could add a proper display manager that's already capable of waiting for drm devices and has the potential to handle hotplug events in the future.

I'm preferable to the second option instead of making rules and modifications to the service file for multiple platform configs.

This series adds emptty as a display manager and converts our bbappend for weston-init to a stand alone version of weston-init named weston-init-arago. This package has the required config files for emptty to automatically login the weston user like weston-init does.

This does remove the weston systemd unit and global weston socket. This was probably for the best as it was not really standard behavior. It just made it "easy" to run arbitrary GUI applications as root, which is never advised.

Randolph Sapp (2):
emptty: add version 0.13.0
weston-init: weston-init -> weston-init-arago

 meta-arago-distro/conf/distro/arago.conf      |  3 +-
 meta-arago-distro/conf/layer.conf             |  4 +-
 .../packagegroup-arago-tisdk-graphics.bb      |  2 +-
 .../recipes-graphics/emptty/emptty/init       | 26 +++++++
 .../recipes-graphics/emptty/emptty/pamconf    | 10 +++
 .../recipes-graphics/emptty/emptty_0.13.0.bb  | 78 +++++++++++++++++++
 .../wayland/weston-init-arago.bb              | 72 +++++++++++++++++
 .../beaglebone/weston.ini                     |  0
 .../wayland/weston-init-arago/emptty.conf     | 77 ++++++++++++++++++
 .../weston-launch-calibrator.sh               |  0
 .../weston.ini                                |  0
 .../wayland/weston-init.bbappend              | 14 ----
 12 files changed, 268 insertions(+), 18 deletions(-)
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/init
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
 create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init-arago.bb
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/beaglebone/weston.ini (100%)
 create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init-arago/emptty.conf
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/weston-launch-calibrator.sh (100%)
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/weston.ini (100%)
 delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 emptty: add version 0.13.0

From: Randolph Sapp <[email protected]>

Add emptty, a "Dead simple CLI Display Manager on TTY". This is a relatively lightweight display manager that supports x11 as well as wayland though both a CLI and automatic login mechanism.

This can effetely replace the custom init scripts for both x11 (xserver-nodm-init) and wayland (weston-init) with a single tool with more verbose logging capabilities.

This also addresses the current issue of with weston occasionally starting before all the required devices are registered with the drm subsystem.

---
 .../recipes-graphics/emptty/emptty/init       | 26 +++++++
 .../recipes-graphics/emptty/emptty/pamconf    | 10 +++
 .../recipes-graphics/emptty/emptty_0.13.0.bb  | 78 +++++++++++++++++++
 3 files changed, 114 insertions(+)
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/init
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
meta-arago-distro/recipes-graphics/emptty/emptty/init new file +26 -0
new file mode 100644
index 00000000..52493142
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PIDFILE=/var/run/emptty.pid
+
+# source function library
+. /etc/init.d/functions
+
+case "$1" in
+	start)
+		echo "Starting display manager: emptty"
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	stop)
+		echo "Stopping display manager: emptty"
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	restart)
+		start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/bin/emptty
+		sleep 2
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	*)
+		echo "usage: $0 { start | stop | restart }"
+		;;
+esac
+
meta-arago-distro/recipes-graphics/emptty/emptty/pamconf new file +10 -0
new file mode 100644
index 00000000..9cbfd6c4
@@ -0,0 +1,10 @@
+#%PAM-1.0
+auth            sufficient      pam_succeed_if.so user ingroup nopasswdlogin
+auth            include         common-auth
+-auth           optional        pam_gnome_keyring.so
+-auth           optional        pam_kwallet5.so
+account         include         common-account
+session         include         common-session
+-session        optional        pam_gnome_keyring.so auto_start
+-session        optional        pam_kwallet5.so auto_start force_run
+password        include         common-password
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.48.1
#2 lore raw

Re: [meta-arago][scarthgap][PATCH 1/2] emptty: add version 0.13.0

Quoted 86 lines · Randolph Sapp via lists.yoctoproject.org

From: Randolph Sapp <[email protected]>

Add emptty, a "Dead simple CLI Display Manager on TTY". This is a relatively lightweight display manager that supports x11 as well as wayland though both a CLI and automatic login mechanism.

This can effetely replace the custom init scripts for both x11 (xserver-nodm-init) and wayland (weston-init) with a single tool with more verbose logging capabilities.

This also addresses the current issue of with weston occasionally starting before all the required devices are registered with the drm subsystem.

---
 .../recipes-graphics/emptty/emptty/init       | 26 +++++++
 .../recipes-graphics/emptty/emptty/pamconf    | 10 +++
 .../recipes-graphics/emptty/emptty_0.13.0.bb  | 78 +++++++++++++++++++
 3 files changed, 114 insertions(+)
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/init
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
 create mode 100644 meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
meta-arago-distro/recipes-graphics/emptty/emptty/init new file +26 -0
new file mode 100644
index 00000000..52493142
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PIDFILE=/var/run/emptty.pid
+
+# source function library
+. /etc/init.d/functions
+
+case "$1" in
+	start)
+		echo "Starting display manager: emptty"
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	stop)
+		echo "Stopping display manager: emptty"
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	restart)
+		start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/bin/emptty
+		sleep 2
+		start-stop-daemon -S -p $PIDFILE -x /usr/bin/emptty
+		;;
+	*)
+		echo "usage: $0 { start | stop | restart }"
+		;;
+esac
+
meta-arago-distro/recipes-graphics/emptty/emptty/pamconf new file +10 -0
new file mode 100644
index 00000000..9cbfd6c4
@@ -0,0 +1,10 @@
+#%PAM-1.0
+auth            sufficient      pam_succeed_if.so user ingroup nopasswdlogin
+auth            include         common-auth
+-auth           optional        pam_gnome_keyring.so
+-auth           optional        pam_kwallet5.so
+account         include         common-account
+session         include         common-session
+-session        optional        pam_gnome_keyring.so auto_start
+-session        optional        pam_kwallet5.so auto_start force_run
+password        include         common-password
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +8 -0
new file mode 100644
index 00000000..7129426d
@@ -0,0 +1,78 @@
+SUMMARY = "Dead simple CLI Display Manager on TTY"
+HOMEPAGE = "https://github.com/tvrzna/emptty"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=d1e4d12c7d1d17367ba5668706a405ba"
+
+GO_IMPORT = "github.com/tvrzna/emptty"
+GO_IMPORT_pam = "github.com/msteinert/pam"
+SRC_URI = "\

meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb line 18

Quoted 10 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +9 -0
+    git://${GO_IMPORT}.git;protocol=https;branch=master \
+    git://${GO_IMPORT_pam}.git;protocol=https;branch=master;name=pam;destsuffix=${S}/src/${GO_IMPORT_pam} \
+    file://pamconf \
+    "
+SRCREV = "4046552b6f5cc1cf76ce8bf333e04e16c59febca"
+SRCREV_pam = "50ded1b0e7864b9bf75005eb945a8ec826bcf69d"
+
+SRCREV_FORMAT .= "_pam"
 
+PACKAGES:append = " ${PN}-conf"

Better use += here.

Quoted 5 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +5 -0
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam x11', d)}"
+PACKAGECONFIG[pam] = ",,libpam"
+PACKAGECONFIG[x11] = ",,virtual/libx11"
+
+GO_TAGS = ""

meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb line 34

Quoted 10 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +10 -0
+GO_TAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pam', '', ',nopam', d)}"
+GO_TAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'x11', '', ',noxlib', d)}"
+
+GOBUILDFLAGS:append = " -tags=${GO_TAGS}"
+
+export GO111MODULE="off"
+
+inherit go systemd
+
+DEPENDS:append = " gzip"

Better use += here. Also, you probably want gzip-native instead.

Quoted 21 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +21 -0
+do_install () {
+    # general collateral
+    install -Dm755 ${B}/${GO_BUILD_BINDIR}/emptty ${D}${bindir}/emptty
+    oe_runmake -C ${S}/src/${GO_IMPORT} DESTDIR=${D} install-config
+    install -d ${D}${mandir}/man1
+    gzip -cn ${S}/src/${GO_IMPORT}/res/emptty.1 > ${D}${mandir}/man1/emptty.1.gz
+
+    # pam config
+    if "${@bb.utils.contains('PACKAGECONFIG','pam','true','false',d)}"
+    then
+        install -Dm644 ${WORKDIR}/pamconf ${D}${sysconfdir}/pam.d/emptty
+    fi
+
+    # init services
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}
+    then
+        oe_runmake -C ${S}/src/${GO_IMPORT} DESTDIR=${D} install-systemd
+    else
+        install -Dm755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/emptty
+    fi
+}

meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb line 66

Quoted 10 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +10 -0
+
+FILES:${PN} = "\
+    ${systemd_system_unitdir}/emptty.service \
+    ${sysconfdir}/init.d/emptty \
+    ${bindir}/emptty \
+    ${mandir}/man1/emptty.1.gz \
+    ${sysconfdir}/pam.d/emptty \
+"
+
+FILES:${PN}-conf:append = " ${sysconfdir}/emptty/conf"

Better use += here.

Quoted 1 line

+CONFFILES:${PN}-conf:append = " ${sysconfdir}/emptty/conf"

Same

Quoted 1 line

+RPROVIDES:${PN}-conf:append = " virtual-emptty-conf"

Same

Quoted 1 line

+RDEPENDS:${PN}:append = " virtual-emptty-conf pam-plugin-succeed-if"

Same

meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb line 78

Quoted 7 lines
meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb new file +7 -0
+SYSTEMD_SERVICE:${PN} = "emptty.service"
+
+INITSCRIPT_NAME = "emptty"
+INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
+
+inherit update-rc.d systemd

systemd is inherited twice - better have inherit lines together to avoid issues like that.

Signature · 1 line
Denys
#3 lore raw

PATCH 2/2 weston-init: weston-init -> weston-init-arago

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Make a weston-init-arago package to replace weston-init and use the emptty display manager. This is based around my initial RFC to oe-core. This should only be necessary on scarthgap as I doubt any of the changes proposed on that thread would be approved for a backport.

This also addresses the current issue of with weston occasionally starting before all the required devices are registered with the drm subsystem.

---
 meta-arago-distro/conf/distro/arago.conf      |  3 +-
 meta-arago-distro/conf/layer.conf             |  4 +-
 .../packagegroup-arago-tisdk-graphics.bb      |  2 +-
 .../wayland/weston-init-arago.bb              | 72 +++++++++++++++++
 .../beaglebone/weston.ini                     |  0
 .../wayland/weston-init-arago/emptty.conf     | 77 +++++++++++++++++++
 .../weston-launch-calibrator.sh               |  0
 .../weston.ini                                |  0
 .../wayland/weston-init.bbappend              | 14 ----
 9 files changed, 154 insertions(+), 18 deletions(-)
 create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init-arago.bb
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/beaglebone/weston.ini (100%)
 create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init-arago/emptty.conf
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/weston-launch-calibrator.sh (100%)
 rename meta-arago-distro/recipes-graphics/wayland/{weston-init => weston-init-arago}/weston.ini (100%)
 delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend
meta-arago-distro/conf/distro/arago.conf +2 -1
index 24d8b005..b536e5b1 100644
@@ -69,7 +69,8 @@ PACKAGECONFIG:pn-curl = "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6",
 PACKAGECONFIG:pn-glmark2 = "drm-gles2 wayland-gles2"
 
 # Set this to empty string to prevent xwayland config from being added
-PACKAGECONFIG:pn-weston-init = ""
+PACKAGECONFIG:pn-weston-init-arago = ""
+PREFERRED_RPROVIDER_virtual-emptty-conf = "weston-init-arago"
 
 # Enable testing for opencl and vulkan with piglit
 PACKAGECONFIG:append:pn-piglit = " \
meta-arago-distro/conf/layer.conf +2 -2
index 4a0e424d..8eb59e61 100644
@@ -36,8 +36,8 @@ BBFILES_DYNAMIC += " \
 BB_DANGLINGAPPENDS_WARNONLY = "true"
 
 SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
-    weston-init->weston \
-    weston-init->kbd \
+    weston-init-arago->weston \
+    weston-init-arago->kbd \
 "
 
 SIGGEN_EXCLUDERECIPES_ABISAFE += " \
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-graphics.bb +1 -1
index a82db154..4f2f00b9 100644
@@ -7,7 +7,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 inherit packagegroup
 
 GFX_WAYLAND = "\
-    weston-init \
+    weston-init-arago \
     weston-examples \
 "
 
meta-arago-distro/recipes-graphics/wayland/weston-init-arago.bb new file +72 -0

72 lines not on this page · raw message

meta-arago-distro/recipes-graphics/wayland/weston-init-arago/beaglebone/weston.ini renamed from meta-arago-distro/recipes-graphics/wayland/weston-init/beaglebone/weston.ini +0 -0
similarity index 100%
rename from meta-arago-distro/recipes-graphics/wayland/weston-init/beaglebone/weston.ini
rename to meta-arago-distro/recipes-graphics/wayland/weston-init-arago/beaglebone/weston.ini
meta-arago-distro/recipes-graphics/wayland/weston-init-arago/emptty.conf new file +77 -0

77 lines not on this page · raw message

meta-arago-distro/recipes-graphics/wayland/weston-init-arago/weston-launch-calibrator.sh renamed from meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh +0 -0
similarity index 100%
rename from meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh
rename to meta-arago-distro/recipes-graphics/wayland/weston-init-arago/weston-launch-calibrator.sh
meta-arago-distro/recipes-graphics/wayland/weston-init-arago/weston.ini renamed from meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini +0 -0
similarity index 100%
rename from meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini
rename to meta-arago-distro/recipes-graphics/wayland/weston-init-arago/weston.ini
meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend deleted +0 -14
deleted file mode 100644
index 4d5db58c..00000000
@@ -1,14 +0,0 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-
-PR:append = ".arago12"
-
-SRC_URI:append = " \
-    file://weston.ini \
-    file://weston-launch-calibrator.sh \
-"
-
-do_install:append() {
-    install -Dm755 weston-launch-calibrator.sh ${D}/${bindir}/weston-launch-calibrator
-}
-
-FILES:${PN}:append = "${bindir}/weston-launch-calibrator"
Signature · 1 line
2.48.1