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>
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 0000000..7260434
--- /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
+}