diff options
| author | Jörg Sommer <joerg.sommer@navimatix.de> | 2026-03-19 13:31:06 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-03-19 13:22:59 -0700 |
| commit | f7b3ed68b58ec3d81bfa590e24be0f5683fbea51 (patch) | |
| tree | 62b0db8a8fa234f3248bdb1d82bd2621fe15ddf4 | |
| parent | 75f85e048fb212f0099a8fa9490160e63cd1634d (diff) | |
| download | meta-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>
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] | ||
| 2 | Description=Console server | ||
| 3 | Documentation=man:conserver(8) | ||
| 4 | Documentation=https://www.conserver.com/ | ||
| 5 | After=network.target | ||
| 6 | ConditionPathExists=/etc/conserver.cf | ||
| 7 | |||
| 8 | [Service] | ||
| 9 | Type=exec | ||
| 10 | ExecStart=/usr/sbin/conserver -C /etc/conserver.cf | ||
| 11 | ExecReload=+kill -HUP $MAINPID | ||
| 12 | User=conserver | ||
| 13 | # /run/conserver for Unix domain socket | ||
| 14 | RuntimeDirectory=conserver | ||
| 15 | |||
| 16 | CapabilityBoundingSet= | ||
| 17 | |||
| 18 | LockPersonality=true | ||
| 19 | MemoryDenyWriteExecute=true | ||
| 20 | NoNewPrivileges=true | ||
| 21 | |||
| 22 | # No access to /dev/... | ||
| 23 | PrivateDevices=true | ||
| 24 | PrivateTmp=true | ||
| 25 | ProtectClock=true | ||
| 26 | ProtectControlGroups=true | ||
| 27 | ProtectHostname=true | ||
| 28 | ProtectKernelLogs=true | ||
| 29 | ProtectKernelModules=true | ||
| 30 | ProtectKernelTunables=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 | ||
| 35 | ProtectSystem=full | ||
| 36 | # Make some paths writable | ||
| 37 | #ReadWritePaths=/… | ||
| 38 | ProtectHome=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 | ||
| 43 | ProtectProc=invisible | ||
| 44 | ProcSubset=pid | ||
| 45 | |||
| 46 | RemoveIPC=true | ||
| 47 | RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 | ||
| 48 | RestrictNamespaces=true | ||
| 49 | RestrictRealtime=true | ||
| 50 | RestrictSUIDSGID=true | ||
| 51 | |||
| 52 | SystemCallArchitectures=native | ||
| 53 | SystemCallFilter=@system-service | ||
| 54 | SystemCallFilter=~@privileged @resources @obsolete | ||
| 55 | |||
| 56 | |||
| 57 | [Install] | ||
| 58 | WantedBy=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 | |||
| 3 | set -e -u -C | ||
| 4 | |||
| 5 | cd 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 | |||
| 11 | for i in test*.diff conserver.log shell.log shell2.log | ||
| 12 | do | ||
| 13 | test "$i" != 'test*.diff' || exit 0 | ||
| 14 | test -e "$i" || continue | ||
| 15 | |||
| 16 | echo "----[ $i ]--------------------" | ||
| 17 | cat "$i" | ||
| 18 | echo "------------------------------------" | ||
| 19 | done | ||
| 20 | |||
| 21 | exit 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 @@ | |||
| 1 | SUMMARY = "Manages connections of multiple users to a serial console or TCP/unix sockets" | ||
| 2 | DESCRIPTION = "\ | ||
| 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 | " | ||
| 11 | HOMEPAGE = "https://www.conserver.com/" | ||
| 12 | BUGTRACKER = "https://github.com/bstansell/conserver/issues" | ||
| 13 | SECTION = "console/network" | ||
| 14 | |||
| 15 | LICENSE = "BSD-3-Clause" | ||
| 16 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b28513e7b696027d3d2b8dbf117f9fe5" | ||
| 17 | |||
| 18 | DEPENDS = "libxcrypt" | ||
| 19 | |||
| 20 | inherit autotools ptest systemd useradd | ||
| 21 | |||
| 22 | SRC_URI = "\ | ||
| 23 | git://github.com/bstansell/conserver;protocol=https;branch=master;tag=v${PV} \ | ||
| 24 | file://conserver.service \ | ||
| 25 | file://run-ptest \ | ||
| 26 | " | ||
| 27 | SRCREV = "fe9aac337554f95721dc9f3da721092a81092089" | ||
| 28 | |||
| 29 | # In 8.3.0, conserver fails to build with uds and ipv6 | ||
| 30 | # https://github.com/bstansell/conserver/issues/112 | ||
| 31 | PACKAGECONFIG ?= "\ | ||
| 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 | ||
| 38 | PACKAGECONFIG[trustrevdns] = "--with-trustrevdns,--without-trustrevdns" | ||
| 39 | # Produce extended messages | ||
| 40 | PACKAGECONFIG[extmsgs] = "--with-extmsgs,--without-extmsgs" | ||
| 41 | # Use Unix domain sockets for client/server communication [/tmp/conserver] | ||
| 42 | PACKAGECONFIG[uds] = "--with-uds=/run/${PN},--without-uds" | ||
| 43 | # Trust UDS credentials obtained via socket | ||
| 44 | PACKAGECONFIG[trust-uds-cred] = "--with-trust-uds-cred,--without-trust-uds-cred" | ||
| 45 | # Compile in libwrap (tcp_wrappers) support | ||
| 46 | PACKAGECONFIG[libwrap] = "--with-libwrap,--without-libwrap,tcp-wrappers" | ||
| 47 | # Compile in OpenSSL support | ||
| 48 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" | ||
| 49 | # Require server SSL certificate by client | ||
| 50 | PACKAGECONFIG[req-server-cert] = "--with-req-server-cert,--without-req-server-cert" | ||
| 51 | # Compile in GSS-API support | ||
| 52 | PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5" | ||
| 53 | # retry username without @REALM with gss-api authentication | ||
| 54 | PACKAGECONFIG[striprealm] = "--with-striprealm,--without-striprealm" | ||
| 55 | # Compile in FreeIPMI support | ||
| 56 | PACKAGECONFIG[freeipmi] = "--with-freeipmi,--without-freeipmi,freeipmi" | ||
| 57 | # Compile in dmalloc support | ||
| 58 | PACKAGECONFIG[dmalloc] = "--with-dmalloc,--without-dmalloc,dmalloc" | ||
| 59 | # Enable PAM support | ||
| 60 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" | ||
| 61 | # (experimental) Use IPv6 for client/server communication | ||
| 62 | PACKAGECONFIG[ipv6] = "--with-ipv6,--without-ipv6" | ||
| 63 | |||
| 64 | EXTRA_OECONF += "\ | ||
| 65 | INSTALL_PROGRAM='install --strip-program=true' \ | ||
| 66 | --with-pidfile=/run/conserver/conserver.pid \ | ||
| 67 | --without-rpath \ | ||
| 68 | " | ||
| 69 | |||
| 70 | PACKAGE_BEFORE_PN += "${PN}-client" | ||
| 71 | SUMMARY:${PN}-client = "Client to connect to conserver" | ||
| 72 | FILES:${PN}-client += "${bindir}/console" | ||
| 73 | |||
| 74 | PACKAGE_BEFORE_PN += "${PN}-convert" | ||
| 75 | SUMMARY:${PN}-convert = "Converter for old config files of conserver" | ||
| 76 | FILES:${PN}-convert += "${libdir}/${PN}" | ||
| 77 | |||
| 78 | # tests fail with ash | ||
| 79 | RDEPENDS:${PN}-ptest += "bash" | ||
| 80 | |||
| 81 | SYSTEMD_SERVICE:${PN} = "${PN}.service" | ||
| 82 | |||
| 83 | USERADD_PACKAGES = "\ | ||
| 84 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${PN}', '', d)} \ | ||
| 85 | " | ||
| 86 | USERADD_PARAM:${PN} = "\ | ||
| 87 | -M -d /invalid -r -U -s ${sbindir}/nologin conserver; \ | ||
| 88 | " | ||
| 89 | |||
| 90 | do_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 | |||
| 106 | do_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 | } | ||
