From 0e99ebbded742ba725383b20dda7b7d9b38d4509 Mon Sep 17 00:00:00 2001 From: Michael LeMay Date: Wed, 18 Nov 2015 09:19:04 -0800 Subject: [PATCH] x86: Add support for 32-bit build hosts in build_uefi.sh This patch adds support for building the UEFI EDK2 tools on 32-bit hosts. It also revises the script to support rebuilding the tools when the script is re-invoked after the EDK2 repository has previously been downloaded. --- cpu/x86/uefi/build_uefi.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cpu/x86/uefi/build_uefi.sh b/cpu/x86/uefi/build_uefi.sh index 5b7cba644..c49718f93 100755 --- a/cpu/x86/uefi/build_uefi.sh +++ b/cpu/x86/uefi/build_uefi.sh @@ -5,10 +5,17 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) # This script will always run on its own basepath, no matter where you call it from. pushd ${SCRIPT_DIR} +if [ "$(uname -m)" = "x86_64" ]; then + export ARCH=X64 +fi + # Download the UEFI tool and library sources: -git clone --depth=1 https://github.com/tianocore/edk2 || exit -# This script only supports building the tools on 64-bit hosts: -export ARCH=X64 +if [ -e edk2 ]; then + make -C edk2/BaseTools/Source/C/Common clean + make -C edk2/BaseTools/Source/C/GenFw clean +else + git clone --depth=1 https://github.com/tianocore/edk2 || exit +fi # Build common sources required by the GenFw tool: make -C edk2/BaseTools/Source/C/Common || exit # Build the GenFw tool that is used to generate UEFI binaries: