Skip to content
Snippets Groups Projects
Commit c0bc8086 authored by Jens Wiklander's avatar Jens Wiklander Committed by Jérôme Forissier
Browse files

Add buildroot external packages repository


Adds external packages repository for buildroot containing:
* Packing for optee_client, optee_examples, optee_test and optee_benchmark
* Configs and a script to assembly defconfigs needed for buildroot

Acked-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent ccd829ae
No related branches found
No related tags found
No related merge requests found
Showing
with 281 additions and 0 deletions
source "$BR2_EXTERNAL_OPTEE_PATH/package/optee_client/Config.in"
source "$BR2_EXTERNAL_OPTEE_PATH/package/optee_test/Config.in"
source "$BR2_EXTERNAL_OPTEE_PATH/package/optee_examples/Config.in"
source "$BR2_EXTERNAL_OPTEE_PATH/package/optee_benchmark/Config.in"
# Architecture
BR2_arm=y
BR2_cortex_a15=y
BR2_ARM_FPU_VFPV3D16=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
# Architecture
BR2_aarch64=y
BR2_PACKAGE_OPTEE_EXAMPLES=y
BR2_CCACHE=y
BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot, type root to login"
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y
BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_OPTEE_CLIENT=y
BR2_PACKAGE_OPTEE_TEST=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PATH="%TOP_DIR%/toolchains/aarch32"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-linux-gnueabihf"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PATH="%TOP_DIR%/toolchains/aarch64"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="aarch64-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
name: OPTEE
desc: OP-TEE br2-external tree
include $(sort $(wildcard $(BR2_EXTERNAL_OPTEE_PATH)/package/*/*.mk))
config BR2_PACKAGE_OPTEE_BENCHMARK
bool "optee_benchmark"
select BR2_PACKAGE_LIBYAML
help
http://github.org/OP-TEE/optee_benchmark
if BR2_PACKAGE_OPTEE_BENCHMARK
config BR2_PACKAGE_OPTEE_BENCHMARK_SITE
string "OP-TEE benchmark path"
default ""
help
The path to the source directory of OP-TEE benchmark
endif
OPTEE_BENCHMARK_VERSION = 1.0
OPTEE_BENCHMARK_SOURCE = local
OPTEE_BENCHMARK_SITE = $(BR2_PACKAGE_OPTEE_BENCHMARK_SITE)
OPTEE_BENCHMARK_SITE_METHOD = local
OPTEE_BENCHMARK_INSTALL_STAGING = YES
OPTEE_BENCHMARK_DEPENDENCIES = optee_client libyaml
$(eval $(cmake-package))
config BR2_PACKAGE_OPTEE_CLIENT
bool "optee_client"
help
http://github.org/OP-TEE/optee_client
if BR2_PACKAGE_OPTEE_CLIENT
config BR2_PACKAGE_OPTEE_CLIENT_SITE
string "OP-TEE client path"
default ""
help
The path to the source directory of OP-TEE client
endif
#!/bin/sh
#
# /etc/init.d/optee
#
# Start/stop tee-supplicant (OP-TEE normal world daemon)
#
case "$1" in
start)
if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
echo "Starting tee-supplicant..."
/usr/sbin/tee-supplicant &
exit 0
else
echo "tee-supplicant or TEE device not found"
exit 1
fi
;;
stop)
killall tee-supplicant
;;
status)
cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not "
echo "tee-supplicant is ${not}active"
;;
esac
OPTEE_CLIENT_VERSION = 1.0
OPTEE_CLIENT_SOURCE = local
OPTEE_CLIENT_SITE = $(BR2_PACKAGE_OPTEE_CLIENT_SITE)
OPTEE_CLIENT_SITE_METHOD = local
OPTEE_CLIENT_INSTALL_STAGING = YES
define OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT
$(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \
$(TARGET_DIR)/etc/init.d/S30optee
endef
define OPTEE_CLIENT_INSTALL_INIT_SYSV
$(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT)
endef
$(eval $(cmake-package))
config BR2_PACKAGE_OPTEE_EXAMPLES
bool "optee_examples"
help
http://github.org/OP-TEE/optee_examples
if BR2_PACKAGE_OPTEE_EXAMPLES
config BR2_PACKAGE_OPTEE_EXAMPLES_SITE
string "OP-TEE examples path"
default ""
help
The path to the source directory of OP-TEE examples
config BR2_PACKAGE_OPTEE_EXAMPLES_SDK
string "OPTEE SDK path"
default ""
help
some help
config BR2_PACKAGE_OPTEE_EXAMPLES_CROSS_COMPILE
string "OPTEE cross compiler"
default ""
help
some help
endif
OPTEE_EXAMPLES_VERSION = 1.0
OPTEE_EXAMPLES_SOURCE = local
OPTEE_EXAMPLES_SITE = $(BR2_PACKAGE_OPTEE_EXAMPLES_SITE)
OPTEE_EXAMPLES_SITE_METHOD = local
OPTEE_EXAMPLES_INSTALL_STAGING = YES
OPTEE_EXAMPLES_DEPENDENCIES = optee_client
OPTEE_EXAMPLES_SDK = $(BR2_PACKAGE_OPTEE_EXAMPLES_SDK)
OPTEE_EXAMPLES_CONF_OPTS = -DOPTEE_EXAMPLES_SDK=$(OPTEE_EXAMPLES_SDK)
define OPTEE_EXAMPLES_BUILD_TAS
@$(foreach f,$(wildcard $(@D)/*/ta/Makefile), \
$(MAKE) CROSS_COMPILE="$(shell echo $(BR2_PACKAGE_OPTEE_EXAMPLES_CROSS_COMPILE))" \
O=out TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_SDK) V=1 \
$(TARGET_CONFIGURE_OPTS) -C $(dir $f) all &&) true
endef
define OPTEE_EXAMPLES_INSTALL_TAS
@$(foreach f,$(wildcard $(@D)/*/ta/out/*.ta), \
mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
$(INSTALL) -v -p --mode=444 \
--target-directory=$(TARGET_DIR)/lib/optee_armtz $f \
&&) true
endef
OPTEE_EXAMPLES_POST_BUILD_HOOKS += OPTEE_EXAMPLES_BUILD_TAS
OPTEE_EXAMPLES_POST_INSTALL_TARGET_HOOKS += OPTEE_EXAMPLES_INSTALL_TAS
$(eval $(cmake-package))
config BR2_PACKAGE_OPTEE_TEST
bool "optee_test"
select BR2_PACKAGE_OPTEE_CLIENT
help
http://github.org/OP-TEE/optee_test
if BR2_PACKAGE_OPTEE_TEST
config BR2_PACKAGE_OPTEE_TEST_SITE
string "OP-TEE test path"
default ""
help
The path to the source directory of OP-TEE test
config BR2_PACKAGE_OPTEE_TEST_SDK
string "OPTEE SDK path"
default ""
help
some help
config BR2_PACKAGE_OPTEE_TEST_CROSS_COMPILE
string "OPTEE cross compiler"
default ""
help
some help
endif
OPTEE_TEST_VERSION = 1.0
OPTEE_TEST_SOURCE = local
OPTEE_TEST_SITE = $(BR2_PACKAGE_OPTEE_TEST_SITE)
OPTEE_TEST_SITE_METHOD = local
OPTEE_TEST_INSTALL_STAGING = YES
OPTEE_TEST_DEPENDENCIES = optee_client
OPTEE_TEST_SDK = $(BR2_PACKAGE_OPTEE_TEST_SDK)
OPTEE_TEST_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_TEST_SDK)
define OPTEE_TEST_BUILD_TAS
@$(foreach f,$(wildcard $(@D)/ta/*/Makefile), \
$(MAKE) CROSS_COMPILE="$(shell echo $(BR2_PACKAGE_OPTEE_TEST_CROSS_COMPILE))" \
O=out TA_DEV_KIT_DIR=$(OPTEE_TEST_SDK) \
$(TARGET_CONFIGURE_OPTS) -C $(dir $f) all &&) true
endef
define OPTEE_TEST_INSTALL_TAS
@$(foreach f,$(wildcard $(@D)/ta/*/out/*.ta), \
mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
$(INSTALL) -v -p --mode=444 \
--target-directory=$(TARGET_DIR)/lib/optee_armtz $f \
&&) true
endef
OPTEE_TEST_POST_BUILD_HOOKS += OPTEE_TEST_BUILD_TAS
OPTEE_TEST_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_INSTALL_TAS
$(eval $(cmake-package))
#!/usr/bin/env python
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2018, Linaro Limited
import argparse
import shutil
import os
import re
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--br', required=True,
help='Path to buildroot tree')
parser.add_argument('--out', required=True,
help='Path to buildroot out directory')
parser.add_argument('--top-dir', required=True,
help='Replaces %TOP_DIR% in defconfig files')
parser.add_argument('--br-ext-optee', required=True,
help='Path the OP-TEE external buildroot tree')
parser.add_argument('--br-defconfig', required=True, action='append',
help='Buildroot defconfig file')
parser.add_argument('--make-cmd', required=True,
help='Make command')
return parser.parse_args()
def concatenate_files(top_dir, dst, srcs):
with open(dst, 'w') as outfile:
for fname in srcs:
with open(fname) as infile:
for line in infile:
outfile.write(line.replace('%TOP_DIR%', top_dir))
def main():
args = get_args()
if not os.path.isdir(args.out):
os.makedirs(args.out)
concatenate_files(args.top_dir, args.out + '/defconfig', args.br_defconfig)
if os.path.isabs(args.out):
out = args.out
else:
out = '../' + args.out
if os.path.isabs(args.br_ext_optee):
br_ext_optee = args.br_ext_optee
else:
br_ext_optee = '../' + args.br_ext_optee
os.execlp(args.make_cmd, args.make_cmd, '-C', args.br, 'O=' + out,
'BR2_EXTERNAL=' + br_ext_optee,
'BR2_DEFCONFIG=' + out + '/defconfig', 'defconfig')
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment