diff --git a/script/bootstrap b/script/bootstrap index 8700bedf..e2694c2c 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -172,6 +172,7 @@ main() { if [ $# == 0 ]; then install_packages + install_arm_toolchain install_packages_pip3 do_bootstrap_silabs elif [ "$1" == 'packages' ]; then diff --git a/script/build b/script/build index 0f690f1f..2b2833fe 100755 --- a/script/build +++ b/script/build @@ -37,6 +37,7 @@ else fi script_dir="$(realpath "$(dirname "${script_path}")")" repo_dir="$(dirname "${script_dir}")" +gsdk_dir="${repo_dir}/third_party/silabs/gecko_sdk" # shellcheck source=script/efr32-definitions source "${repo_dir}/script/efr32-definitions" @@ -46,6 +47,39 @@ source "${repo_dir}/script/util" set -euxo pipefail +# ============================================================================== +# Pre-build checks + +set +x +echo "=========================================================================================================" +echo "Check if the Git LFS package is installed" +echo "=========================================================================================================" +set -x +if ! git lfs >/dev/null; then + set +x + echo "ERROR: Git LFS is not installed" + echo + echo "Please run './script/bootstrap packages'" to install it + exit 3 +fi + +set +x +echo "=========================================================================================================" +echo "Ensure Git LFS has been initialized for the GSDK" +echo "=========================================================================================================" +set -x +if [ ! -f "$(git -C "${gsdk_dir}" rev-parse --git-dir)/hooks/pre-push" ]; then + git -C "${gsdk_dir}" lfs install +fi + +set +x +echo "=========================================================================================================" +echo "Ensure GSDK submodule has been initialized and LFS objects have been pulled" +echo "=========================================================================================================" +set -x +git submodule update --init "${gsdk_dir}" +git -C "${gsdk_dir}" lfs pull + # ============================================================================== OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET-} @@ -299,7 +333,7 @@ main() before_flags+=("--skip-generation") fi - "${repo_dir}"/script/build_example_apps "${before_flags[@]}" "${board}" "${after_flags[@]}" "$@" + "${repo_dir}"/script/build_example_apps "${before_flags[@]-}" "${board}" "${after_flags[@]-}" "$@" fi