Skip to content

Commit

Permalink
scripts: serie_update: fetch submodules
Browse files Browse the repository at this point in the history
STM32Cube HAL drivers are now included as git submodules in the upstream
STM32Cube repositories. So we need additional commands to fetch them.

Signed-off-by: Abderrahmane Jarmouni <[email protected]>
  • Loading branch information
ajarmouni-st authored and erwango committed Nov 20, 2023
1 parent af2d314 commit 818cef7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/serie_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,22 @@ def clone_cube_repo(self):
# if already exists, then just clean and fetch
self.os_cmd(("git", "clean", "-fdx"), cwd=self.stm32cube_serie_path)
self.os_cmd(("git", "fetch"), cwd=self.stm32cube_serie_path)
# this is useful when HAL drivers submodules are not aleardy
# present locally, otherwise "git fetch" is sufficient
self.os_cmd(("git", "submodule", "update", "--init"),
cwd=self.stm32cube_serie_path)
branch = self.major_branch()
self.os_cmd(
("git", "reset", "--hard", branch),
cwd=self.stm32cube_serie_path,
)
else:
# HAL drivers are now included as git submodules in upstream
# STM32Cube repositories
# So, we need to add --recursive or --recurse-submodules to
# "git clone" to fetch them
self.os_cmd(
("git", "clone", repo_name),
("git", "clone", "--recursive", repo_name),
cwd=self.stm32cube_repo_path,
)
branch = self.major_branch()
Expand Down

0 comments on commit 818cef7

Please sign in to comment.