Skip to contentSkip to conversation

pcsc-lite: install systemd system units

PATCH Superseded Wang Mingyu 2 participants 2 messages Aug 7 – Aug 9

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 pcsc-lite: install systemd system units

From: Wang Mingyu <[email protected]>

pcsc-lite 2.5.0 defaults to installing systemd user units, which leaves the package without a system-level pcscd.service while SYSTEMD_SERVICE still enables pcscd.socket. On target systems this makes systemctl status pcscd fail, and systemctl --user start pcscd can fail because the user unit requires polkit.service from the user manager.

Select upstream Meson systemdunit=system so pcscd.service and pcscd.socket are installed as system units. Keep upstream sysusers.d packaging so systemd-sysusers can create the pcscd system user required by the generated service and socket units.

---
 meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb +5 -7
index ae20447050..f70c17495a 100644
@@ -18,6 +18,7 @@ inherit meson systemd pkgconfig perlnative
 
 EXTRA_OEMESON = " \
     -Dlibusb=false \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-Dsystemdunit=system', '-Dsystemdunit=no', d)} \
     -Dusbdropdir=${libdir}/pcsc/drivers \
 "
 
@@ -38,7 +39,10 @@ RPROVIDES:${PN}:append:class-native = " pcsc-lite-lib-native"
 
 FILES:${PN} = "${sbindir}/pcscd \
                ${datadir}/polkit-1 \
-               ${nonarch_libdir}/systemd/user \
+               ${systemd_system_unitdir}/pcscd.service \
+               ${systemd_system_unitdir}/pcscd.socket \
+               ${libdir}/sysusers.d \
+               ${exec_prefix}/sysusers.d \
                ${sysconfdir}/default/pcscd"
 FILES:${PN}-lib = "${libdir}/libpcsclite*${SOLIBS}"
 FILES:${PN}-dev = "${includedir} \
@@ -54,12 +58,6 @@ FILES:${PN}-spy-dev = "${libdir}/libpcscspy.la \
 
 do_install:append() {
     rm -rf ${D}${datadir}/metainfo
-    # pcsc-lite installs pcscd-sysusers.conf into systemd's sysusersdir when
-    # the systemd pkg-config variable is available (${libdir}/sysusers.d),
-    # and falls back to ${exec_prefix}/sysusers.d otherwise. Drop both so the
-    # file is not left unpackaged (installed-vs-shipped QA).
-    rm -rf ${D}${libdir}/sysusers.d
-    rm -rf ${D}${exec_prefix}/sysusers.d
 }
 
 RPROVIDES:${PN} += "${PN}-systemd"
Signature · 1 line
2.43.0
#1 lore raw

Next error

| ../sources/pcsc-lite-2.5.1/meson.build:12:0: ERROR: Value "no" (of type "string") for option "systemdunit" is not one of the choices. Possible choices are (as string): "user", "system".
|

Quoted 75 lines · wangmy via lists.openembedded.org

From: Wang Mingyu <[email protected]>

pcsc-lite 2.5.0 defaults to installing systemd user units, which leaves the package without a system-level pcscd.service while SYSTEMD_SERVICE still enables pcscd.socket. On target systems this makes systemctl status pcscd fail, and systemctl --user start pcscd can fail because the user unit requires polkit.service from the user manager.

Select upstream Meson systemdunit=system so pcscd.service and pcscd.socket are installed as system units. Keep upstream sysusers.d packaging so systemd-sysusers can create the pcscd system user required by the generated service and socket units.

---
 meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb +1 -0
index ae20447050..f70c17495a 100644
@@ -18,6 +18,7 @@ inherit meson systemd pkgconfig perlnative
 
 EXTRA_OEMESON = " \
     -Dlibusb=false \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
 '-Dsystemdunit=system', '-Dsystemdunit=no', d)} \
     -Dusbdropdir=${libdir}/pcsc/drivers \
 "
@@ -38,7 +39,10 @@ RPROVIDES:${PN}:append:class-native = "

pcsc-lite-lib-native"

 FILES:${PN} = "${sbindir}/pcscd \
                ${datadir}/polkit-1 \
meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb +4 -2
-               ${nonarch_libdir}/systemd/user \
+               ${systemd_system_unitdir}/pcscd.service \
+               ${systemd_system_unitdir}/pcscd.socket \
+               ${libdir}/sysusers.d \
+               ${exec_prefix}/sysusers.d \
                ${sysconfdir}/default/pcscd"
 FILES:${PN}-lib = "${libdir}/libpcsclite*${SOLIBS}"
 FILES:${PN}-dev = "${includedir} \
@@ -54,12 +58,6 @@ FILES:${PN}-spy-dev = "${libdir}/libpcscspy.la \
 
 do_install:append() {
     rm -rf ${D}${datadir}/metainfo
-    # pcsc-lite installs pcscd-sysusers.conf into systemd's sysusersdir

when

meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb +0 -2
-    # the systemd pkg-config variable is available (${libdir}/sysusers.d),
-    # and falls back to ${exec_prefix}/sysusers.d otherwise. Drop both so

the

meta-oe/recipes-support/pcsc-lite/pcsc-lite_2.5.1.bb +0 -4
-    # file is not left unpackaged (installed-vs-shipped QA).
-    rm -rf ${D}${libdir}/sysusers.d
-    rm -rf ${D}${exec_prefix}/sysusers.d
 }
 
 RPROVIDES:${PN} += "${PN}-systemd"
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#128867):
https://lists.openembedded.org/g/openembedded-devel/message/128867
Mute This Topic: https://lists.openembedded.org/mt/120640343/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-