forked from apache/incubator-teaclave-trustzone-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add `build_optee_libraries.sh`, `environment` for quick setup on QEMUv8; - Simplify ci.yml; - Update README. Signed-off-by: Yuan Zhuang <[email protected]>
- Loading branch information
Showing
5 changed files
with
155 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -e | ||
|
||
OPTEE_VERSION=4.2.0 | ||
|
||
TARGET_PATH=$1 | ||
|
||
# check arguments | ||
if [ -z "$TARGET_PATH" ]; then | ||
echo "Usage: $0 <path_for_storage>" | ||
exit 1 | ||
fi | ||
|
||
# set toolchain | ||
export CROSS_COMPILE="aarch64-linux-gnu-" | ||
export CROSS_COMPILE32="arm-linux-gnueabihf-" | ||
export CROSS_COMPILE64="aarch64-linux-gnu-" | ||
|
||
# build optee_os and optee_client for qemu_v8 | ||
git clone https://github.com/OP-TEE/optee_os.git -b $OPTEE_VERSION $TARGET_PATH/optee_os | ||
(cd $TARGET_PATH/optee_os && make PLATFORM=vexpress-qemu_armv8a) | ||
|
||
git clone https://github.com/OP-TEE/optee_client.git -b $OPTEE_VERSION $TARGET_PATH/optee_client | ||
(cd $TARGET_PATH/optee_client && make WITH_TEEACL=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
export PATH=$PATH:$HOME/.cargo/bin | ||
|
||
if [ -z "$OPTEE_DIR" ] | ||
then | ||
echo -e "OPTEE_DIR has not set, use $PWD/optee/ as default\n" | ||
export OPTEE_DIR=$PWD/optee | ||
fi | ||
|
||
export OPTEE_OS_DIR="$OPTEE_DIR/optee_os" | ||
export OPTEE_CLIENT_DIR="$OPTEE_DIR/optee_client" | ||
|
||
export CROSS_COMPILE="aarch64-linux-gnu-" | ||
export CROSS_COMPILE32="arm-linux-gnueabihf-" | ||
export CROSS_COMPILE64="aarch64-linux-gnu-" | ||
|
||
if [ "$ARCH" = "arm" ] | ||
then | ||
# build host and TA as 32-bit | ||
export TA_DEV_KIT_DIR="$OPTEE_OS_DIR/out/arm-plat-vexpress/export-ta_arm32" | ||
export OPTEE_CLIENT_EXPORT="$OPTEE_CLIENT_DIR/out/export" | ||
export TARGET="arm-unknown-linux-gnueabihf" | ||
else | ||
# build host and TA as 64-bit by default | ||
unset ARCH | ||
export TA_DEV_KIT_DIR="$OPTEE_OS_DIR/out/arm-plat-vexpress/export-ta_arm64" | ||
export OPTEE_CLIENT_EXPORT="$OPTEE_CLIENT_DIR/out/export" | ||
export TARGET="aarch64-unknown-linux-gnu" | ||
fi | ||
|
||
# check if libraries exist | ||
if [ -d "$TA_DEV_KIT_DIR" ] | ||
then | ||
echo "set TA_DEV_KIT_DIR=$TA_DEV_KIT_DIR" | ||
else | ||
echo -e "Error: TA_DEV_KIT_DIR=$TA_DEV_KIT_DIR does not exist, please set the correct TA_DEV_KIT_DIR or run \"$ ./build_optee_libraries.sh optee/\" then try again\n" | ||
unset OPTEE_DIR | ||
fi | ||
|
||
if [ -d "$OPTEE_CLIENT_EXPORT" ] | ||
then | ||
echo "set OPTEE_CLIENT_EXPORT=$OPTEE_CLIENT_EXPORT" | ||
else | ||
echo -e "Error: OPTEE_CLIENT_EXPORT=$OPTEE_CLIENT_EXPORT does not exist, please set the correct OPTEE_CLIENT_EXPORT or run \"$ ./build_optee_libraries.sh optee/\" then try again\n" | ||
unset OPTEE_DIR | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters