Commit ba1fbe60 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Fix running newtmgr when building for mcuboot

This enables mynewt to use mcuboot as a remote repository, which is only
required when using newtmgr to manage images. Since mcuboot has slightly
changed the trailer format, newtmgr built against the bundled mynewt
bootloader writes the magic and flags to the wrong location.

To build a mynewt app the wants to run with mcuboot as the bootloader
and requires newtmgr one needs to change the app's pkg.yml dependencies
as follows:

-    - boot/bootutil
+    - "@mcuboot/boot/bootutil"

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent d0116731
Loading
Loading
Loading
Loading
+2 −6
Changes for boot/bootutil/include/bootutil/sha256.h: 2 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -29,12 +29,8 @@
#ifndef __BOOTUTIL_CRYPTO_H_
#define __BOOTUTIL_CRYPTO_H_

/* FIXME: The test below will only work as long as the app name is
 * "mynewt", building for mynewt could export some __linux__, __APPLE__
 * style macro!
 */
#ifdef APP_mynewt
#include "mynewt/config.h"
#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#if defined(MCUBOOT_USE_MBED_TLS) && defined(MCUBOOT_USE_TINYCRYPT)
+7
Changes for boot/bootutil/pkg.yml: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -25,7 +25,14 @@ pkg.keywords:
    - boot
    - bootloader

pkg.apis:
    - bootloader

pkg.cflags:
    - "-DMCUBOOT_MYNEWT"

pkg.deps:
    - "@mcuboot/boot/mynewt/mcuboot_config"
    - "@apache-mynewt-core/hw/hal"
    - "@apache-mynewt-core/crypto/mbedtls"
    - "@apache-mynewt-core/kernel/os"
+2 −2
Changes for boot/bootutil/src/image_ec.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

#include <string.h>

#ifdef APP_mynewt
#include "mynewt/config.h"
#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#ifdef MCUBOOT_SIGN_EC
+2 −2
Changes for boot/bootutil/src/image_ec256.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

#include <string.h>

#ifdef APP_mynewt
#include "mynewt/config.h"
#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#ifdef MCUBOOT_SIGN_EC256
+2 −2
Changes for boot/bootutil/src/image_rsa.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

#include <string.h>

#ifdef APP_mynewt
#include "mynewt/config.h"
#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#ifdef MCUBOOT_SIGN_RSA
Loading