dreport: Added fwprintenv plugin
Plugin used for collecting primary flash U-boot
environment variables.
Resolves partially openbmc/openbmc#2862
Change-Id: I9cffd936575311a39d8006b84a612f0223158fbb
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/tools/dreport.d/plugins.d/fwprintenv b/tools/dreport.d/plugins.d/fwprintenv
new file mode 100644
index 0000000..2945324
--- /dev/null
+++ b/tools/dreport.d/plugins.d/fwprintenv
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# config: 2 40
+# @brief: Print variables from primary flash U-Boot environment.
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="PRI-Flash: U-Boot environment variables"
+env_config="/etc/fw_env.config"
+
+if [ ! -f $env_config ]; then
+ log_error "$env_config does not exist"
+ exit
+fi
+
+
+file_name="fw-printenv.log"
+command="fw_printenv -c $env_config"
+
+add_cmd_output "$command" "$file_name" "$desc"