dreport: Add BIOS settings data to BMC dump

Tested
Wed Apr 27 02:23:48 UTC 2022 INFO: Collected bios
sh-5.1# ls -lah bios.log
-rw-r--r--    1 root     root      260.5K Apr 27 02:23 bios.log
sh-5.1#

Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: I564f46228eeeae4ce6a7769e4cf22a593f107500
diff --git a/tools/dreport.d/plugins.d/bios b/tools/dreport.d/plugins.d/bios
new file mode 100644
index 0000000..3240249
--- /dev/null
+++ b/tools/dreport.d/plugins.d/bios
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+#
+# config: 234 20
+# @brief: Get the bios information.
+#
+
+# shellcheck disable=SC1091
+. "$DREPORT_INCLUDE"/functions
+
+file_name="bios.log"
+desc="bios"
+command="busctl call --verbose --no-pager \
+                xyz.openbmc_project.BIOSConfigManager \
+                / \
+                org.freedesktop.DBus.ObjectManager \
+                GetManagedObjects"
+
+#if busctl commands fail capture persistent data
+if ! add_cmd_output "$command" "$file_name" "$desc";
+then
+    settings_dir="/var/lib/bios-settings-manager"
+    if [ -d "$settings_dir" ]; then
+        add_copy_file "$settings_dir" "$desc"
+    fi
+fi