rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | inherit workonsrc
|
| 2 | inherit pkgconfig
|
| 3 | inherit systemd
|
| 4 |
|
| 5 | DESCRIPTION = "SoftHSM Init"
|
| 6 | LICENSE = "MediaTekProprietary"
|
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
|
| 8 | APPS_SRC = "${TOPDIR}/../meta/meta-mediatek/recipes-support/softhsm-init"
|
| 9 | WORKONSRC = "${APPS_SRC}"
|
| 10 |
|
| 11 | #####Customization Start#####
|
| 12 | SOFTHSM_DATA_MOUNT_POINT = "/data"
|
| 13 | SOFTHSM_DATA_TOKEN_DIR = "/data/softhsm"
|
| 14 | SOFTHSM_DEFAULT_TOKEN_LABEL = "8516softhsm"
|
| 15 | SOFTHSM_DEFAULT_TOKEN_PIN = "85168516"
|
| 16 | SOFTHSM_DEFAULT_TOKEN_SO_PIN = "85168516"
|
| 17 | #####Customization End#####
|
| 18 |
|
| 19 | SYSTEMD_PACKAGES = "${PN}"
|
| 20 | SYSTEMD_SERVICE_${PN} = "softhsm-init.service"
|
| 21 | FILES_${PN} += "${systemd_unitdir}/system/softhsm-init.service"
|
| 22 | FILES_${PN} += "etc/softhsm-init.sh"
|
| 23 | FILES_${PN} += "etc/softhsm2.conf"
|
| 24 |
|
| 25 | do_install() {
|
| 26 | install -d ${D}/etc
|
| 27 | install -m 755 ${S}files/softhsm-init.sh ${D}/etc/softhsm-init.sh
|
| 28 |
|
| 29 | install -d ${D}${systemd_system_unitdir}
|
| 30 | install -m 0755 ${S}files/softhsm-init.service ${D}${systemd_system_unitdir}
|
| 31 |
|
| 32 | sed -e 's%#SOFTHSM_DATA_MOUNT_POINT#%${SOFTHSM_DATA_MOUNT_POINT}%g' \
|
| 33 | -i ${D}${systemd_system_unitdir}/softhsm-init.service
|
| 34 |
|
| 35 | sed -e 's%#SOFTHSM_DATA_TOKEN_DIR#%${SOFTHSM_DATA_TOKEN_DIR}%g' \
|
| 36 | -e 's%#SOFTHSM_DEFAULT_TOKEN_LABEL#%${SOFTHSM_DEFAULT_TOKEN_LABEL}%g' \
|
| 37 | -e 's%#SOFTHSM_DEFAULT_TOKEN_PIN#%${SOFTHSM_DEFAULT_TOKEN_PIN}%g' \
|
| 38 | -e 's%#SOFTHSM_DEFAULT_TOKEN_SO_PIN#%${SOFTHSM_DEFAULT_TOKEN_SO_PIN}%g' \
|
| 39 | -i ${D}/etc/softhsm-init.sh
|
| 40 |
|
| 41 | echo "objectstore.backend = file" > ${D}/etc/softhsm2.conf
|
| 42 | echo "directories.tokendir = ${SOFTHSM_DATA_TOKEN_DIR}" >> ${D}/etc/softhsm2.conf
|
| 43 | }
|
| 44 |
|
| 45 |
|