From 86ec5c7035bf1e8a07d88405f95d9c75a4c52684 Mon Sep 17 00:00:00 2001 From: Jan Pohanka Date: Wed, 24 Aug 2022 11:57:17 +0200 Subject: [PATCH 1/2] build: set recursive option for globbing relocated files This allow to use ** wildcard in zephyr_code_relocate cmake macro to match files in any subdirectory. Signed-off-by: Jan Pohanka --- scripts/build/gen_relocate_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/gen_relocate_app.py b/scripts/build/gen_relocate_app.py index 48db0d6818116..0201462c100c0 100644 --- a/scripts/build/gen_relocate_app.py +++ b/scripts/build/gen_relocate_app.py @@ -435,7 +435,7 @@ def create_dict_wrt_mem(): mem_region, copy_flag, file_name = line.split(':', 2) - file_name_list = glob.glob(file_name) + file_name_list = glob.glob(file_name, recursive=True) if not file_name_list: warnings.warn("File: "+file_name+" Not found") continue From 63f4135de8558b1aaa7fe76aa12217d998850c6a Mon Sep 17 00:00:00 2001 From: Jan Pohanka Date: Wed, 24 Aug 2022 11:59:58 +0200 Subject: [PATCH 2/2] doc: note about file globbing in code-relocation Add details how the files are searched using zephyr_code_relocate cmake macro. Signed-off-by: Jan Pohanka --- doc/kernel/code-relocation.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/kernel/code-relocation.rst b/doc/kernel/code-relocation.rst index 715ce4bbb202e..6b61485b95226 100644 --- a/doc/kernel/code-relocation.rst +++ b/doc/kernel/code-relocation.rst @@ -61,7 +61,8 @@ for data copy operations from ROM to required memory type. .. note:: - The file argument supports limited regular expressions. + The file argument supports limited regular expressions. Files are searched + using the Python's glob function (with ``recursive=True``). function zephyr_code_relocate() can be called as many times as required. This step has to be performed before the inclusion of boilerplate.cmake.