diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2017-06-26 15:00:48 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-06-26 15:00:48 +0100 |
commit | 3ad1ee5b09d1d36fff4ed9d7920c52a10f428a95 (patch) | |
tree | 2994e2018d958fab97927d684c7e8039a5536226 | |
parent | defa2970883dcfef147c61d34929c3cb46197064 (diff) |
add arm-tf support to edk2-build.sh
- Add search_packages_path to common-functions.
- Change occurences of EDK2_DIR to WORKSPACE or
`search_packages_path` in atf-build.sh.
- Look for arm-trusted-firmware directory if -a was
not specified on command line to edk2-build.sh.
- Add required options to build Juno with arm-tf
to edk2-platforms.config.
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rwxr-xr-x | atf-build.sh | 16 | ||||
-rw-r--r-- | common-functions | 18 | ||||
-rwxr-xr-x | edk2-build.sh | 5 | ||||
-rw-r--r-- | edk2-platforms.config | 4 |
4 files changed, 35 insertions, 8 deletions
diff --git a/atf-build.sh b/atf-build.sh index b72cfbb..e07c0d8 100755 --- a/atf-build.sh +++ b/atf-build.sh @@ -72,10 +72,10 @@ function build_platform BL30="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o scp_bin`" if [ $ATF_BUILDVER -gt 1 ]; then unset SCP_BL2 - SCP_BL2="$EDK2_DIR/$BL30" + SCP_BL2=`search_packages_path "$BL30"` fi BL31="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o el3_bin`" - BL33="$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_bin`" + BL33="$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_bin`" # # Set up cross compilation variables (if applicable) @@ -86,10 +86,10 @@ function build_platform echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\"" if [ X"$BL30" != X"" ]; then - BL30="${EDK2_DIR}"/"${BL30}" + BL30=`search_packages_path "$BL30"` fi if [ X"$BL31" != X"" ]; then - BL31="${EDK2_DIR}"/"${BL31}" + BL31=`search_packages_path "$BL31"` fi # @@ -102,7 +102,7 @@ function build_platform TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`" if [ X"$TOS_BIN" != X"" ]; then - BL32=$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN + BL32=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN fi if [ X"$SPD" != X"" ] && [ X"$BL32" != X"" ]; then @@ -127,7 +127,7 @@ function build_platform SPM_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o spm_bin`" if [ X"$SPM_BIN" != X"" ]; then - BL32=$EDK2_DIR/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/$SPM_BIN + BL32=$WORKSPACE/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/$SPM_BIN PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS SPM=1" fi # We assume that user does not want secure partition either. @@ -183,9 +183,9 @@ function build_platform # Copy resulting images to UEFI image dir # if [ $VERBOSE -eq 1 ]; then - echo "Copying bl1.bin and fip.bin to "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"" + echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"" fi - cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" + cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" else return 1 fi diff --git a/common-functions b/common-functions index 80b690e..4cea2f5 100644 --- a/common-functions +++ b/common-functions @@ -191,3 +191,21 @@ function import_openssl cd - >/dev/null return $RET } + +function search_packages_path +{ + file="$1" + + IFS=: + for dir in $PACKAGES_PATH; do + if [ -e "$dir/$file" ]; then + echo "$dir/$file" + unset IFS + return 0 + fi + done + + echo "$file not found in any directory on PACKAGES_PATH!" >&2 + unset IFS + return 1 +} diff --git a/edk2-build.sh b/edk2-build.sh index 8169c17..46a9575 100755 --- a/edk2-build.sh +++ b/edk2-build.sh @@ -193,6 +193,11 @@ function configure_paths GLOBAL_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:$NON_OSI_DIR" fi + # locate arm-trusted-firmware + if [ -z "$ATF_DIR" -a -d "$PWD"/arm-trusted-firmware ]; then + ATF_DIR="$PWD"/arm-trusted-firmware + fi + export WORKSPACE } diff --git a/edk2-platforms.config b/edk2-platforms.config index ede9832..50d7574 100644 --- a/edk2-platforms.config +++ b/edk2-platforms.config @@ -66,6 +66,10 @@ LONGNAME=aarch64 Juno DSC=Platform/ARM/JunoPkg/ArmJuno.dsc BUILDFLAGS= ARCH=AARCH64 +BUILD_ATF=yes +SCP_BIN=Platform/ARM/Juno/bl30.bin +UEFI_BIN=BL33_AP_UEFI.fd +UEFI_IMAGE_DIR=ArmJuno # ARM FVP BASE AEMv8-A model [fvp] |