entity-manager: Add meson option to cache config
For the development use-case configuration is often changed and the
general expectation is for a service to re-parse it's configuration when
it is restarted.
Add a meson option which controls if the configuration (usually in
/var/configuration/system.json) is cached there, or not cached at all.
The new meson option is 'new-device-detection' and by
default it is true, so there is no behavior change when it is not
configured.
Tested: on Tyan S5549 board.
The configuration is cached when the option is left as default and the
configuration is not written to cache when it is set to false.
```
Jan 21 15:50:22 s5549-bmc-a0423f63b4a5 systemd[1]: Starting Entity Manager...
Jan 21 15:50:22 s5549-bmc-a0423f63b4a5 systemd[1]: Started Entity Manager.
Jan 21 15:50:35 s5549-bmc-a0423f63b4a5 entity-manager[32126]: Inventory Added: Supermicro PWS 920P SQ 1
Jan 21 15:50:35 s5549-bmc-a0423f63b4a5 entity-manager[32126]: Inventory Added: MBX 1.60 Chassis
Jan 21 15:50:35 s5549-bmc-a0423f63b4a5 entity-manager[32126]: Inventory Added: Tyan S5549 Baseboard
```
The cache directory now only contains the 'version' file which is
separate from the caching concern, and not affected by this patch.
```
ls -l /var/configuration/
-rw-r--r-- 1 root root 10 Jan 16 11:50 version
```
Change-Id: I584d87c549d3115da04b464702c7fda8ee7720ed
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.options b/meson.options
index d53e7d6..8cdd903 100644
--- a/meson.options
+++ b/meson.options
@@ -47,3 +47,9 @@
value: true,
description: 'Build gpio presence daemon',
)
+option(
+ 'new-device-detection',
+ type: 'boolean',
+ value: true,
+ description: 'Cache the current configuration to support new-device detection. This option can be set to false for development, which will force re-parsing of configuration.',
+)