summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-client-fslc.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/optee-imx/optee-client-fslc.inc')
-rw-r--r--recipes-security/optee-imx/optee-client-fslc.inc43
1 files changed, 30 insertions, 13 deletions
diff --git a/recipes-security/optee-imx/optee-client-fslc.inc b/recipes-security/optee-imx/optee-client-fslc.inc
index 455bdd780..70a25fe6c 100644
--- a/recipes-security/optee-imx/optee-client-fslc.inc
+++ b/recipes-security/optee-imx/optee-client-fslc.inc
@@ -1,5 +1,5 @@
1# Copied from meta-arm/recipes-security/optee/optee-client.inc. 1# Copied from meta-arm/recipes-security/optee/optee-client.inc.
2# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-scarthgap/imx-6.6.52-2.2.0.xml#L30 2# See: https://github.com/nxp-imx/imx-manifest/blob/imx-linux-walnascar/imx-6.12.20-2.0.0.xml#L30
3 3
4SUMMARY = "OP-TEE Client API" 4SUMMARY = "OP-TEE Client API"
5DESCRIPTION = "Open Portable Trusted Execution Environment - Normal World Client side of the TEE" 5DESCRIPTION = "Open Portable Trusted Execution Environment - Normal World Client side of the TEE"
@@ -8,32 +8,39 @@ HOMEPAGE = "https://www.op-tee.org/"
8LICENSE = "BSD-2-Clause" 8LICENSE = "BSD-2-Clause"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" 9LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
10 10
11inherit systemd update-rc.d cmake 11inherit systemd update-rc.d cmake useradd
12 12
13SRC_URI = " \ 13SRC_URI = " \
14 git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https \ 14 git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https \
15 file://tee-supplicant@.service \
16 file://tee-supplicant.sh \ 15 file://tee-supplicant.sh \
17" 16"
18 17
19UPSTREAM_CHECK_GITTAGREGEX = "^(?P<pver>\d+(\.\d+)+)$" 18UPSTREAM_CHECK_GITTAGREGEX = "^(?P<pver>\d+(\.\d+)+)$"
20 19
21S = "${WORKDIR}/git"
22
23EXTRA_OECMAKE = " \ 20EXTRA_OECMAKE = " \
24 -DBUILD_SHARED_LIBS=ON \ 21 -DBUILD_SHARED_LIBS=ON \
25 -DCFG_TEE_FS_PARENT_PATH='${localstatedir}/lib/tee' \ 22 -DCFG_USE_PKGCONFIG=ON \
26" 23"
24
25# libts uses /dev/tee devices too. Add a common variable to allow configuring the same group.
26TEE_GROUP_NAME ?= "tee"
27
28EXTRA_OECMAKE += " -DCFG_ENABLE_SYSTEMD=On -DSYSTEMD_UNIT_DIR=${systemd_system_unitdir}/"
29EXTRA_OECMAKE += " -DCFG_ENABLE_UDEV=On -DUDEV_UDEV_DIR=${nonarch_base_libdir}/udev/rules.d/"
30EXTRA_OECMAKE += " -DCFG_TEE_GROUP=${TEE_GROUP_NAME} -DCFG_TEEPRIV_GROUP=teepriv"
31
27EXTRA_OECMAKE:append:toolchain-clang = " -DCFG_WERROR=0" 32EXTRA_OECMAKE:append:toolchain-clang = " -DCFG_WERROR=0"
28 33
29do_install:append() { 34do_install:append() {
30 install -D -p -m0644 ${UNPACKDIR}/tee-supplicant@.service ${D}${systemd_system_unitdir}/tee-supplicant@.service 35 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
31 install -D -p -m0755 ${UNPACKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant 36 install -D -p -m0755 ${UNPACKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant
32 37 sed -i -e s:@sysconfdir@:${sysconfdir}:g \
33 sed -i -e s:@sysconfdir@:${sysconfdir}:g \ 38 -e s:@sbindir@:${sbindir}:g \
34 -e s:@sbindir@:${sbindir}:g \ 39 -e s:@supluser@:teesuppl:g \
35 ${D}${systemd_system_unitdir}/tee-supplicant@.service \ 40 -e s:@suplgroup@:teesuppl:g \
36 ${D}${sysconfdir}/init.d/tee-supplicant 41 ${D}${sysconfdir}/init.d/tee-supplicant
42 fi
43 install -o teesuppl -g teesuppl -m 0700 -d ${D}${localstatedir}/lib/tee
37} 44}
38 45
39SYSTEMD_SERVICE:${PN} = "tee-supplicant@.service" 46SYSTEMD_SERVICE:${PN} = "tee-supplicant@.service"
@@ -41,3 +48,13 @@ SYSTEMD_SERVICE:${PN} = "tee-supplicant@.service"
41INITSCRIPT_PACKAGES = "${PN}" 48INITSCRIPT_PACKAGES = "${PN}"
42INITSCRIPT_NAME:${PN} = "tee-supplicant" 49INITSCRIPT_NAME:${PN} = "tee-supplicant"
43INITSCRIPT_PARAMS:${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ." 50INITSCRIPT_PARAMS:${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ."
51
52FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d/"
53
54# Users and groups:
55# TEE_GROUP_NAME group to access /dev/tee*
56# teepriv group to acess /dev/teepriv*, only tee-supplicant
57# teesuppl user and group teesuppl to run tee-supplicant
58USERADD_PACKAGES = "${PN}"
59GROUPADD_PARAM:${PN} = "--system ${TEE_GROUP_NAME}; --system teepriv; --system teesuppl"
60USERADD_PARAM:${PN} = "--system -g teesuppl --groups teepriv --home-dir ${localstatedir}/lib/tee -M --shell /sbin/nologin teesuppl;"