openpower-debug-collector: Rework to use native sdk for errorlog
Fixed
1) openpower-debug-collector: Removed manual copying of error yamls files
2) openpower-debug-collector: extend recipe for native processing
3) Removed dependency on phosphor-logging-error-logs-native recipe
Resolves openbmc/openbmc#1772
Change-Id: I2c0ced34e9a684bd9df34513b4800716cf93cffb
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector-error-native.bb b/common/recipes-phosphor/debug/openpower-debug-collector-error-native.bb
deleted file mode 100644
index cb7cf84..0000000
--- a/common/recipes-phosphor/debug/openpower-debug-collector-error-native.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Copy error yaml files to known path for elog parsing"
-
-PR = "r1"
-
-inherit native
-inherit obmc-phosphor-license
-inherit phosphor-dbus-yaml
-
-require openpower-debug-collector.inc
-
-S = "${WORKDIR}/git"
-
-do_install_append() {
- SRC=${S}/org/open_power
- DEST=${yaml_dir}/org/open_power
- install -d ${DEST}
- install ${SRC}/Host.errors.yaml ${DEST}
-}
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector.bb b/common/recipes-phosphor/debug/openpower-debug-collector.bb
index 41c6e2e..be84209 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector.bb
+++ b/common/recipes-phosphor/debug/openpower-debug-collector.bb
@@ -6,7 +6,8 @@
inherit autotools \
pkgconfig \
obmc-phosphor-systemd \
- pythonnative
+ pythonnative \
+ phosphor-dbus-yaml
require ${PN}.inc
@@ -42,3 +43,29 @@
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_CHECKSTOP_FMT', 'OBMC_HOST_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'TIMEOUT_WDOG_FMT', 'OBMC_HOST_INSTANCES')}"
+
+# Do not depend on phosphor-logging for native build
+DEPENDS_remove_class-native = "phosphor-logging"
+
+# Do not depend on phosphor-logging for native SDK build
+DEPENDS_remove_class-nativesdk = "phosphor-logging"
+
+# Provide a means to enable/disable install_error_yaml feature
+PACKAGECONFIG ??= "install_error_yaml"
+PACKAGECONFIG[install_error_yaml] = " \
+ --enable-install_error_yaml, \
+ --disable-install_error_yaml, ,\
+ "
+
+# Enable install_error_yaml during native and native SDK build
+PACKAGECONFIG_add_class-native = "install_error_yaml"
+PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
+
+# Disable install_error_yaml during target build
+PACKAGECONFIG_remove_class-target = "install_error_yaml"
+
+# Disable generating elog error header file during bitbake. Applications
+# should be using the elog header generated by phosphor-logging recipe
+EXTRA_OECONF += "--disable-gen_errors"
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/common/recipes-phosphor/debug/phosphor-logging-error-logs-native.bbappend b/common/recipes-phosphor/debug/phosphor-logging-error-logs-native.bbappend
deleted file mode 100644
index b282d77..0000000
--- a/common/recipes-phosphor/debug/phosphor-logging-error-logs-native.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-DEPENDS += "openpower-debug-collector-error-native \
- openpower-dbus-interfaces-native"
diff --git a/common/recipes-phosphor/logging/phosphor-logging.bbappend b/common/recipes-phosphor/logging/phosphor-logging.bbappend
new file mode 100644
index 0000000..ec5c68f
--- /dev/null
+++ b/common/recipes-phosphor/logging/phosphor-logging.bbappend
@@ -0,0 +1,4 @@
+DEPENDS_append = " \
+ openpower-debug-collector-native \
+ openpower-dbus-interfaces-native \
+ "
diff --git a/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
index 98450a1..623e268 100644
--- a/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ b/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
@@ -1,3 +1,4 @@
RDEPENDS_${PN}_append = " \
nativesdk-openpower-dbus-interfaces-yaml \
+ nativesdk-openpower-debug-collector-yaml \
"