Skip to contentSkip to conversation

seatd: add seatd recipe

PATCH Superseded Randy Li 2 participants 4 messages Apr 20, 2021 1 message not in the archive

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Randy Li

author
#0 lore raw

PATCH v2 1/1 seatd: add seatd recipe

From: ayaka <[email protected]>

Weston would adapt the libseat for granting privilege and VT switch. wlroots has merged it.

---
 .../nativesdk-packagegroup-sdk-host.bb        |  2 -
 ...build-fixup-standalone-without-seatd.patch | 71 +++++++++++++++++++
 meta/recipes-core/seatd/libseat/init          | 50 +++++++++++++
 meta/recipes-core/seatd/libseat_0.5.0.bb      | 43 +++++++++++
 4 files changed, 164 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch
 create mode 100644 meta/recipes-core/seatd/libseat/init
 create mode 100644 meta/recipes-core/seatd/libseat_0.5.0.bb
meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +0 -2
index ae989011f4..3e4e148c45 100644
@@ -11,8 +11,6 @@ PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
 
 RDEPENDS_${PN} = "\
     nativesdk-pkgconfig \
-    nativesdk-qemu \
-    nativesdk-qemu-helper \
     nativesdk-pseudo \
     nativesdk-unfs3 \
     nativesdk-opkg \
meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch new file +71 -0

71 lines not on this page · raw message

meta/recipes-core/seatd/libseat/init new file +50 -0

50 lines not on this page · raw message

meta/recipes-core/seatd/libseat_0.5.0.bb new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.30.2
#1 lore raw

I guess we need to wait for weston to actually do it, and hold off the patch until then?

Alex

Quoted 243 lines · Randy Li

From: ayaka <[email protected]>

Weston would adapt the libseat for granting privilege and VT switch. wlroots has merged it.

---
 .../nativesdk-packagegroup-sdk-host.bb        |  2 -
 ...build-fixup-standalone-without-seatd.patch | 71 +++++++++++++++++++
 meta/recipes-core/seatd/libseat/init          | 50 +++++++++++++
 meta/recipes-core/seatd/libseat_0.5.0.bb      | 43 +++++++++++
 4 files changed, 164 insertions(+), 2 deletions(-)
 create mode 100644
meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch
 create mode 100644 meta/recipes-core/seatd/libseat/init
 create mode 100644 meta/recipes-core/seatd/libseat_0.5.0.bb
(quoted diff) +0 -0

nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/ nativesdk-packagegroup-sdk-host.bb
index ae989011f4..3e4e148c45 100644

meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +0 -2
@@ -11,8 +11,6 @@ PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
 
 RDEPENDS_${PN} = "\
     nativesdk-pkgconfig \
-    nativesdk-qemu \
-    nativesdk-qemu-helper \
     nativesdk-pseudo \
     nativesdk-unfs3 \
     nativesdk-opkg \

diff --git a/meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch b/meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch new file mode 100644
index 0000000000..66e1ac73ab
--- /dev/null
+++
b/meta/recipes-core/seatd/libseat/0001-build-fixup-standalone-without-seatd.patch

meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +41 -0
@@ -0,0 +1,71 @@
+From 084df8ab271ce4b09c1ef5d9c5a859b2d02d20e7 Mon Sep 17 00:00:00 2001
+From: ayaka <[email protected]>
+Date: Mon, 19 Apr 2021 22:15:46 +0800
+Subject: [PATCH] build: fixup standalone without seatd
+
+I think that server option means the same thing as seatd, so I
+get rid of it.
+---
+ meson.build       | 10 +++++-----
+ meson_options.txt |  1 -
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 7a70cb6..a2166c5 100644
+--- a/meson.build
++++ b/meson.build
+@@ -104,10 +104,11 @@ server_files = [
+
+ with_seatd = get_option('seatd') == 'enabled'
+ with_builtin = get_option('builtin') == 'enabled'
+-with_server = get_option('server') == 'enabled'
+
+-if with_seatd
++if with_seatd or with_builtin
+       private_files += 'libseat/backend/seatd.c'
++endif
++if with_seatd
+       add_project_arguments('-DSEATD_ENABLED=1', language: 'c')
+ endif
+
+@@ -189,7 +190,7 @@ libseat = declare_dependency(
+       variables: libseat_vars,
+ )
+
+-if with_server
++if with_seatd
+       executable(
+               'seatd',
+               [ server_files, 'seatd/seatd.c' ],
+@@ -221,7 +222,7 @@ foreach name, value : tests
+               include_directories: [include_directories('.',

'include')]))
+ endforeach

meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +4 -0
+
+-if with_server
++if with_seatd
+       scdoc = dependency('scdoc', required: get_option('man-pages'),

version: '>= 1.9.7', native: true)
+ else

meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +15 -0
+       scdoc = disabler()
+@@ -252,7 +253,6 @@ endif
+ summary({
+       'seatd': with_seatd,
+       'builtin': with_builtin,
+-      'server': with_server,
+       'systemd': logind.found() and logind_provider == 'systemd',
+       'elogind': logind.found() and logind_provider == 'elogind',
+ }, bool_yn: true)
+diff --git a/meson_options.txt b/meson_options.txt
+index 144ce7a..c61d473 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,7 +1,6 @@
+ option('logind', type: 'combo', choices: ['auto', 'disabled', 'elogind',

'systemd'], value: 'auto', description: 'logind support')
+ option('seatd', type: 'combo', choices: ['enabled', 'disabled'], value:
'enabled', description: 'seatd support')
+ option('builtin', type: 'combo', choices: ['enabled', 'disabled'],
value: 'disabled', description: 'builtin seatd server') +-option('server', type: 'combo', choices: ['enabled', 'disabled'], value:
'enabled', description: 'seatd server')
+ option('examples', type: 'combo', choices: ['enabled', 'disabled'],
value: 'disabled', description: 'libseat example programs')
+ option('man-pages', type: 'feature', value: 'auto', description:
'Generate and install man pages')
+ option('defaultpath', type: 'string', value: '', description: 'Default location for seatd socket (empty for default)')
+--
+2.30.2

meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +1 -0
+
meta/recipes-core/seatd/libseat/init new file +31 -0
new file mode 100644
index 0000000000..8c9d77255d
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          seatd
+# Short-Description: Start seat management daemon
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+test -x /usr/bin/seatd || exit 0
+
+# For configuration of the init script use the file
+# /etc/default/seatd, do not edit this init script.
+
+seatd_group="seatd"
+
+[ -e /etc/default/seatd ] && . /etc/default/seatd
+
+NAME=seatd
+DAEMON=/usr/bin/seatd
+STOP_RETRY_SCHEDULE='TERM/10/forever/KILL/1'
+
+. /etc/init.d/functions
+
+case "$1" in
+  start)
+    start-stop-daemon --start --backgroud --quiet --pidfile

/var/run/$NAME.pid \

meta/recipes-core/seatd/libseat/init new file +19 -0
+           --exec $DAEMON -- -g $seatd_group
+    ;;
+
+  stop)
+    killproc $NAME
+    ;;
+
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+
+esac
+
+exit 0
meta/recipes-core/seatd/libseat_0.5.0.bb new file +5 -0
new file mode 100644
index 0000000000..8067d32a26
@@ -0,0 +1,43 @@
+SUMMARY = "Seat management daemon and library"
+HOMEPAGE = "https://git.sr.ht/~kennylevinsen/seatd"
+SECTION = "base"
+
+DESCRIPTION = "A minimal seat management daemon, and a universal seat

management \
+library. Seat management takes care of mediating access to shared devices \
+(graphics, input), without requiring the applications needing access to be root."

meta/recipes-core/seatd/libseat_0.5.0.bb new file +3 -0
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM =

"file://LICENSE;beginline=3;md5=6a01e8ccc65bea4e8bfa79b09ea1444c"

meta/recipes-core/seatd/libseat_0.5.0.bb new file +4 -0
+
+SRCREV = "5535c2c3b19b42ebfe4c451600059e9418e401a6"
+SRCBRANCH = "master"
+SRC_URI = "git://

git.sr.ht/~kennylevinsen/seatd;protocol=http;branch=${SRCBRANCH}
<http://git.sr.ht/~kennylevinsen/seatd;protocol=http;branch=$%7BSRCBRANCH%7D>
\

meta/recipes-core/seatd/libseat_0.5.0.bb new file +8 -0
+           file://0001-build-fixup-standalone-without-seatd.patch \
+           file://init"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig meson useradd update-rc.d
+
+PACKAGECONFIG ??= "${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager',

'systemd', 'systemd', 'seatd', d)}"

meta/recipes-core/seatd/libseat_0.5.0.bb new file +3 -0
+
+PACKAGECONFIG[seatd] = "-Dseatd=enabled, -Dseatd=disabled"
+PACKAGECONFIG[systemd] = "-Dlogind=systemd, -Dlogind=disabled, systemd

dbus"

meta/recipes-core/seatd/libseat_0.5.0.bb new file +9 -0
+
+PACKAGES += "seatd"
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS}"
+FILES_seatd = "${bindir}/seatd ${sysconfdir}"
+
+do_install_append() {
+       if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
+               install -Dm755 ${WORKDIR}/init

${D}/${sysconfdir}/init.d/seatd

meta/recipes-core/seatd/libseat_0.5.0.bb new file +9 -1
+       fi
+}
+
+INITSCRIPT_NAME = "seatd"
+INITSCRIPT_PARAMS = "start 8 5 2 . stop 21 0 1 6 ."
+
+USERADD_PACKAGES = "seatd"
+
+GROUPADD_PARAM_seatd = "-r seatd"
--

2.30.2

A message that is not in the archive (sent off-list or not yet received): 8cd8leGg45Gxy5RpPo8Qahajr-bTPFM6MlcVSzeWsz-UFPUYn3bdumIRKyM7hjr0rkeQm-CB1qmIqAHShlon7ZbCedWzvBoS6_okd0GqHhY=@emersion.fr

#3 lore raw

That's fine then but please resend the patch without the erroneous nativesdk-packagegroup tweak.

Alex

Quoted 2 lines · Simon Ser

Additional note: libseat is already mandatory for wlroots.

author
#4 lore raw
Quoted 1 line · Alexander Kanavin

That's fine then but please resend the patch without the erroneous nativesdk-packagegroup tweak.

Oops, my fault, that is a X related issue, I would send a patch later

meta/recipes-core/seatd/libseat_0.5.0.bb line 39

Quoted 11 lines

Alex

On Tue, 20 Apr 2021 at 19:43, Simon Ser <[email protected] <mailto:[email protected]>> wrote:

Additional note: libseat is already mandatory for wlroots.

meta/recipes-core/seatd/libseat_0.5.0.bb new file +4 -0
+}
+
+INITSCRIPT_NAME = "seatd"
+INITSCRIPT_PARAMS = "start 8 5 2 . stop 21 0 1 6 ."

We are all fine with the priority I set here ? Because we need to start before weston and should end after weston quit, I choose 8 and 21 here.

Besides, when build for the systemd version, seatd would be an empty package.

Quoted 4 lines
meta/recipes-core/seatd/libseat_0.5.0.bb new file +4 -0
+
+USERADD_PACKAGES = "seatd"
+
+GROUPADD_PARAM_seatd = "-r seatd"