Faultlog: Add support to install Faultlog

Add faultlog to bmcdump plugins and include faultlog in dreport_op.conf
which shall install the plugin from meta-ibm layer in openbmc repo
and creates sym-link.

Test Results:
Verified that openpower-debug-collector recipe installs faultlog script

sysroot-destdir$ ls usr/share/dreport.d/pl_faultdata.d
E10faultlog

Change-Id: I46ece91a04d4d40a3bd72771d6fea11468e5e403
Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com>
diff --git a/.shellcheck-ignore b/.shellcheck-ignore
index cba21bd..5ecff7a 100644
--- a/.shellcheck-ignore
+++ b/.shellcheck-ignore
@@ -7,6 +7,7 @@
 dump/tools/bmcdump/plugins/pels
 dump/tools/bmcdump/plugins/phal_devtree
 dump/tools/bmcdump/plugins/vpd_data
+dump/tools/bmcdump/plugins/faultlog
 dump/tools/bmcdump/scripts/package
 dump/tools/common/include/gendumpheader
 dump/tools/common/include/gendumpinfo
diff --git a/dump/tools/bmcdump/dreport_op.conf b/dump/tools/bmcdump/dreport_op.conf
index 9490d05..2dc4062 100644
--- a/dump/tools/bmcdump/dreport_op.conf
+++ b/dump/tools/bmcdump/dreport_op.conf
@@ -10,3 +10,4 @@
 3: elog
 4: checkstop
 5: ramoops
+6: faultdata
diff --git a/dump/tools/bmcdump/plugins/faultlog b/dump/tools/bmcdump/plugins/faultlog
new file mode 100644
index 0000000..20dfae8
--- /dev/null
+++ b/dump/tools/bmcdump/plugins/faultlog
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# config: 6 10
+# @brief: Collect faultlog command output.
+#
+
+. $DREPORT_INCLUDE/functions
+export PDBG_DTB=/var/lib/phosphor-software-manager/hostfw/running/DEVTREE
+
+desc="faultlog"
+file_name="faultlog.json"
+command="faultlog -f"
+
+add_cmd_output "$command" "$file_name" "$desc"
diff --git a/dump/tools/bmcdump/plugins/meson.build b/dump/tools/bmcdump/plugins/meson.build
index 1985f44..56ba0cc 100644
--- a/dump/tools/bmcdump/plugins/meson.build
+++ b/dump/tools/bmcdump/plugins/meson.build
@@ -9,3 +9,4 @@
 plugins_to_install += meson.current_source_dir() / 'pels'
 plugins_to_install += meson.current_source_dir() / 'phal_devtree'
 plugins_to_install += meson.current_source_dir() / 'vpd_data'
+plugins_to_install += meson.current_source_dir() / 'faultlog'
diff --git a/dump/tools/common/include/opfunctions b/dump/tools/common/include/opfunctions
index 444fe7c..5b6acda 100644
--- a/dump/tools/common/include/opfunctions
+++ b/dump/tools/common/include/opfunctions
@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+declare -rx TYPE_FAULTDATA="faultdata"
+
 # @brief fetch serial number
 # @param serial number
 function fetch_serial_number() {