From 5ad76de07fa46d787ddf4d9ea2012223093ea5d7 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 22 Feb 2025 21:48:57 +1000 Subject: [PATCH] secure_storage: swap `select` to `depends on` Mixing `select` and `depends on` is a common source of Kconfig dependency loops and should be avoided. Both `ZMS` and `SETTINGS` are more commonly used with `depends on` rather than `select`. The usage here also contradicts the Zephyr best practices guide for `select`: * Avoid selecting symbols with prompts or dependencies. Prefer depends on. Signed-off-by: Jordan Yates --- doc/releases/migration-guide-4.1.rst | 9 +++++++++ subsys/secure_storage/Kconfig.its_store | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/releases/migration-guide-4.1.rst b/doc/releases/migration-guide-4.1.rst index b7ae66d17a4..4207b31b21b 100644 --- a/doc/releases/migration-guide-4.1.rst +++ b/doc/releases/migration-guide-4.1.rst @@ -680,6 +680,15 @@ LoRa additional ``user_data`` parameter, which is a void pointer. This parameter can be used to reference any user-defined data structure. To maintain the current behavior, set this parameter to ``NULL``. +Secure Storage +============== + +* Store backends no longer automatically enable their dependencies through ``select`` or ``imply``. + Users must ensure that the depencies are enabled in their applications. + :kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS` previously enabled NVS + and settings, which means the NVS settings backend would get used by default if ZMS wasn't + enabled. (:github:`86181`) + Stream Flash ============ diff --git a/subsys/secure_storage/Kconfig.its_store b/subsys/secure_storage/Kconfig.its_store index 3370acdf6f4..5cf1512caf6 100644 --- a/subsys/secure_storage/Kconfig.its_store +++ b/subsys/secure_storage/Kconfig.its_store @@ -14,7 +14,7 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS depends on FLASH_HAS_DRIVER_ENABLED \ && $(dt_path_enabled,$(DT_ITS_PARTITION)) \ && $(dt_node_has_compat,$(dt_node_parent,$(DT_ITS_PARTITION)),fixed-partitions) - select ZMS + depends on ZMS help This implementation of the ITS store module makes direct use of ZMS for storage. It needs a `secure_storage_its_partition` devicetree chosen property that points @@ -31,7 +31,7 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS && $(dt_node_has_compat,$(dt_node_parent,$(DT_SETTINGS_PARTITIION)),fixed-partitions))\ || ($(dt_path_enabled,$(DT_STORAGE_PARTITION)) \ && $(dt_node_has_compat,$(dt_node_parent,$(DT_STORAGE_PARTITION)),fixed-partitions))) - select SETTINGS + depends on SETTINGS config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE bool "No ITS store module implementation"