summarylogtreecommitdiffstats
path: root/pkcs11_install
blob: 0643423487dcef854232c7463808019abae57aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

build() {

    # CCID
    add_file /etc/libccid_Info.plist
    add_file /etc/reader.conf.d/libccidtwin
    add_file /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
    add_binary /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
    add_binary /usr/lib/pcsc/drivers/serial/libccidtwin.so

    # OPENSC
    add_file /etc/opensc.conf
    add_binary /usr/lib/opensc-pkcs11.so
    add_binary /usr/lib/pkcs11/opensc-pkcs11.so

    # PCSCLITE
    add_binary /usr/lib/libpcsclite.so

    # PCSCD at boot before cryptsetup
    add_systemd_unit pcscd.service
    add_systemd_unit pcscd.socket
    add_symlink /usr/lib/systemd/system/cryptsetup.target.wants/pcscd.socket ../pcscd.socket

    # MISC
    add_binary /usr/bin/p11tool
    add_file /etc/pkcs11/modules/opensc.module

}

help() {
    cat <<HELPEOF
Add and early start (ie before cryptsetup) the pcscd socket service. This
allow cryptsetup "pkcs11-uri=auto" to find yubikey piv based token. Required
package are: ccid opensc and pcsclite. Use with systemd and sd-encrypt hook.
HELPEOF
}

# vim: set ft=sh ts=4 sw=4 et: