aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2016-05-20 09:45:50 +0200
committerKoen Kooi <koen.kooi@linaro.org>2016-06-23 07:35:36 +0200
commitf6cda0d7dfb1797e3874efc2fe929a0561125354 (patch)
tree20919d3e9bbcff98d3be671a3d0f859d97be39c3
parentb7baae4a75428a3ec93c9577481821c190d57356 (diff)
optee-os: add recipe for 2.0 release
Change-Id: I80ddfccfe2e5021d3ad108f0f940d6f538dac66a Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
-rw-r--r--meta-optee/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch13
-rw-r--r--meta-optee/recipes-security/optee/optee-os_git.bb78
2 files changed, 91 insertions, 0 deletions
diff --git a/meta-optee/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch b/meta-optee/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch
new file mode 100644
index 00000000..17127d0b
--- /dev/null
+++ b/meta-optee/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch
@@ -0,0 +1,13 @@
+diff --git a/mk/gcc.mk b/mk/gcc.mk
+index fc38c4d..77b8d74 100644
+--- a/mk/gcc.mk
++++ b/mk/gcc.mk
+@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \
+ -print-file-name=include 2> /dev/null)
+
+ # Get location of libgcc from gcc
+-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \
++libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \
+ -print-libgcc-file-name 2> /dev/null)
+
+ # Define these to something to discover accidental use
diff --git a/meta-optee/recipes-security/optee/optee-os_git.bb b/meta-optee/recipes-security/optee/optee-os_git.bb
new file mode 100644
index 00000000..cb2c8355
--- /dev/null
+++ b/meta-optee/recipes-security/optee/optee-os_git.bb
@@ -0,0 +1,78 @@
+SUMMARY = "OP-TEE Trusted OS"
+DESCRIPTION = "OPTEE OS"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
+
+PV="2.0.0+git${SRCPV}"
+
+DEPENDS = "python-pycrypto-native"
+
+inherit deploy pythonnative
+
+SRCREV = "eb00c7b99f79964c8d08c88e94ab99f12c504ff9"
+SRC_URI = "git://github.com/OP-TEE/optee_os.git \
+ file://0001-allow-setting-sysroot-for-libgcc-lookup.patch "
+
+
+S = "${WORKDIR}/git"
+
+OPTEEMACHINE ?= "${MACHINE}"
+OPTEEOUTPUTMACHINE ?= "${MACHINE}"
+
+EXTRA_OEMAKE = "PLATFORM=${OPTEEMACHINE} CFG_ARM64_core=y \
+ CROSS_COMPILE_core=${HOST_PREFIX} \
+ CROSS_COMPILE_ta_arm64=${HOST_PREFIX} \
+ ta-targets=ta_arm64 \
+ LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
+ "
+
+OPTEE_ARCH_armv7a = "arm32"
+OPTEE_ARCH_aarch64 = "arm64"
+
+do_compile() {
+ unset LDFLAGS
+ oe_runmake all CFG_TEE_TA_LOG_LEVEL=0
+}
+
+do_install() {
+ #install core on boot directory
+ install -d ${D}/lib/firmware/
+
+ install -m 644 ${B}/out/arm-plat-${OPTEEOUTPUTMACHINE}/core/*.bin ${D}/lib/firmware/
+ #install TA devkit
+ install -d ${D}/usr/include/optee/export-user_ta/
+
+ for f in ${B}/out/arm-plat-${OPTEEOUTPUTMACHINE}/export-ta_${OPTEE_ARCH}/* ; do
+ cp -aR $f ${D}/usr/include/optee/export-user_ta/
+ done
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_deploy() {
+ long_srvrev=${SRCREV}
+ short_srvrev=$(echo $long_srvrev | awk '{ string=substr($0, 1, 8); print string; }' )
+ OPTEE_CORE_SUFFIX="${MACHINE}-$short_srvrev"
+ install -d ${DEPLOYDIR}/optee
+ if [ "${is_armv7}" = "1" ];
+ then
+ for f in ${D}/lib/firmware/*; do
+ filename=$(basename "$f")
+ extension="${filename##*.}"
+ sfilename="${filename%.*}"
+ bbnote "Deploy $sfilename-${OPTEE_CORE_SUFFIX}.$extension"
+ install -m 644 $f ${DEPLOYDIR}/optee/$sfilename-${OPTEE_CORE_SUFFIX}.$extension
+ done
+ fi
+}
+
+addtask deploy before do_build after do_install
+
+FILES_${PN} = "/lib/firmware/"
+FILES_${PN}-dev = "/usr/include/optee"
+
+INSANE_SKIP_${PN}-dev = "staticdev"
+
+INHIBIT_PACKAGE_STRIP = "1"
+