Skip to content

Commit 79cebf4

Browse files
boot: zephyr: boot/zephyr/include/ to zephyr/include/
In the Zephyr directory structure the module-level include is located as a subdirectory of the module-level CMakeLists.txt. For a general pattern suitable for extending existing repositories the Zephyr directory structure must exist within the `zephyr/` directory along with `module.yml`. This is necessary to avoid conflicts with existing repository directory structures and build files. Verified by: 1. Building `boot/zephyr` for mimxrt1064_evk and verifying that the zephyr image did not change in sizes. 2. Further verified that the following testcases still pass with mcuboot options on twister: mcuboot/boot/zephyr zephyr/tests/subsys/dfu zephyr/samples/subsys/mgmt/mcumgr/smp_svr Signed-off-by: Gregory SHUE <[email protected]>
1 parent 765ca5c commit 79cebf4

File tree

28 files changed

+20
-19
lines changed

28 files changed

+20
-19
lines changed

boot/bootutil/zephyr/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ if(CONFIG_MCUBOOT_BOOTUTIL_LIB)
88
zephyr_interface_library_named(MCUBOOT_BOOTUTIL)
99

1010
zephyr_include_directories(MCUBOOT_BOOTUTIL INTERFACE
11-
../
12-
../include
13-
../../zephyr/include
11+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil
12+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include
13+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
1414
)
1515

1616
zephyr_library_named(mcuboot_util)
@@ -31,7 +31,7 @@ target_link_libraries(MCUBOOT_BOOTUTIL INTERFACE zephyr_interface)
3131

3232
if(CONFIG_BOOT_USE_TINYCRYPT)
3333
target_include_directories(MCUBOOT_BOOTUTIL INTERFACE
34-
../../../ext/tinycrypt/lib/include
34+
${ZEPHYR_MCUBOOT_MODULE_DIR}/ext/tinycrypt/lib/include
3535
)
3636
endif()
3737

boot/cypress/MCUBootApp/config/mcuboot_config/mcuboot_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* For examples, see:
1818
*
19-
* boot/zephyr/include/mcuboot_config/mcuboot_config.h
19+
* zephyr/include/mcuboot_config/mcuboot_config.h
2020
* boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h
2121
*/
2222
/* Default maximum number of flash sectors per image slot; change

boot/zephyr/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CMakeLists.txt for building mcuboot as a Zephyr project
22
#
33
# Copyright (c) 2017 Open Source Foundries Limited
4+
# Copyright (c) 2022 Legrand North America, LLC.
45
#
56
# SPDX-License-Identifier: Apache-2.0
67

@@ -79,7 +80,7 @@ endif()
7980
endif()
8081

8182
zephyr_library_include_directories(
82-
include
83+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
8384
targets
8485
)
8586
if(EXISTS targets/${BOARD}.h)
@@ -155,7 +156,7 @@ if(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 OR CONFIG_BOOT_ENCRYPT_EC256 OR CONFIG_
155156
if(CONFIG_BOOT_USE_TINYCRYPT)
156157
# When using ECDSA signatures, pull in our copy of the tinycrypt library.
157158
zephyr_library_include_directories(
158-
${BOOT_DIR}/zephyr/include
159+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
159160
${TINYCRYPT_DIR}/include
160161
)
161162
zephyr_include_directories(${TINYCRYPT_DIR}/include)
@@ -176,11 +177,11 @@ if(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 OR CONFIG_BOOT_ENCRYPT_EC256 OR CONFIG_
176177
# to set MBEDTLS_CONFIG_FILE ourselves. When using Zephyr's copy, this
177178
# variable is set by its Kconfig in the Zephyr codebase.
178179
zephyr_library_compile_definitions(
179-
MBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/include/mcuboot-mbedtls-cfg.h"
180+
MBEDTLS_CONFIG_FILE="${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include/mcuboot-mbedtls-cfg.h"
180181
)
181182
elseif(CONFIG_BOOT_SIGNATURE_TYPE_NONE)
182183
zephyr_library_include_directories(
183-
${BOOT_DIR}/zephyr/include
184+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
184185
${TINYCRYPT_DIR}/include
185186
)
186187

@@ -191,7 +192,7 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_NONE)
191192
elseif(CONFIG_BOOT_SIGNATURE_TYPE_RSA)
192193
# Use mbedTLS provided by Zephyr for RSA signatures. (Its config file
193194
# is set using Kconfig.)
194-
zephyr_include_directories(include)
195+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
195196
if(CONFIG_BOOT_ENCRYPT_RSA)
196197
set_source_files_properties(
197198
${BOOT_DIR}/bootutil/src/encrypted.c
@@ -203,7 +204,7 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_ED25519 OR CONFIG_BOOT_ENCRYPT_X25519)
203204
if(CONFIG_BOOT_USE_TINYCRYPT)
204205
zephyr_library_include_directories(
205206
${MBEDTLS_ASN1_DIR}/include
206-
${BOOT_DIR}/zephyr/include
207+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
207208
${TINYCRYPT_DIR}/include
208209
${TINYCRYPT_SHA512_DIR}/include
209210
)
@@ -216,14 +217,14 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_ED25519 OR CONFIG_BOOT_ENCRYPT_X25519)
216217
${MBEDTLS_ASN1_DIR}/src/platform_util.c
217218
)
218219
zephyr_library_compile_definitions(
219-
MBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/include/mcuboot-mbedtls-cfg.h"
220+
MBEDTLS_CONFIG_FILE="${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include/mcuboot-mbedtls-cfg.h"
220221
)
221222
else()
222-
zephyr_include_directories(include)
223+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
223224
endif()
224225

225226
zephyr_library_include_directories(
226-
${BOOT_DIR}/zephyr/include
227+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
227228
${FIAT_DIR}/include/
228229
)
229230

@@ -260,7 +261,7 @@ if(CONFIG_MCUBOOT_SERIAL)
260261

261262
zephyr_include_directories(${BOOT_DIR}/bootutil/include)
262263
zephyr_include_directories(${BOOT_DIR}/boot_serial/include)
263-
zephyr_include_directories(include)
264+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
264265

265266
zephyr_include_directories_ifdef(
266267
CONFIG_BOOT_ERASE_PROGRESSIVELY

docs/PORTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ by MCUboot. For example, Mynewt uses MYNEWT_VAL() and Zephyr uses
6464
Kconfig; these configuration systems are converted to MCUBOOT_ options
6565
in the following files:
6666

67-
- boot/zephyr/include/mcuboot_config/mcuboot_config.h
67+
- zephyr/include/mcuboot_config/mcuboot_config.h
6868
- boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h
6969

7070
## Flash Map

docs/readme-zephyr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ it as usual:
6161
In addition to the partitions defined in DTS, some additional
6262
information about the flash layout is currently required to build
6363
MCUboot itself. All the needed configuration is collected in
64-
`boot/zephyr/include/target.h`. Depending on the board, this information
64+
`zephyr/include/target.h`. Depending on the board, this information
6565
may come from board-specific headers, Device Tree, or be configured by
6666
MCUboot on a per-SoC family basis.
6767

samples/mcuboot_config/mcuboot_config.template.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* For examples, see:
1919
*
20-
* boot/zephyr/include/mcuboot_config/mcuboot_config.h
20+
* zephyr/include/mcuboot_config/mcuboot_config.h
2121
* boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h
2222
*/
2323

sim/src/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl ImagesBuilder {
141141
let mut slots = Vec::with_capacity(num_images);
142142
for image in 0..num_images {
143143
// This mapping must match that defined in
144-
// `boot/zephyr/include/sysflash/sysflash.h`.
144+
// `zephyr/include/sysflash/sysflash.h`.
145145
let id0 = match image {
146146
0 => FlashId::Image0,
147147
1 => FlashId::Image2,
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)