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/src/entity_manager/meson.build b/src/entity_manager/meson.build
index 0ea941a..1fe9b08 100644
--- a/src/entity_manager/meson.build
+++ b/src/entity_manager/meson.build
@@ -6,6 +6,9 @@
cpp_args_em += ['-DENABLE_RUNTIME_VALIDATE_JSON=false']
endif
+allowed = get_option('new-device-detection')
+cpp_args_em += '-DEM_CACHE_CONFIGURATION=' + allowed.to_string()
+
em_deps = [boost, nlohmann_json_dep, phosphor_logging_dep, sdbusplus, valijson]
entity_manager_lib = static_library(