Commit 818cef7f authored by Abderrahmane Jarmouni's avatar Abderrahmane Jarmouni Committed by Erwan Gouriou
Browse files

scripts: serie_update: fetch submodules

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: default avatarAbderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
parent af2d314b
Loading
Loading
Loading
Loading
+9 −1
Changes for scripts/serie_update.py: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -192,14 +192,22 @@ class Stm32SerieUpdate:
            # 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()