entity-manager: recursive install and fetch config
This was discussed way back in [1].
Vendor specific config directories have been introduced to better
organize configuration, but there has been a mismatch between the tree
and what's been installed on the BMC.
With this patch the configuration directory now has the same structure
as in the source tree and the runtime code is adjusted to recursively
look for configuration there.
This prevents any confusion caused by the mismatch previously and also
prevents any conflict of filenames caused by the mapping not being
injective.
Tested:
- /usr/share/entity-manager/configurations (on BMC) now has the nested
structure with directories
- EM picks up the configuration files at runtime
- Used following script to verify the file installation locally
```
rm -rf /tmp/em-install
mkdir /tmp/em-install
DESTDIR=/tmp/em-install meson install -C build
```
References:
[1] https://gerrit.openbmc.org/c/openbmc/entity-manager/+/74348
Change-Id: I55be2313af8e51a6dd69453d4ad6c9891bbfa667
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.build b/meson.build
index 9b00bf4..e7a117a 100644
--- a/meson.build
+++ b/meson.build
@@ -75,9 +75,18 @@
subdir('configurations')
filepaths = []
+package_configdir = join_paths(packagedir, 'configurations')
+fs = import('fs')
+
foreach c : configs
file = join_paths('configurations', c)
- install_data(file, install_dir: join_paths(packagedir, 'configurations'))
+ install_data(
+ file,
+ install_dir: join_paths(
+ package_configdir,
+ fs.parent(fs.relative_to(file, 'configurations')),
+ ),
+ )
filepaths += [file]
endforeach