summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorLeif Lindholm <leif.lindholm@linaro.org>2017-10-19 16:00:26 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2017-10-19 16:35:53 +0100
commit370c40b0559ac972936b28164faa46d518322e7c (patch)
tree1a39abf47e2b3c029c507654e265086ba9d2e997 /build.sh
parent90164206ac2d6813c3e3f22815f70bf53c1b2999 (diff)
build.sh: copy produced images to out/
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh30
1 files changed, 29 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 78a6776..742e9de 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-BUILD_OPTIONS="-c platforms.config -b DEBUG -b RELEASE"
+CONFIG_OPTIONS="-c platforms.config"
+BUILD_OPTIONS="$CONFIG_OPTIONS -b DEBUG -b RELEASE"
ARM_TF_REPO=https://github.com/ARM-software/arm-trusted-firmware.git
EDK2_REPO=https://github.com/tianocore/edk2.git
@@ -95,6 +96,29 @@ build_all()
./uefi-tools/edk2-build.sh $BUILD_OPTIONS all
}
+copy_images()
+{
+ EDK2_NON_OSI_DIR=`readlink -f edk2-non-osi` # Used in expansion of $IMAGES below
+
+ PLATFORMS=`uefi-tools/parse-platforms.py $CONFIG_OPTIONS list`
+ for platform in $PLATFORMS; do
+ echo PLATFORM=$platform
+ IMAGE_DIR="`uefi-tools/parse-platforms.py $CONFIG_OPTIONS -p $platform -o UEFI_IMAGE_DIR get`"
+ IMAGES="`uefi-tools/parse-platforms.py $CONFIG_OPTIONS -p $platform images`"
+ DEBUG_DIR="$PWD/out/debug/$platform/"
+ RELEASE_DIR="$PWD/out/release/$platform/"
+ mkdir -p "$DEBUG_DIR" "$RELEASE_DIR"
+ echo "Copying images for platform '$platform':"
+
+ pushd Build/$IMAGE_DIR/RELEASE_*/FV/ >/dev/null
+ cp `eval echo $IMAGES` $RELEASE_DIR
+ popd >/dev/null
+ pushd Build/$IMAGE_DIR/DEBUG_*/FV/ >/dev/null
+ cp `eval echo $IMAGES` $DEBUG_DIR
+ popd >/dev/null
+ done
+}
+
BUILD_OPTIONS="$BUILD_OPTIONS $*"
for repo in arm-trusted-firmware edk2 edk2-platforms edk2-non-osi uefi-tools
@@ -106,3 +130,7 @@ done
rm -rf Build
build_all
+
+if [ $? -eq 0 ]; then
+ copy_images
+fi