payloads/edk2/Makefile: Improve dirty repo check, sync submodules

Don't skip checking out the specified edk2 branch if the repo contains
untracked files, which may be the case if the EDK2_GOP_DRIVER option
is selected. Also ensure the submodule pointers are correct when
checking out.

TEST=build google/panther with GOP driver option and edk2 payload 2x,
switching branches between builds and ensure the correct branch is
used each time and submodules are synced with branch.

Change-Id: If7040bd5c49209b37a4b308485bf59352197d3b6
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78030
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
Matt DeVillier 2023-09-20 10:55:10 -05:00 committed by Martin L Roth
parent 9031877866
commit 598a4b409f
1 changed files with 2 additions and 1 deletions

View File

@ -194,9 +194,10 @@ $(EDK2_PATH): $(WORKSPACE)
echo " $(CONFIG_EDK2_TAG_OR_REV) is not a valid git reference"; \
exit 1; \
fi; \
if git status --ignore-submodules=dirty | grep -q clean; then \
if git status --ignore-submodules=dirty | grep -q -e clean -e "nothing added"; then \
echo " Checking out $(project_name) revision $(CONFIG_EDK2_TAG_OR_REV)"; \
git checkout --detach $(CONFIG_EDK2_TAG_OR_REV) -f; \
git submodule update --checkout --recursive; \
else \
echo " Working directory not clean; will not overwrite"; \
fi; \