In edk2-build.sh, ARCH is declared as BUILD_ARCH. Since we always
build on x86, ARCH variable equals to X64.
Then there's error when build OPTEE.
Building opteed Trusted OS Target: AARCH64
Build: X64
Target: ARM
Build: X64
CFG_ARM64_core=y
CROSS_COMPILE_ta_arm64=aarch64-linux-gnu-
CROSS_COMPILE=arm-linux-gnueabihf-
CROSS_COMPILE_core=aarch64-linux-gnu-
PROFILE=RELEASE PLATFORM=hikey
PLATFORM_FLAVOR=hikey
CFG_TEE_CORE_LOG_LEVEL=2
core/core.mk:10: core/arch/X64/plat-hikey/conf.mk: No such file or directory
core/core.mk:12: core/arch/X64/X64.mk: No such file or directory
core/core.mk:114: core/arch/X64/kernel/link.mk: No such file or directory
mk/subdir.mk:151: lib/libutee/arch/X64/sub.mk: No such file or directory
make: * No rule to make target 'lib/libutee/arch/X64/sub.mk'. Stop.
So add "ARCH=arm" when build OPTEE.
Signed-off-by: Haojian Zhuang <haojian.zhuang(a)linaro.org>
---
opteed-build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opteed-build.sh b/opteed-build.sh
index 702860e..63dafb0 100755
--- a/opteed-build.sh
+++ b/opteed-build.sh
@@ -94,7 +94,7 @@ function build_platform
if [ $VERBOSE -eq 1 ]; then
echo "Calling OP-TEE build:"
fi
- make -j$NUM_THREADS ${PLATFORM_BUILDFLAGS}
+ make ARCH=arm -j$NUM_THREADS ${PLATFORM_BUILDFLAGS}
if [ $? -eq 0 ]; then
#
# Copy resulting images to UEFI image dir
--
2.7.4
When migrate to BL2_EL3 in ARM Trusted Firmware, bl2.bin should
be built out of fip.bin. Otherwise, non-TF ROM failes to load
bl2.bin because it doesn't recognize fip.bin format.
So copy bl2.bin to UEFI folder after ATF built.
Signed-off-by: Haojian Zhuang <haojian.zhuang(a)linaro.org>
---
atf-build.sh | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/atf-build.sh b/atf-build.sh
index 65d4dbc..234ddde 100755
--- a/atf-build.sh
+++ b/atf-build.sh
@@ -182,9 +182,17 @@ function build_platform
# Copy resulting images to UEFI image dir
#
if [ $VERBOSE -eq 1 ]; then
- echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
+ echo "Copying bl1.bin bl2.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
+ echo "Copying images to '$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/':"
+ CPPFLAGS="-v"
+ else
+ CPPFLAGS=""
fi
- cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ for file in build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,bl2,fip}.bin; do
+ if [ -f "$file" ]; then
+ cp -a $CPPFLAGS "$file" "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV"
+ fi
+ done
else
return 1
fi
--
2.7.4
When migrate to BL2_EL3 in ARM Trusted Firmware, bl2.bin should
be built out of fip.bin. Otherwise, non-TF ROM failes to load
bl2.bin because it doesn't recognize fip.bin format.
So copy bl2.bin to UEFI folder after ATF built.
Signed-off-by: Haojian Zhuang <haojian.zhuang(a)linaro.org>
---
atf-build.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/atf-build.sh b/atf-build.sh
index 65d4dbc..db741f5 100755
--- a/atf-build.sh
+++ b/atf-build.sh
@@ -182,9 +182,15 @@ function build_platform
# Copy resulting images to UEFI image dir
#
if [ $VERBOSE -eq 1 ]; then
- echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
+ echo "Copying bl1.bin bl2.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
fi
- cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ if [ -f build/"$ATF_PLATFORM/$BUILD_TYPE"/bl1.bin ]; then
+ cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/bl1.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ fi
+ if [ -f build/"$ATF_PLATFORM/$BUILD_TYPE"/bl2.bin ]; then
+ cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/bl2.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ fi
+ cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/fip.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
else
return 1
fi
--
2.7.4