Skip to content

Commit cf46cc8

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 a768fd3 commit cf46cc8

File tree

28 files changed

+19
-19
lines changed

28 files changed

+19
-19
lines changed

boot/bootutil/zephyr/CMakeLists.txt

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

99
zephyr_include_directories(MCUBOOT_BOOTUTIL INTERFACE
10-
../
11-
../include
12-
../../zephyr/include
10+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil
11+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include
12+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
1313
)
1414

1515
zephyr_library_named(mcuboot_util)
@@ -30,7 +30,7 @@ target_link_libraries(MCUBOOT_BOOTUTIL INTERFACE zephyr_interface)
3030

3131
if(CONFIG_BOOT_USE_TINYCRYPT)
3232
target_include_directories(MCUBOOT_BOOTUTIL INTERFACE
33-
../../../ext/tinycrypt/lib/include
33+
${ZEPHYR_MCUBOOT_MODULE_DIR}/ext/tinycrypt/lib/include
3434
)
3535
endif()
3636

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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ endif()
7979
endif()
8080

8181
zephyr_library_include_directories(
82-
include
82+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
8383
targets
8484
)
8585
if(EXISTS targets/${BOARD}.h)
@@ -155,7 +155,7 @@ if(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 OR CONFIG_BOOT_ENCRYPT_EC256 OR CONFIG_
155155
if(CONFIG_BOOT_USE_TINYCRYPT)
156156
# When using ECDSA signatures, pull in our copy of the tinycrypt library.
157157
zephyr_library_include_directories(
158-
${BOOT_DIR}/zephyr/include
158+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
159159
${TINYCRYPT_DIR}/include
160160
)
161161
zephyr_include_directories(${TINYCRYPT_DIR}/include)
@@ -176,11 +176,11 @@ if(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256 OR CONFIG_BOOT_ENCRYPT_EC256 OR CONFIG_
176176
# to set MBEDTLS_CONFIG_FILE ourselves. When using Zephyr's copy, this
177177
# variable is set by its Kconfig in the Zephyr codebase.
178178
zephyr_library_compile_definitions(
179-
MBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/include/mcuboot-mbedtls-cfg.h"
179+
MBEDTLS_CONFIG_FILE="${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include/mcuboot-mbedtls-cfg.h"
180180
)
181181
elseif(CONFIG_BOOT_SIGNATURE_TYPE_NONE)
182182
zephyr_library_include_directories(
183-
${BOOT_DIR}/zephyr/include
183+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
184184
${TINYCRYPT_DIR}/include
185185
)
186186

@@ -191,7 +191,7 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_NONE)
191191
elseif(CONFIG_BOOT_SIGNATURE_TYPE_RSA)
192192
# Use mbedTLS provided by Zephyr for RSA signatures. (Its config file
193193
# is set using Kconfig.)
194-
zephyr_include_directories(include)
194+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
195195
if(CONFIG_BOOT_ENCRYPT_RSA)
196196
set_source_files_properties(
197197
${BOOT_DIR}/bootutil/src/encrypted.c
@@ -203,7 +203,7 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_ED25519 OR CONFIG_BOOT_ENCRYPT_X25519)
203203
if(CONFIG_BOOT_USE_TINYCRYPT)
204204
zephyr_library_include_directories(
205205
${MBEDTLS_ASN1_DIR}/include
206-
${BOOT_DIR}/zephyr/include
206+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
207207
${TINYCRYPT_DIR}/include
208208
${TINYCRYPT_SHA512_DIR}/include
209209
)
@@ -216,14 +216,14 @@ elseif(CONFIG_BOOT_SIGNATURE_TYPE_ED25519 OR CONFIG_BOOT_ENCRYPT_X25519)
216216
${MBEDTLS_ASN1_DIR}/src/platform_util.c
217217
)
218218
zephyr_library_compile_definitions(
219-
MBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/include/mcuboot-mbedtls-cfg.h"
219+
MBEDTLS_CONFIG_FILE="${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include/mcuboot-mbedtls-cfg.h"
220220
)
221221
else()
222-
zephyr_include_directories(include)
222+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
223223
endif()
224224

225225
zephyr_library_include_directories(
226-
${BOOT_DIR}/zephyr/include
226+
${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include
227227
${FIAT_DIR}/include/
228228
)
229229

@@ -260,7 +260,7 @@ if(CONFIG_MCUBOOT_SERIAL)
260260

261261
zephyr_include_directories(${BOOT_DIR}/bootutil/include)
262262
zephyr_include_directories(${BOOT_DIR}/boot_serial/include)
263-
zephyr_include_directories(include)
263+
zephyr_include_directories(${ZEPHYR_MCUBOOT_MODULE_DIR}/zephyr/include)
264264

265265
zephyr_include_directories_ifdef(
266266
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)