On Thu, Oct 17, 2019 at 07:51:07AM +0200, Szymon Janc wrote:
> Hello,
>
> Due to recent changes in mcuboot git (use of submodules) you may hit issues
> with newt upgrade|install|sync commands. There is a short term hotfix merged
> into newt master to workaround this.
>
> Since this is also affecting new users we may need to release newt
> 1.7.1 (only newt tool) in next few days to address this issue.
Thanks Szymon. This is indeed a bummer.
To add a few details, mcuboot replaced a regular directory with a
submodule (ext/mbedtls). This was done with two separate commits:
1. Rename (regular directory) `ext/mbedtls` --> `ext/mbedtls-asn1`
2. Add submodule `ext/mbedtls`
Git reports an error when you use `git checkout` to "jump over" these
two commits. If you try going from post- to pre-, git reports the
following error and aborts the operation:
The following untracked working tree files would be overwritten by
checkout:
ext/mbedtls/include/mbedtls/asn1.h
ext/mbedtls/include/mbedtls/bignum.h
ext/mbedtls/include/mbedtls/check_config.h
ext/mbedtls/include/mbedtls/config.h
ext/mbedtls/include/mbedtls/ecdsa.h
ext/mbedtls/include/mbedtls/ecp.h
ext/mbedtls/include/mbedtls/md.h
ext/mbedtls/include/mbedtls/oid.h
ext/mbedtls/include/mbedtls/pk.h
ext/mbedtls/include/mbedtls/platform.h
ext/mbedtls/include/mbedtls/platform_util.h
ext/mbedtls/include/mbedtls/threading.h
Please move or remove them before you switch branches.
Aborting
If you attempt the reverse (pre- to post-), the operation succeeds, but
git reports a warning and leaves an orphaned directory behind (making
the repo state dirty).
These issues cause `newt upgrade` to fail in most cases.
This problem was addressed in the newt tool with an mcuboot-specific
hack: https://github.com/apache/mynewt-newt/pull/343
I couldn't think of a good general solution to this problem (if anyone
else can, please share!). Unless I'm missing something, I think I would
call this a git bug, so I am going to report it to the git maintainers
if it hasn't already been reported.
Chris