Collect Bad VPD as a part of BMC dump.

Collect bad VPD as a part of user intiated BMC dump.
In openpower-vpd-parser we collect IBM vpd using a feature flag "ibm-parser".
So the vpd we collect are specific to ibm-systems. Hence placing the badvpd plugin
in tools/dreport.d/ibm.d rather than in tools/dreport.d/plugins.d.

The badvpd plugin will get installed via phosphor-debug-collector recipe file from meta-ibm layer.

The symlink creation to the right type of plugin directory(say - pl_user.d/pl_elog.d/pl_checkstop.d/pl_core.d)
will also be done from the meta-ibm layer in phosphor-debug-collector recipe file.

Tested on simics:

root@rainier:~# mkdir /tmp/bad-vpd
root@rainier:~# dreport -v
Wed Mar 3 04:43:18 UTC 2021 Name:          obmcdump_00000000_1614746598.tar.xz
Wed Mar 3 04:43:18 UTC 2021 Epochtime:     1614746598
Wed Mar 3 04:43:18 UTC 2021 ID:            00000000
Wed Mar 3 04:43:18 UTC 2021 Type:          user
Wed Mar 3 04:43:18 UTC 2021 INFO: Collected disk usage
Wed Mar 3 04:43:18 UTC 2021 INFO: Collected failed services
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected Journal pretty log
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied Memory info /proc/meminfo
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected top
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied Bad VPD /tmp/bad-vpd
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied OS release info /etc/os-release
Wed Mar 3 04:43:19 UTC 2021 INFO: No elog entries
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected inventory
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied OBMC console log /var/log/obmc-console.log
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected ip addr
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected ip link
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected PRI-Flash: U-Boot environment variables
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied GUARD Records /var/lib/phosphor-software-manager/pnor/prsv/GUARD
Wed Mar 3 04:43:19 UTC 2021 ERROR: /etc/alt_fw_env.config does not exist
Wed Mar 3 04:43:19 UTC 2021 INFO: Copied CPU info /proc/cpuinfo
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected uptime
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected BMC State
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected Chassis State
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected hostnamectl
Wed Mar 3 04:43:19 UTC 2021 INFO: Collected Host State
Adding Dump Header :/usr/share/dreport.d/include.d/gendumpheader
Wed Mar 3 04:44:08 UTC 2021 Report is available in /tmp
Wed Mar 3 04:44:08 UTC 2021 Successfully completed

Check the dump tar file generated in /tmp directory.
After skipping 628 bytes of dump header in tar, untar it.
The files in /tmp/bad-vpd directory will get collected.

Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I47f6dde077f9852cc3061cc8c03819c12749337c
diff --git a/tools/dreport.d/ibm.d/badvpd b/tools/dreport.d/ibm.d/badvpd
new file mode 100644
index 0000000..6ac1093
--- /dev/null
+++ b/tools/dreport.d/ibm.d/badvpd
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# config: 2 15
+# @brief: Collect Bad VPD.
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="Bad VPD"
+dir_name="/tmp/bad-vpd"
+
+add_copy_file "$dir_name" "$desc"