blob: 80ac00971a82be5808dd53e1854dad6cf85505de [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001SUMMARY = "OP-TEE Trusted OS"
2DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE"
3HOMEPAGE = "https://www.op-tee.org/"
4
5LICENSE = "BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
7
8inherit deploy python3native
9require optee.inc
10
11CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os"
12
13DEPENDS = "python3-pyelftools-native python3-cryptography-native"
14
15DEPENDS:append:toolchain-clang = " compiler-rt"
16
17SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https"
18
Brad Bishopbec4ebc2022-08-03 09:55:16 -040019S = "${WORKDIR}/git"
20B = "${WORKDIR}/build"
21
22EXTRA_OEMAKE += " \
23 PLATFORM=${OPTEEMACHINE} \
24 CFG_${OPTEE_CORE}_core=y \
25 CROSS_COMPILE_core=${HOST_PREFIX} \
26 CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
27 NOWERROR=1 \
28 ta-targets=ta_${OPTEE_ARCH} \
29 O=${B} \
30"
Patrick Williams92b42cb2022-09-03 06:53:57 -050031EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}"
32EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}"
Brad Bishopbec4ebc2022-08-03 09:55:16 -040033
Brad Bishopbec4ebc2022-08-03 09:55:16 -040034LDFLAGS[unexport] = "1"
35CPPFLAGS[unexport] = "1"
36AS[unexport] = "1"
37LD[unexport] = "1"
38
Patrick Williams92b42cb2022-09-03 06:53:57 -050039do_compile:prepend() {
40 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
41}
Brad Bishopbec4ebc2022-08-03 09:55:16 -040042
43do_compile() {
44 oe_runmake -C ${S} all
45}
46do_compile[cleandirs] = "${B}"
47
48do_install() {
49 #install core in firmware
50 install -d ${D}${nonarch_base_libdir}/firmware/
51 install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/
Andrew Geissler23e02792023-07-21 09:06:10 -050052
53 #install tas in optee_armtz
54 install -d ${D}${nonarch_base_libdir}/optee_armtz/
55 install -m 444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz
Brad Bishopbec4ebc2022-08-03 09:55:16 -040056}
57
58PACKAGE_ARCH = "${MACHINE_ARCH}"
59
60do_deploy() {
61 install -d ${DEPLOYDIR}/${MLPREFIX}optee
62 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee
Andrew Geissler23e02792023-07-21 09:06:10 -050063
64 install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta
65 install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta
Brad Bishopbec4ebc2022-08-03 09:55:16 -040066}
67
68addtask deploy before do_build after do_install
69
70SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
71
Andrew Geissler23e02792023-07-21 09:06:10 -050072PACKAGES += "${PN}-ta"
Brad Bishopbec4ebc2022-08-03 09:55:16 -040073FILES:${PN} = "${nonarch_base_libdir}/firmware/"
Andrew Geissler23e02792023-07-21 09:06:10 -050074FILES:${PN}-ta = "${nonarch_base_libdir}/optee_armtz/*"
75
Brad Bishopbec4ebc2022-08-03 09:55:16 -040076
77# note: "textrel" is not triggered on all archs
78INSANE_SKIP:${PN} = "textrel"
79# Build paths are currently embedded
80INSANE_SKIP:${PN} += "buildpaths"
81INSANE_SKIP:${PN}-dev = "staticdev"
82INHIBIT_PACKAGE_STRIP = "1"
83