From 1617f22da46142cd9de9356000d46f9bb58dd1cb Mon Sep 17 00:00:00 2001 From: Mathieu Tarral Date: Tue, 25 Mar 2025 07:43:52 -0700 Subject: [PATCH 1/3] tutorials: fix EDK2 and EDK2 Platforms hashes --- examples/tutorials/edk2-simics-platform/Dockerfile | 4 ++-- examples/tutorials/edk2-simics-platform/build-custom.sh | 4 ++-- examples/tutorials/edk2-uefi/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/tutorials/edk2-simics-platform/Dockerfile b/examples/tutorials/edk2-simics-platform/Dockerfile index 84091a8b..04d134ee 100644 --- a/examples/tutorials/edk2-simics-platform/Dockerfile +++ b/examples/tutorials/edk2-simics-platform/Dockerfile @@ -11,8 +11,8 @@ RUN git clone https://github.com/tianocore/edk2.git && \ git clone https://github.com/tianocore/edk2-non-osi.git && \ git clone https://github.com/IntelFsp/FSP.git -ARG EDK2_HASH="eccdab6" -ARG EDK2_PLATFORMS_HASH="f446fff" +ARG EDK2_HASH="edk2-stable202505" +ARG EDK2_PLATFORMS_HASH="51c7f2948adeb8b6dc4db6a8f1ada8a1b4e5528e" ARG EDK2_NON_OSI_HASH="1f4d784" ARG INTEL_FSP_HASH="8beacd5" diff --git a/examples/tutorials/edk2-simics-platform/build-custom.sh b/examples/tutorials/edk2-simics-platform/build-custom.sh index 71644220..0285607b 100755 --- a/examples/tutorials/edk2-simics-platform/build-custom.sh +++ b/examples/tutorials/edk2-simics-platform/build-custom.sh @@ -8,8 +8,8 @@ IMAGE_NAME="edk2-simics" DOCKERFILE="${SCRIPT_DIR}/Dockerfile-custom" CONTAINER_UID=$(echo "${RANDOM}" | sha256sum | head -c 8) CONTAINER_NAME="${IMAGE_NAME}-tmp-${CONTAINER_UID}" -EDK2_HASH="eccdab6" -EDK2_PLATFORMS_HASH="f446fff" +EDK2_HASH="edk2-stable202505" +EDK2_PLATFORMS_HASH="51c7f2948adeb8b6dc4db6a8f1ada8a1b4e5528e" EDK2_NON_OSI_HASH="1f4d784" INTEL_FSP_HASH="8beacd5" diff --git a/examples/tutorials/edk2-uefi/Dockerfile b/examples/tutorials/edk2-uefi/Dockerfile index 2b1900f1..53301379 100644 --- a/examples/tutorials/edk2-uefi/Dockerfile +++ b/examples/tutorials/edk2-uefi/Dockerfile @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-o", "pipefail", "-c"] ENV EDK2_REPO_URL "https://github.com/tianocore/edk2.git" -ENV EDK2_REPO_HASH "d189de3b0a2f44f4c9b87ed120be16569ea19b51" +ENV EDK2_REPO_HASH "edk2-stable202505" ENV EDK2_PATH "/edk2" From d0641e0434e867c8d282b17a6bdf218cc5064466 Mon Sep 17 00:00:00 2001 From: Mathieu Tarral Date: Wed, 26 Mar 2025 07:19:04 -0700 Subject: [PATCH 2/3] tutorials: use shallow clone for submodules --- examples/tutorials/edk2-simics-platform/Dockerfile | 8 ++++---- examples/tutorials/edk2-simics-platform/build-custom.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/tutorials/edk2-simics-platform/Dockerfile b/examples/tutorials/edk2-simics-platform/Dockerfile index 04d134ee..87c4ae46 100644 --- a/examples/tutorials/edk2-simics-platform/Dockerfile +++ b/examples/tutorials/edk2-simics-platform/Dockerfile @@ -17,13 +17,13 @@ ARG EDK2_NON_OSI_HASH="1f4d784" ARG INTEL_FSP_HASH="8beacd5" RUN git -C edk2 checkout "${EDK2_HASH}" && \ - git -C edk2 submodule update --init && \ + git -C edk2 submodule update --init --depth 1 && \ git -C edk2-platforms checkout "${EDK2_PLATFORMS_HASH}" && \ - git -C edk2-platforms submodule update --init && \ + git -C edk2-platforms submodule update --init --depth 1 && \ git -C edk2-non-osi checkout "${EDK2_NON_OSI_HASH}" && \ - git -C edk2-non-osi submodule update --init && \ + git -C edk2-non-osi submodule update --init --depth 1 && \ git -C FSP checkout "${INTEL_FSP_HASH}" && \ - git -C FSP submodule update --init + git -C FSP submodule update --init --depth 1 ENV EDK_TOOLS_PATH="${PROJECT}/edk2/BaseTools/" ENV PACKAGES_PATH="${PROJECT}/edk2:${PROJECT}/edk2-platforms:${PROJECT}/edk2-non-osi" diff --git a/examples/tutorials/edk2-simics-platform/build-custom.sh b/examples/tutorials/edk2-simics-platform/build-custom.sh index 0285607b..d9f819da 100755 --- a/examples/tutorials/edk2-simics-platform/build-custom.sh +++ b/examples/tutorials/edk2-simics-platform/build-custom.sh @@ -17,17 +17,17 @@ if [ ! -d "${SCRIPT_DIR}/workspace" ]; then mkdir -p "${SCRIPT_DIR}/workspace" git clone https://github.com/tianocore/edk2.git "${SCRIPT_DIR}/workspace/edk2" git -C "${SCRIPT_DIR}/workspace/edk2" checkout "${EDK2_HASH}" - git -C "${SCRIPT_DIR}/workspace/edk2" submodule update --init + git -C "${SCRIPT_DIR}/workspace/edk2" submodule update --init --depth 1 git clone https://github.com/tianocore/edk2-platforms.git "${SCRIPT_DIR}/workspace/edk2-platforms" git -C "${SCRIPT_DIR}/workspace/edk2-platforms" checkout "${EDK2_PLATFORMS_HASH}" - git -C "${SCRIPT_DIR}/workspace/edk2-platforms" submodule update --init + git -C "${SCRIPT_DIR}/workspace/edk2-platforms" submodule update --init --depth 1 cp "${SCRIPT_DIR}/../../../harness/tsffs.h" "${SCRIPT_DIR}/workspace/edk2-platforms/Platform/Intel/SimicsOpenBoardPkg/Library/DxeLogoLib/tsffs.h" git clone https://github.com/tianocore/edk2-non-osi.git "${SCRIPT_DIR}/workspace/edk2-non-osi" git -C "${SCRIPT_DIR}/workspace/edk2-non-osi" checkout "${EDK2_NON_OSI_HASH}" - git -C "${SCRIPT_DIR}/workspace/edk2-non-osi" submodule update --init + git -C "${SCRIPT_DIR}/workspace/edk2-non-osi" submodule update --init --depth 1 git clone https://github.com/IntelFsp/FSP.git "${SCRIPT_DIR}/workspace/FSP" git -C "${SCRIPT_DIR}/workspace/FSP" checkout "${INTEL_FSP_HASH}" - git -C "${SCRIPT_DIR}/workspace/FSP" submodule update --init + git -C "${SCRIPT_DIR}/workspace/FSP" submodule update --init --depth 1 fi docker build -t "${IMAGE_NAME}" -f "${DOCKERFILE}" "${SCRIPT_DIR}" From 20026732ff2abcd8a3e528bba2b9cdee367e15c5 Mon Sep 17 00:00:00 2001 From: Mathieu Tarral Date: Mon, 4 Aug 2025 05:56:53 -0700 Subject: [PATCH 3/3] tutorials: use errexit in build scripts --- examples/tutorials/edk2-simics-platform/build.sh | 2 ++ examples/tutorials/edk2-uefi/build.sh | 1 + examples/tutorials/risc-v-kernel/build.sh | 2 ++ 3 files changed, 5 insertions(+) diff --git a/examples/tutorials/edk2-simics-platform/build.sh b/examples/tutorials/edk2-simics-platform/build.sh index 84e5f13d..2f1df751 100755 --- a/examples/tutorials/edk2-simics-platform/build.sh +++ b/examples/tutorials/edk2-simics-platform/build.sh @@ -3,6 +3,8 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +set -e + SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) IMAGE_NAME="edk2-simics-platform" DOCKERFILE="${SCRIPT_DIR}/Dockerfile" diff --git a/examples/tutorials/edk2-uefi/build.sh b/examples/tutorials/edk2-uefi/build.sh index 6547862f..e8389ffb 100755 --- a/examples/tutorials/edk2-uefi/build.sh +++ b/examples/tutorials/edk2-uefi/build.sh @@ -3,6 +3,7 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +set -e SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) IMAGE_NAME="tsffs-tutorial-edk2-uefi" diff --git a/examples/tutorials/risc-v-kernel/build.sh b/examples/tutorials/risc-v-kernel/build.sh index 790a2dcc..508258c8 100755 --- a/examples/tutorials/risc-v-kernel/build.sh +++ b/examples/tutorials/risc-v-kernel/build.sh @@ -3,6 +3,8 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +set -e + SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) IMAGE_NAME="tsffs-tutorial-riscv64-kernel-module" CONTAINER_UID=$(echo "${RANDOM}" | sha256sum | head -c 8)