This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to capture changes to zephyr/mcuboot in source control?

I have a VS Code project that is a Workspace Application where I've had to make some modifications to code in both zephyr and mcuboot directly.  My codebase is in a git repository, but the zephyr and mcuboot directories are themselves git repositories.  This appears to be a fundamental aspect of how the west build system works, and it is not happy when I try to remove their .git folders to get their files included in the surrounding repository.

Since I can't push my personal changes to those sub-repositories, someone else checking out the codebase won't get my changes, as they aren't tracked by my main repository.

What is the recommended way to maintain source control in a situation like this?  Can I rework the west build system to not completely break when I remove those .git folders?  Or to maybe get it to apply a local git patch to them when they're first pulled?

  • Hi,

    In this situation I would recommend that you fork the repositories you would like to modify, sdk-zephyr and sdk-mcuboot in your case.
    Then you can add a west.yml to ncs which blocks these repositories from being included by nrf/west.yml and gets your fork instead. For example:

    ncs/.west/config:

    [manifest]
    path = foo
    file = west.yml
    
    [zephyr]
    base = zephyr

    ncs/foo/west.yml:

    manifest:
      projects:
    
        - name: nrf
          url: https://github.com/nrfconnect/sdk-nrf
          revision: v1.9.1
          path: nrf
          import:
            name-blocklist:
              - zephyr
              - mcuboot
    
        - name: zephyr
          url: https://github.com/USER_NAME/sdk-zephyr
          revision: v2.7.99-ncs1-1-modified
          import:
            # In addition to the zephyr repository itself, NCS also
            # imports the contents of zephyr/west.yml at the above
            # revision. Only the projects explicitly named in the
            # following allowlist are imported.
            #
            # Note that the zephyr west extensions (like 'build', 'flash',
            # 'debug', etc.) are automatically provided by this import, so
            # there's no need to add a redundant west-commands: key for
            # the zephyr project.
            #
            # Please keep this list sorted alphabetically.
            name-allowlist:
              - TraceRecorderSource
              - canopennode
              - civetweb
              - cmsis
              - edtt
              - fatfs
              - fff
              - hal_nordic
              - hal_st
              - libmetal
              - littlefs
              - loramac-node
              - lvgl
              - lz4
              - mbedtls
              - mipi-sys-t
              - nanopb
              - net-tools
              - nrf_hw_models
              - open-amp
              - psa-arch-tests
              - segger
              - tinycbor
              - tinycrypt
              - tf-m-tests
              - zscilib
              
        - name: mcuboot
          url: https://github.com/USER_NAME/sdk-mcuboot
          revision: v1.8.99-ncs1-modified
          path: bootloader/mcuboot

    You will have to modify the above ncs/foo/west.yml file to have the correct urls and revisions for your forks.

    Then you should get your forks when you run 'west update' in ncs/nrf.

Related