diff mbox series

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

Message ID 20250312232628.1260171-3-rs@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series Add display manager and required configs | expand

Commit Message

Randolph Sapp March 12, 2025, 11:26 p.m. UTC
From: Randolph Sapp <rs@ti.com>

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.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 .../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

Comments

Denys Dmytriyenko March 18, 2025, 4:33 p.m. UTC | #1
On Wed, Mar 12, 2025 at 06:26:28PM -0500, Randolph Sapp via lists.yoctoproject.org wrote:
> From: Randolph Sapp <rs@ti.com>
> 
> 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.
> 
> Signed-off-by: Randolph Sapp <rs@ti.com>
> ---
>  .../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
> 
> diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/init b/meta-arago-distro/recipes-graphics/emptty/emptty/init
> new file mode 100644
> index 00000000..52493142
> --- /dev/null
> +++ b/meta-arago-distro/recipes-graphics/emptty/emptty/init
> @@ -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
> +
> diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf b/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
> new file mode 100644
> index 00000000..9cbfd6c4
> --- /dev/null
> +++ b/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
> @@ -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
> diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
> new file mode 100644
> index 00000000..7129426d
> --- /dev/null
> +++ b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
> @@ -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 = "\
> +    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.


> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam x11', d)}"
> +PACKAGECONFIG[pam] = ",,libpam"
> +PACKAGECONFIG[x11] = ",,virtual/libx11"
> +
> +GO_TAGS = ""
> +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.


> +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
> +}
> +
> +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.


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

Same


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

Same


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

Same


> +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.
diff mbox series

Patch

diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/init b/meta-arago-distro/recipes-graphics/emptty/emptty/init
new file mode 100644
index 00000000..52493142
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty/init
@@ -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
+
diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf b/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
new file mode 100644
index 00000000..9cbfd6c4
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty/pamconf
@@ -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
diff --git a/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
new file mode 100644
index 00000000..7129426d
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/emptty/emptty_0.13.0.bb
@@ -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 = "\
+    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"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam x11', d)}"
+PACKAGECONFIG[pam] = ",,libpam"
+PACKAGECONFIG[x11] = ",,virtual/libx11"
+
+GO_TAGS = ""
+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"
+
+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
+}
+
+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"
+CONFFILES:${PN}-conf:append = " ${sysconfdir}/emptty/conf"
+RPROVIDES:${PN}-conf:append = " virtual-emptty-conf"
+
+RDEPENDS:${PN}:append = " virtual-emptty-conf pam-plugin-succeed-if"
+
+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