diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2017-10-04 23:38:33 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-10-24 16:40:31 +0300 |
commit | 8c6516fe45ecbdc89c4031cef703ae6014bfdf20 (patch) | |
tree | 9c27b86f57cf138829cb7a95d89d9f1f8c1983b4 /meta-phosphor/common | |
parent | 6fb21ca719c5d319fefe8601b04360c00465ee90 (diff) | |
download | openbmc-8c6516fe45ecbdc89c4031cef703ae6014bfdf20.tar.xz |
phosphor-settings-read-settings-mrw recipe
phosphor-settings-read-settings-mrw recipe calls gen_settings.pl
to replace any MRW variables in mrw-override-settings.yaml with
their MRW value.
The file generated by gen_settings.pl, mrw-settings.override.yaml,
is then used as an override of phosphor-settings.
mrw-override-settings.yaml by default is empty so no settings are
actually overwritten. A later commit will modify
mrw-override-settings.yaml in the Witherspoon layer.
Change-Id: I3134dbb834ff52abe5be589dd1d88444b8577254
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common')
3 files changed, 41 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb index 10938c9e6..3d4335ddd 100644 --- a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-manager.bb @@ -16,6 +16,7 @@ DEPENDS += "python-pyyaml-native" DEPENDS += "python-mako-native" DEPENDS += "autoconf-archive-native" DEPENDS += "virtual/phosphor-settings-defaults" +DEPENDS += "${@cf_enabled(d, 'obmc-mrw', 'phosphor-settings-read-settings-mrw')}" DEPENDS += "sdbusplus sdbusplus-native" DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" DEPENDS += "phosphor-logging" @@ -46,6 +47,10 @@ python do_merge_settings () { cmd = [] cmd.append(os.path.join(workdir, 'merge_settings.py')) cmd.append(os.path.join(settingsdir, 'defaults.yaml')) + # Used for any settings from the MRW + use_mrw = cf_enabled(d, 'obmc-mrw', 'true') + if (use_mrw == 'true'): + cmd.append(os.path.join(settingsdir, 'mrw-settings.override.yaml')) fetch = bb.fetch2.Fetch([], d) override_urls = [url for url in fetch.urls if url.endswith('.override.yml')] diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw.bb b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw.bb new file mode 100644 index 000000000..7260434d3 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw.bb @@ -0,0 +1,33 @@ +# Generates MRW settings override yaml for phosphor-settings-manager +# The default YAML file, mrw-override-settings.yaml, is empty, therefore no +# settings will be overwritten. To override, modify mrw-override-settings.yaml. + +SUMMARY = "Generates MRW settings override YAML for phosphor-settings-manager." +PR = "r1" + +inherit native +inherit phosphor-settings-manager + +inherit obmc-phosphor-license + +DEPENDS += "mrw-native mrw-perl-tools-native" + +SRC_URI += "file://mrw-override-settings.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${config_datadir} + install -D mrw-override-settings.yaml ${DEST}/mrw-override-settings.yaml + + SETTINGS=${D}${settings_datadir} + install -d ${SETTINGS} + + # gen_settings.pl replaces any MRW variables with their value + ${bindir}/perl-native/perl \ + ${bindir}/gen_settings.pl \ + -i ${datadir}/obmc-mrw/${MACHINE}.xml \ + -s ${DEST}/mrw-override-settings.yaml \ + -o ${SETTINGS}/mrw-settings.override.yaml \ + -f +} diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml new file mode 100644 index 000000000..c0fbedecc --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml @@ -0,0 +1,3 @@ +# Default MRW settings override definition YAML - empty. +# Any MRW variables, marked by MRW_<MRW variable name>, are replaced with their +# MRW value. |