From ae414114e6f791e7bfc7c7dcff1b5d686f8f0ccf Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Wed, 6 Nov 2024 16:17:32 +0100 Subject: [PATCH 1/2] snapcraft: edk2: fix subhook submodule url Also, we don't need cmocka submodule url fixup anymore as: https://github.com/tianocore/edk2/commit/2ad22420a710dc07e3b644f91a5b55c09c39ecf3 Suggested-by: Thomas Parrott Signed-off-by: Alexander Mikhalitsyn (cherry picked from commit 1c5f2f32b3c45b672ea397af974597670cbccd70) (cherry picked from commit b28d21fa9238c4bb8bc577661a48ca109f87f9af) --- snapcraft.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index e1e97574..c68b2117 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -356,7 +356,8 @@ parts: git config user.name "LXD snap builder" # Fix submodules - sed -i "s#https://git.cryptomilk.org/projects/cmocka#https://gitlab.com/cmocka/cmocka#g" .gitmodules + # see https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + sed -i "s#https://github.com/Zeex/subhook.git#https://github.com/tianocore/edk2-subhook.git#g" .gitmodules git submodule update --init --recursive # Apply patches From f3e562b04b7b75a246b0be82bfaf2612cf137375 Mon Sep 17 00:00:00 2001 From: Thomas Parrott Date: Thu, 7 Nov 2024 09:09:01 +0000 Subject: [PATCH 2/2] snapcraft: edk2: Use more of snapcraft's default pull mechanisms - Switch to source-commit and empty source-submodules. - Reduce customisations to override-pull stage. - Move downloading submodules into override-pull stage. (cherry picked from commit a454318a5f4a057e921c1af81cd233eb877273c4) Signed-off-by: Thomas Parrott (cherry picked from commit 520617d4ea71eca6534ec41df6bfc949b18683b5) --- snapcraft.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index c68b2117..de3437a3 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -327,7 +327,8 @@ parts: - nasm source: https://github.com/tianocore/edk2 source-depth: 1 - source-tag: IRRELEVANT + source-commit: 8736b8fdca85e02933cdb0a13309de14c9799ece # edk2-stable202311 + source-submodules: [] source-type: git plugin: nil build-packages: @@ -344,9 +345,16 @@ parts: craftctl default override-pull: |- [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && exit 0 + craftctl default + set -ex - git config --global transfer.fsckobjects true - git clone https://github.com/tianocore/edk2 . -b edk2-stable202311 + + # Fix submodule sources + # see https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 + sed -i "s#https://github.com/Zeex/subhook.git#https://github.com/tianocore/edk2-subhook.git#g" .gitmodules + + # Pull submodules after switching to source-commit + git submodule update --init --recursive override-build: |- [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && exit 0 set -ex @@ -355,11 +363,6 @@ parts: git config user.email "noreply@lists.canonical.com" git config user.name "LXD snap builder" - # Fix submodules - # see https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701 - sed -i "s#https://github.com/Zeex/subhook.git#https://github.com/tianocore/edk2-subhook.git#g" .gitmodules - git submodule update --init --recursive - # Apply patches patch -p1 < "${CRAFT_PROJECT_DIR}/patches/edk2-0001-force-DUID-LLT.patch" cp "${CRAFT_PROJECT_DIR}/patches/edk2-0002-logo.bmp" MdeModulePkg/Logo/Logo.bmp