summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörg Sommer <joerg.sommer@navimatix.de>2026-03-19 13:31:06 +0100
committerKhem Raj <raj.khem@gmail.com>2026-03-19 13:22:59 -0700
commitf7b3ed68b58ec3d81bfa590e24be0f5683fbea51 (patch)
tree62b0db8a8fa234f3248bdb1d82bd2621fe15ddf4
parent75f85e048fb212f0099a8fa9490160e63cd1634d (diff)
downloadmeta-openembedded-f7b3ed68b58ec3d81bfa590e24be0f5683fbea51.tar.gz
conserver: Add recipe for remote console server
The patches are required to build with detached build directory and cross-compiling. Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/conf/include/ptest-packagelists-meta-oe.inc1
-rw-r--r--meta-oe/recipes-connectivity/conserver/conserver/conserver.service58
-rw-r--r--meta-oe/recipes-connectivity/conserver/conserver/run-ptest21
-rw-r--r--meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb111
4 files changed, 191 insertions, 0 deletions
diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
index 4de602ac1c..e88e50b59c 100644
--- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
+++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
@@ -13,6 +13,7 @@ PTESTS_FAST_META_OE = "\
13 cjson \ 13 cjson \
14 cli11 \ 14 cli11 \
15 cmocka \ 15 cmocka \
16 conserver \
16 cunit \ 17 cunit \
17 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'dbus-broker', '', d)} \ 18 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'dbus-broker', '', d)} \
18 duktape \ 19 duktape \
diff --git a/meta-oe/recipes-connectivity/conserver/conserver/conserver.service b/meta-oe/recipes-connectivity/conserver/conserver/conserver.service
new file mode 100644
index 0000000000..8649896487
--- /dev/null
+++ b/meta-oe/recipes-connectivity/conserver/conserver/conserver.service
@@ -0,0 +1,58 @@
1[Unit]
2Description=Console server
3Documentation=man:conserver(8)
4Documentation=https://www.conserver.com/
5After=network.target
6ConditionPathExists=/etc/conserver.cf
7
8[Service]
9Type=exec
10ExecStart=/usr/sbin/conserver -C /etc/conserver.cf
11ExecReload=+kill -HUP $MAINPID
12User=conserver
13# /run/conserver for Unix domain socket
14RuntimeDirectory=conserver
15
16CapabilityBoundingSet=
17
18LockPersonality=true
19MemoryDenyWriteExecute=true
20NoNewPrivileges=true
21
22# No access to /dev/...
23PrivateDevices=true
24PrivateTmp=true
25ProtectClock=true
26ProtectControlGroups=true
27ProtectHostname=true
28ProtectKernelLogs=true
29ProtectKernelModules=true
30ProtectKernelTunables=true
31
32# strict: mounts the whole system read-only
33# full: mount only /var as read-write
34# true: mount /var and /etc as read-write
35ProtectSystem=full
36# Make some paths writable
37#ReadWritePaths=/…
38ProtectHome=true
39
40# Make sure that the process can only see PIDs and process details of itself,
41# and the second option disables seeing details of things like system load and
42# I/O etc
43ProtectProc=invisible
44ProcSubset=pid
45
46RemoveIPC=true
47RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
48RestrictNamespaces=true
49RestrictRealtime=true
50RestrictSUIDSGID=true
51
52SystemCallArchitectures=native
53SystemCallFilter=@system-service
54SystemCallFilter=~@privileged @resources @obsolete
55
56
57[Install]
58WantedBy=multi-user.target
diff --git a/meta-oe/recipes-connectivity/conserver/conserver/run-ptest b/meta-oe/recipes-connectivity/conserver/conserver/run-ptest
new file mode 100644
index 0000000000..51eb0ffbcf
--- /dev/null
+++ b/meta-oe/recipes-connectivity/conserver/conserver/run-ptest
@@ -0,0 +1,21 @@
1#!/bin/sh
2
3set -e -u -C
4
5cd test
6
7./dotest |sed \
8 -e 's,^executing test \(#[0-9]*\)...succeeded$,PASS: conserver \1,' \
9 -e 's,^executing test \(#[0-9]*\)...failed\(.*\)$,FAIL: conserver \1 \2,'
10
11for i in test*.diff conserver.log shell.log shell2.log
12do
13 test "$i" != 'test*.diff' || exit 0
14 test -e "$i" || continue
15
16 echo "----[ $i ]--------------------"
17 cat "$i"
18 echo "------------------------------------"
19done
20
21exit 1
diff --git a/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb b/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb
new file mode 100644
index 0000000000..c32d6f9646
--- /dev/null
+++ b/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb
@@ -0,0 +1,111 @@
1SUMMARY = "Manages connections of multiple users to a serial console or TCP/unix sockets"
2DESCRIPTION = "\
3 Conserver allows multiple users to watch a serial console at the same \
4 time. It can log the data, allows users to take write-access of a console \
5 (one at a time), and has a variety of bells and whistles to accentuate \
6 that basic functionality. The idea is that conserver will log all your \
7 serial traffic so you can go back and review why something crashed, look \
8 at changes (if done on the console), or tie the console logs into a \
9 monitoring system (just watch the logfiles it creates). \
10"
11HOMEPAGE = "https://www.conserver.com/"
12BUGTRACKER = "https://github.com/bstansell/conserver/issues"
13SECTION = "console/network"
14
15LICENSE = "BSD-3-Clause"
16LIC_FILES_CHKSUM = "file://LICENSE;md5=b28513e7b696027d3d2b8dbf117f9fe5"
17
18DEPENDS = "libxcrypt"
19
20inherit autotools ptest systemd useradd
21
22SRC_URI = "\
23 git://github.com/bstansell/conserver;protocol=https;branch=master;tag=v${PV} \
24 file://conserver.service \
25 file://run-ptest \
26"
27SRCREV = "fe9aac337554f95721dc9f3da721092a81092089"
28
29# In 8.3.0, conserver fails to build with uds and ipv6
30# https://github.com/bstansell/conserver/issues/112
31PACKAGECONFIG ?= "\
32 openssl \
33 ${@bb.utils.contains_any('DISTRO_FEATURES', 'ipv4 ipv6', '', 'uds trust-uds-cred', d)} \
34 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
35"
36
37# Trust reverse DNS information
38PACKAGECONFIG[trustrevdns] = "--with-trustrevdns,--without-trustrevdns"
39# Produce extended messages
40PACKAGECONFIG[extmsgs] = "--with-extmsgs,--without-extmsgs"
41# Use Unix domain sockets for client/server communication [/tmp/conserver]
42PACKAGECONFIG[uds] = "--with-uds=/run/${PN},--without-uds"
43# Trust UDS credentials obtained via socket
44PACKAGECONFIG[trust-uds-cred] = "--with-trust-uds-cred,--without-trust-uds-cred"
45# Compile in libwrap (tcp_wrappers) support
46PACKAGECONFIG[libwrap] = "--with-libwrap,--without-libwrap,tcp-wrappers"
47# Compile in OpenSSL support
48PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
49# Require server SSL certificate by client
50PACKAGECONFIG[req-server-cert] = "--with-req-server-cert,--without-req-server-cert"
51# Compile in GSS-API support
52PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
53# retry username without @REALM with gss-api authentication
54PACKAGECONFIG[striprealm] = "--with-striprealm,--without-striprealm"
55# Compile in FreeIPMI support
56PACKAGECONFIG[freeipmi] = "--with-freeipmi,--without-freeipmi,freeipmi"
57# Compile in dmalloc support
58PACKAGECONFIG[dmalloc] = "--with-dmalloc,--without-dmalloc,dmalloc"
59# Enable PAM support
60PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
61# (experimental) Use IPv6 for client/server communication
62PACKAGECONFIG[ipv6] = "--with-ipv6,--without-ipv6"
63
64EXTRA_OECONF += "\
65 INSTALL_PROGRAM='install --strip-program=true' \
66 --with-pidfile=/run/conserver/conserver.pid \
67 --without-rpath \
68"
69
70PACKAGE_BEFORE_PN += "${PN}-client"
71SUMMARY:${PN}-client = "Client to connect to conserver"
72FILES:${PN}-client += "${bindir}/console"
73
74PACKAGE_BEFORE_PN += "${PN}-convert"
75SUMMARY:${PN}-convert = "Converter for old config files of conserver"
76FILES:${PN}-convert += "${libdir}/${PN}"
77
78# tests fail with ash
79RDEPENDS:${PN}-ptest += "bash"
80
81SYSTEMD_SERVICE:${PN} = "${PN}.service"
82
83USERADD_PACKAGES = "\
84 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${PN}', '', d)} \
85"
86USERADD_PARAM:${PN} = "\
87 -M -d /invalid -r -U -s ${sbindir}/nologin conserver; \
88"
89
90do_install:append() {
91 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}
92 then
93 rm ${D}${datadir}/examples/${PN}/conserver.rc
94
95 install -m 644 -D -t ${D}/${systemd_unitdir}/system ${UNPACKDIR}/conserver.service
96 else
97 install -d ${D}${sysconfdir}/init.d
98 mv ${D}${datadir}/examples/${PN}/conserver.rc ${D}${sysconfdir}/init.d/${PN}
99 fi
100
101 install -d ${D}${datadir}/doc/${PN}/examples
102 mv ${D}${datadir}/examples/${PN}/* ${D}${datadir}/doc/${PN}/examples
103 rmdir ${D}${datadir}/examples/${PN} ${D}${datadir}/examples
104}
105
106do_install_ptest() {
107 install -d ${D}${PTEST_PATH}/conserver ${D}${PTEST_PATH}/console
108 ln -s ${sbindir}/conserver ${D}${PTEST_PATH}/conserver
109 ln -s ${bindir}/console ${D}${PTEST_PATH}/console
110 cp -a ${S}/test ${D}${PTEST_PATH}
111}