From 093a35733f9cccf3e234c793568dd52a4699d94e Mon Sep 17 00:00:00 2001 From: VlkrS <47375452+VlkrS@users.noreply.github.com> Date: Sat, 31 Dec 2022 17:34:07 +0100 Subject: [PATCH 1/2] Add pcscd instructions for FreeBSD and OpenBSD --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94268b2..a2b19d8 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,33 @@ Help from new packagers is very welcome. ### Linux, BSD, etc. On non-Windows, non-macOS systems, you need to ensure that the `pcscd` service -is installed and running. On Debian or Ubuntu, you can do this with: +is installed and running. + +#### Debian or Ubuntu ``` $ sudo apt-get install pcscd ``` +#### OpenBSD + +As ```root``` do: + +``` +$ pkg_add pcsc-lite +$ rcctl enable pcscd +$ rcctl start pcscd +``` + +#### FreeBSD + +As ```root``` do: +``` +$ pkg install pcsc-lite +$ service pcscd enable +$ service pcscd start +``` + ### Windows Subsystem for Linux (WSL) WSL does not currently provide native support for USB devices. However, Windows From 9ac72cd66f853f688c32cb957a368b4fefef91c0 Mon Sep 17 00:00:00 2001 From: vlkrs Date: Sun, 1 Jan 2023 15:15:06 +0100 Subject: [PATCH 2/2] Add recommendations for {Open,Free}BSD when pcscd isn't running. --- i18n/en-US/age_plugin_yubikey.ftl | 6 ++++++ src/error.rs | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/i18n/en-US/age_plugin_yubikey.ftl b/i18n/en-US/age_plugin_yubikey.ftl index 2ec1d7a..d3403be 100644 --- a/i18n/en-US/age_plugin_yubikey.ftl +++ b/i18n/en-US/age_plugin_yubikey.ftl @@ -204,6 +204,12 @@ rec-yk-no-service-pcscd = If you are on Debian or Ubuntu, you can install it with: {" "}{$apt} +rec-yk-no-service-pcscd-bsd = + You can install and run it as root with: + {" "}{$pkg} + {" "}{$service_enable} + {" "}{$service_start} + err-yk-no-service-win = The Smart Cards for Windows service is not running. rec-yk-no-service-win = See this troubleshooting guide for more help: diff --git a/src/error.rs b/src/error.rs index 5b4372c..02981e6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -107,6 +107,30 @@ impl fmt::Debug for Error { wlnfl!(f, "err-yk-no-service-macos")?; let url = "https://apple.stackexchange.com/a/438198"; wlnfl!(f, "rec-yk-no-service-macos", url = url)?; + } else if cfg!(target_os = "openbsd") { + wlnfl!(f, "err-yk-no-service-pcscd")?; + let pkg = "pkg_add pcsc-lite"; + let service_enable = "rcctl enable pcscd"; + let service_start = "rcctl start pcscd"; + wlnfl!( + f, + "rec-yk-no-service-pcscd-bsd", + pkg = pkg, + service_enable = service_enable, + service_start = service_start + )?; + } else if cfg!(target_os = "freebsd") { + wlnfl!(f, "err-yk-no-service-pcscd")?; + let pkg = "pkg install pcsc-lite"; + let service_enable = "service pcscd enable"; + let service_start = "service pcscd start"; + wlnfl!( + f, + "rec-yk-no-service-pcscd-bsd", + pkg = pkg, + service_enable = service_enable, + service_start = service_start + )?; } else { wlnfl!(f, "err-yk-no-service-pcscd")?; let apt = "sudo apt-get install pcscd";