-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_common.sh
executable file
·46 lines (43 loc) · 1.27 KB
/
build_common.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
if ! [ -f edk2/edksetup.sh ] && ! [ -f ../edk2/edksetup.sh ]
then set -e
echo "Updating submodules"s
git submodule init;git submodule update --depth 1
pushd edk2
git submodule init;git submodule update
popd
pushd F11/Library/SimpleInit
git submodule init;git submodule update
popd
set +e
fi
for i in "${EDK2}" ./edk2 ../edk2
do if [ -n "${i}" ]&&[ -f "${i}/edksetup.sh" ]
then _EDK2="$(realpath "${i}")"
break
fi
done
for i in "${EDK2_PLATFORMS}" ./edk2-platforms ../edk2-platforms
do if [ -n "${i}" ]&&[ -d "${i}/Platform" ]
then _EDK2_PLATFORMS="$(realpath "${i}")"
break
fi
done
for i in "${SIMPLE_INIT}" F11/Library/SimpleInit ./simple-init ../simple-init
do if [ -n "${i}" ]&&[ -f "${i}/SimpleInit.inc" ]
then _SIMPLE_INIT="$(realpath "${i}")"
break
fi
done
echo "EDK2 Path: ${_EDK2}"
echo "EDK2_PLATFORMS Path: ${_EDK2_PLATFORMS}"
export CROSS_COMPILE="${CROSS_COMPILE:-aarch64-linux-gnu-}"
export GCC5_AARCH64_PREFIX="${CROSS_COMPILE}"
export CLANG38_AARCH64_PREFIX="${CROSS_COMPILE}"
export PACKAGES_PATH="$_EDK2:$_EDK2_PLATFORMS:$_SIMPLE_INIT:$PWD"
export WORKSPACE="${PWD}"
. "${_EDK2}"/edksetup.sh
mkdir -p "${_SIMPLE_INIT}/build"
bash "${_SIMPLE_INIT}/scripts/gen-rootfs-source.sh" \
"${_SIMPLE_INIT}" \
"${_SIMPLE_INIT}/build"
make -C "${_EDK2}"/BaseTools/Source/C