From a2876a26a1bd34eaa90cb0266de9aac8d1ac8f71 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Wed, 24 Jul 2024 15:54:18 -0400 Subject: [PATCH] Makefile: When cloning a repo from Git, update submodules correctly When cloning a repo from Git, actually change to the repo directory to check out the submodules as well. Without the -C , the submodule checkout happened in the Heads repo itself, which has no submodules. This is important for coreboot being built in CI. Without this, the coreboot submodules will be checked out automatically by the coreboot build system during the build, meaning they will not be in the prepped module cache. A trade-off though is that at this point, we don't know what submodules are actually needed - we will clone some that are not needed. coreboot knows to skip some submodules during the build if they are not needed. Signed-off-by: Jonathon Hall --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4266d89e..860508ca 100644 --- a/Makefile +++ b/Makefile @@ -392,7 +392,7 @@ define define_module = $(build)/$($1_base_dir)/.canary: FORCE if [ ! -e "$$@" ]; then \ git clone $($1_repo) "$(build)/$($1_base_dir)"; \ - git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && git submodule update --init --checkout; \ + git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && git -C "$(build)/$($1_base_dir)" submodule update --init --checkout; \ echo -n '$($1_repo)|$($1_commit_hash)' > "$$@"; \ elif [ "$$$$(cat "$$@")" != '$($1_repo)|$($1_commit_hash)' ]; then \ echo "Switching $1 to $($1_repo) at $($1_commit_hash)" && \