dracut/2547-fix-pcsc-module.patch
Manuel Fombuena 2d7bee74f8 Fix pkcs11 and pcsc modules
pkcs11 and pcsc don't seem to have ever worked.

In the case of pkcs11, the following install line is incorrect (note the dot before *):

{"tls/$_arch/",tls/,"$_arch/",}"/cryptsetup/libcryptsetup-token-systemd-pkcs11.so.*"

And it should be:

{"tls/$_arch/",tls/,"$_arch/",}"/cryptsetup/libcryptsetup-token-systemd-pkcs11.so*"

I opened a PR and it was merged a while ago: https://github.com/dracutdevs/dracut/pull/2540

In the case of pcsc there are two problems.

One, the installation file is missing /usr/share/p11-kit/modules/opensc.module and without that, you can't really do anything.

Two, dracut doesn't include polkit and pcsc is compiled with it enabled by default. The option --disable-polkit was added to pcscd in 2.0, precisely to address this issue. It needs to be added to pcscd.service in the module for it to work on initramfs.

I opened another PR which has been approved by 2 reviewers and merged into openSUSE: https://github.com/dracutdevs/dracut/pull/2547

Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
2024-02-12 21:34:12 +01:00

51 lines
1.7 KiB
Diff

From 6da61a2c0e38da4e6e880e1bb7f47d55d2c54c65 Mon Sep 17 00:00:00 2001
From: Manuel Fombuena <mfombuena@innovara.co.uk>
Date: Fri, 3 Nov 2023 09:04:53 +0000
Subject: [PATCH 1/2] fix(pcsc): add opensc load module file
On Fedora, and possibly others, this file loads opensc-pkcs11.so which you need to interact with the smart card to unlock a LUKS encrypted volume.
---
modules.d/91pcsc/module-setup.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules.d/91pcsc/module-setup.sh b/modules.d/91pcsc/module-setup.sh
index 6f8b2c88e1..26b463d436 100755
--- a/modules.d/91pcsc/module-setup.sh
+++ b/modules.d/91pcsc/module-setup.sh
@@ -29,7 +29,8 @@ install() {
inst_simple "$moddir/pcscd.socket" "${systemdsystemunitdir}"/pcscd.socket
inst_multiple -o \
- pcscd
+ pcscd \
+ /usr/share/p11-kit/modules/opensc.module
# Enable systemd type unit(s)
for i in \
From 842be0c89fe0cc8cac9efa88e68b07ae1c2d2464 Mon Sep 17 00:00:00 2001
From: Manuel Fombuena <mfombuena@innovara.co.uk>
Date: Fri, 3 Nov 2023 11:53:38 +0000
Subject: [PATCH 2/2] fix(pcsc): add --disable-polkit to pcscd.service
Needs pcsc >= 2.0.0
polkit is not included in dracut and without this option, pcscd simply fails
---
modules.d/91pcsc/pcscd.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/91pcsc/pcscd.service b/modules.d/91pcsc/pcscd.service
index 639decd275..7d4e0a2b30 100644
--- a/modules.d/91pcsc/pcscd.service
+++ b/modules.d/91pcsc/pcscd.service
@@ -5,7 +5,7 @@ Documentation=man:pcscd(8)
Requires=pcscd.socket
[Service]
-ExecStart=/usr/sbin/pcscd --foreground --auto-exit
+ExecStart=/usr/sbin/pcscd --foreground --auto-exit --disable-polkit
ExecReload=/usr/sbin/pcscd --hotplug
[Install]