From 1561a0705f767c4afbede9086bdb2485d16303d7 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Wed, 24 May 2023 12:34:34 +0200 Subject: [PATCH] snippets: support for EXTRA_DTC_OVERLAY_FILE and EXTRA_CONF_FILE This commit adds change snippets to use the new EXTRA_DTC_OVERLAY_FILE and EXTRA_CONF_FILE Zephyr build system variables instead of DTC_OVERLAY_FILE and OVERLAY_CONFIG. Signed-off-by: Torsten Rasmussen --- doc/build/snippets/writing.rst | 14 +++++++------- scripts/schemas/snippet-schema.yml | 4 ++-- scripts/snippets.py | 2 +- snippets/cdc-acm-console/snippet.yml | 4 ++-- .../extra_snippet_root/snippets/bar/snippet.yml | 2 +- tests/cmake/snippets/snippets/foo/snippet.yml | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/build/snippets/writing.rst b/doc/build/snippets/writing.rst index 66101e8e2b..5a60a7e738 100644 --- a/doc/build/snippets/writing.rst +++ b/doc/build/snippets/writing.rst @@ -28,8 +28,8 @@ this: name: foo append: - DTC_OVERLAY_FILE: foo.overlay - OVERLAY_CONFIG: foo.conf + EXTRA_DTC_OVERLAY_FILE: foo.overlay + EXTRA_CONF_FILE: foo.conf Namespacing *********** @@ -113,7 +113,7 @@ This :file:`snippet.yml` adds :file:`foo.overlay` to the build: name: foo append: - DTC_OVERLAY_FILE: foo.overlay + EXTRA_DTC_OVERLAY_FILE: foo.overlay The path to :file:`foo.overlay` is relative to the directory containing :file:`snippet.yml`. @@ -129,7 +129,7 @@ This :file:`snippet.yml` adds :file:`foo.conf` to the build: name: foo append: - OVERLAY_CONFIG: foo.conf + EXTRA_CONF_FILE: foo.conf The path to :file:`foo.conf` is relative to the directory containing :file:`snippet.yml`. @@ -154,10 +154,10 @@ By name boards: bar: # settings for board "bar" go here append: - DTC_OVERLAY_FILE: bar.overlay + EXTRA_DTC_OVERLAY_FILE: bar.overlay baz: # settings for board "baz" go here append: - DTC_OVERLAY_FILE: baz.overlay + EXTRA_DTC_OVERLAY_FILE: baz.overlay The above example uses :file:`bar.overlay` when building for board ``bar``, and :file:`baz.overlay` when building for ``baz``. @@ -180,7 +180,7 @@ For example: boards: /my_vendor_.*/: append: - DTC_OVERLAY_FILE: my_vendor.overlay + EXTRA_DTC_OVERLAY_FILE: my_vendor.overlay The above example uses devicetree overlay :file:`my_vendor.overlay` when building for either board ``my_vendor_board1`` or ``my_vendor_board2``. It diff --git a/scripts/schemas/snippet-schema.yml b/scripts/schemas/snippet-schema.yml index d6c46d5432..64cebaedc7 100644 --- a/scripts/schemas/snippet-schema.yml +++ b/scripts/schemas/snippet-schema.yml @@ -9,9 +9,9 @@ schema;append-schema: # See uses under 'append:' keys below. type: map mapping: - DTC_OVERLAY_FILE: + EXTRA_DTC_OVERLAY_FILE: type: str - OVERLAY_CONFIG: + EXTRA_CONF_FILE: type: str type: map diff --git a/scripts/snippets.py b/scripts/snippets.py index 2158613a14..74e7ebbbfc 100644 --- a/scripts/snippets.py +++ b/scripts/snippets.py @@ -52,7 +52,7 @@ class Snippet: '''Process the data in a snippet.yml file, after it is loaded into a python object and validated by pykwalify.''' def append_value(variable, value): - if variable in ('DTC_OVERLAY_FILE', 'OVERLAY_CONFIG'): + if variable in ('EXTRA_DTC_OVERLAY_FILE', 'EXTRA_CONF_FILE'): path = pathobj.parent / value if not path.is_file(): _err(f'snippet file {pathobj}: {variable}: file not found: {path}') diff --git a/snippets/cdc-acm-console/snippet.yml b/snippets/cdc-acm-console/snippet.yml index eab58a30a4..98ff05bc14 100644 --- a/snippets/cdc-acm-console/snippet.yml +++ b/snippets/cdc-acm-console/snippet.yml @@ -1,4 +1,4 @@ name: cdc-acm-console append: - OVERLAY_CONFIG: cdc-acm-console.conf - DTC_OVERLAY_FILE: cdc-acm-console.overlay + EXTRA_CONF_FILE: cdc-acm-console.conf + EXTRA_DTC_OVERLAY_FILE: cdc-acm-console.overlay diff --git a/tests/cmake/snippets/extra_snippet_root/snippets/bar/snippet.yml b/tests/cmake/snippets/extra_snippet_root/snippets/bar/snippet.yml index 9143713377..607ad57a2c 100644 --- a/tests/cmake/snippets/extra_snippet_root/snippets/bar/snippet.yml +++ b/tests/cmake/snippets/extra_snippet_root/snippets/bar/snippet.yml @@ -1,3 +1,3 @@ name: bar append: - DTC_OVERLAY_FILE: bar.overlay + EXTRA_DTC_OVERLAY_FILE: bar.overlay diff --git a/tests/cmake/snippets/snippets/foo/snippet.yml b/tests/cmake/snippets/snippets/foo/snippet.yml index 22817d7ebf..ba39e7db10 100644 --- a/tests/cmake/snippets/snippets/foo/snippet.yml +++ b/tests/cmake/snippets/snippets/foo/snippet.yml @@ -1,3 +1,3 @@ name: foo append: - OVERLAY_CONFIG: foo.conf + EXTRA_CONF_FILE: foo.conf