diff options
-rwxr-xr-x | atf-build.sh | 24 | ||||
-rwxr-xr-x | opteed-build.sh | 14 | ||||
-rw-r--r-- | platforms.config | 2 | ||||
-rwxr-xr-x | tos-build.sh | 2 |
4 files changed, 36 insertions, 6 deletions
diff --git a/atf-build.sh b/atf-build.sh index a6b220c..2ab7db3 100755 --- a/atf-build.sh +++ b/atf-build.sh @@ -26,7 +26,8 @@ function build_platform return 1 fi - if [ X"`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_atf`" = X"" ]; then + BUILD_ATF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_atf`" + if [ X"$BUILD_ATF" = X"" ]; then echo "Platform '$1' is not configured to build ARM Trusted Firmware." return 0 fi @@ -88,6 +89,20 @@ function build_platform fi fi + # + # Debug extraction handling + # + case "$BUILD_ATF" in + debug*) + DEBUG=1 + BUILD_TYPE="debug" + ;; + *) + DEBUG=0 + BUILD_TYPE="release" + ;; + esac + export BL30 BL31 BL32 BL33 SPD_OPTION echo "BL30=$BL30" @@ -95,23 +110,24 @@ function build_platform echo "BL32=$BL32" echo "BL33=$BL33" echo "$SPD_OPTION" + echo "BUILD_TYPE=$BUILD_TYPE" # # If a build was done with BL32, and followed by another without, # the BL32 component remains in fip.bin, so we delete the build dir # contents before calling make # - rm -rf build/"$ATF_PLATFORM"/release/* + rm -rf build/"$ATF_PLATFORM/$BUILD_TYPE"/* # # Build ARM Trusted Firmware and create FIP # - CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION all fip + CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG all fip if [ $? -eq 0 ]; then # # Copy resulting images to UEFI image dir # - cp -a build/"$ATF_PLATFORM"/release/{bl1,fip}.bin "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" + cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" else return 1 fi diff --git a/opteed-build.sh b/opteed-build.sh index f30aec0..63bddd7 100755 --- a/opteed-build.sh +++ b/opteed-build.sh @@ -21,7 +21,7 @@ function usage function build_platform { - unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR + unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG TOS_PLATFORM=`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform` if [ X"$TOS_PLATFORM" = X"" ]; then TOS_PLATFORM=`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform` @@ -62,6 +62,18 @@ function build_platform # # Set up build variables # + BUILD_TOS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" + case "$BUILD_TOS" in + debug*) + export DEBUG=1 + echo "PROFILE=DEBUG" + ;; + *) + export DEBUG=0 + echo "PROFILE=RELEASE" + ;; + esac + export PLATFORM=$TOS_PLATFORM export PLATFORM_FLAVOR=$TOS_PLATFORM_FLAVOR echo "PLATFORM=$PLATFORM" diff --git a/platforms.config b/platforms.config index 563767f..79ffeb4 100644 --- a/platforms.config +++ b/platforms.config @@ -24,6 +24,7 @@ # If this is set, you must also set ATF_SPD! # Else we will not know which specific Trusted OS to # build. +# Set to "debug" to create a debug build. # - TOS_PLATFORM Platform name for Trusted OS build, if # different from ARM Trusted Firmware platform # or UEFI platform name. @@ -33,6 +34,7 @@ # Options for ARM Trusted Firmware platforms # - BUILD_ATF Set to "yes" if the build should automatically build # ARM Trusted Firmware and a fip containing UEFI image. +# Set to "debug" to create a debug build. # - ATF_PLATFORM Platform name for ARM Trusted Firmware build, if # different from UEFI platform name. # - SCP_BIN SCP image to pass to ARM Trusted Firmware. diff --git a/tos-build.sh b/tos-build.sh index 3591d01..936870c 100755 --- a/tos-build.sh +++ b/tos-build.sh @@ -25,7 +25,7 @@ function build_platform return 1 fi - if [ X"`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" != X"yes" ]; then + if [ X"`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" = X"" ]; then echo "Platform '$1' is not configured to build Trusted OS." return 0 fi |