new file mode 100644
@@ -0,0 +1 @@
+10
new file mode 100644
@@ -0,0 +1,10 @@
+Source: ${PN}
+Section: admin
+Priority: optional
+Standards-Version: 3.9.6
+Build-Depends: ${DEBIAN_BUILD_DEPENDS}
+Maintainer: ISAR project <isar-users@googlegroups.com>
+
+Package: optee-os-${OPTEE_NAME}
+Architecture: ${DISTRO_ARCH}
+Description: ${DESCRIPTION}, firmware binaries
new file mode 100755
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+
+# Debian rules for custom OP-TEE OS build
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+endif
+
+override_dh_auto_build:
+ CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLATFORM=$(OPTEE_PLATFORM) \
+ $(OPTEE_EXTRA_BUILDARGS)
+
+%:
+ dh $@
new file mode 100644
@@ -0,0 +1,46 @@
+# Custom OP-TEE OS build
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:"
+
+SRC_URI += "file://debian/"
+
+DESCRIPTION ?= "Custom OP-TEE OS"
+
+OPTEE_NAME ?= "${MACHINE}"
+OPTEE_PLATFORM ?= "unknown"
+OPTEE_EXTRA_BUILDARGS ?= ""
+OPTEE_BINARIES ?= "tee-pager_v2.bin"
+
+DEBIAN_BUILD_DEPENDS ?= "python3-pycryptodome:native, python3-pyelftools"
+
+PROVIDES += "optee-os-${OPTEE_NAME}"
+
+TEMPLATE_FILES = "debian/control.tmpl"
+TEMPLATE_VARS += "OPTEE_NAME DEBIAN_BUILD_DEPENDS"
+
+# split strip platform flavor, if any, from the specified platform string
+OPTEE_PLATFORM_BASE = "${@d.getVar('OPTEE_PLATFORM').split('-')[0]}"
+
+do_prepare_build() {
+ cp -r ${WORKDIR}/debian ${S}/
+
+ deb_add_changelog
+
+ rm -f ${S}/debian/optee-os-${OPTEE_NAME}.install
+ for binary in ${OPTEE_BINARIES}; do
+ echo "out/arm-plat-${OPTEE_PLATFORM_BASE}/core/$binary /usr/lib/optee-os/${OPTEE_NAME}/" >> \
+ ${S}/debian/optee-os-${OPTEE_NAME}.install
+ done
+}
+
+dpkg_runbuild_prepend() {
+ export OPTEE_PLATFORM="${OPTEE_PLATFORM}"
+ export OPTEE_EXTRA_BUILDARGS="${OPTEE_EXTRA_BUILDARGS}"
+}