[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-mediatek/recipes-support/softhsm-init/softhsm-init.bb b/meta/meta-mediatek/recipes-support/softhsm-init/softhsm-init.bb
new file mode 100644
index 0000000..d83a056
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/softhsm-init/softhsm-init.bb
@@ -0,0 +1,45 @@
+inherit workonsrc

+inherit pkgconfig

+inherit systemd

+

+DESCRIPTION = "SoftHSM Init"

+LICENSE = "MediaTekProprietary"

+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

+APPS_SRC = "${TOPDIR}/../meta/meta-mediatek/recipes-support/softhsm-init"

+WORKONSRC = "${APPS_SRC}"

+

+#####Customization Start#####

+SOFTHSM_DATA_MOUNT_POINT = "/data"

+SOFTHSM_DATA_TOKEN_DIR = "/data/softhsm"

+SOFTHSM_DEFAULT_TOKEN_LABEL = "8516softhsm"

+SOFTHSM_DEFAULT_TOKEN_PIN = "85168516"

+SOFTHSM_DEFAULT_TOKEN_SO_PIN = "85168516"

+#####Customization End#####

+

+SYSTEMD_PACKAGES = "${PN}"

+SYSTEMD_SERVICE_${PN} = "softhsm-init.service"

+FILES_${PN} += "${systemd_unitdir}/system/softhsm-init.service"

+FILES_${PN} += "etc/softhsm-init.sh"

+FILES_${PN} += "etc/softhsm2.conf"

+

+do_install() {

+        install -d ${D}/etc

+        install -m 755 ${S}files/softhsm-init.sh ${D}/etc/softhsm-init.sh

+

+        install -d ${D}${systemd_system_unitdir}

+        install -m 0755 ${S}files/softhsm-init.service ${D}${systemd_system_unitdir}

+

+        sed -e 's%#SOFTHSM_DATA_MOUNT_POINT#%${SOFTHSM_DATA_MOUNT_POINT}%g' \

+        -i ${D}${systemd_system_unitdir}/softhsm-init.service

+

+        sed -e 's%#SOFTHSM_DATA_TOKEN_DIR#%${SOFTHSM_DATA_TOKEN_DIR}%g' \

+        	-e 's%#SOFTHSM_DEFAULT_TOKEN_LABEL#%${SOFTHSM_DEFAULT_TOKEN_LABEL}%g' \

+        	-e 's%#SOFTHSM_DEFAULT_TOKEN_PIN#%${SOFTHSM_DEFAULT_TOKEN_PIN}%g' \

+        	-e 's%#SOFTHSM_DEFAULT_TOKEN_SO_PIN#%${SOFTHSM_DEFAULT_TOKEN_SO_PIN}%g' \

+        	-i ${D}/etc/softhsm-init.sh

+

+        echo "objectstore.backend = file" > ${D}/etc/softhsm2.conf

+        echo "directories.tokendir = ${SOFTHSM_DATA_TOKEN_DIR}" >> ${D}/etc/softhsm2.conf

+}

+

+