Dreport: Add Mount Information File Collection

Add functionality to collect system mount information as part of the
debug data collection process. The mount info file contains details
about all mounted filesystems including mount points, filesystem
types, and mount options.

Including mount information in debug reports will help with
troubleshooting filesystem and storage related issues in OpenBMC
based systems by providing a snapshot of the system's mount
configuration at the time of report generation.

Tested on the qemuarm platform.

'''
busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/bmc xyz.openbmc_project.Dump.Create CreateDump a{sv} 1 "i" i 1234

root@qemuarm:~# journalctl -f -u  xyz.openbmc_project.Dump.Manager.service
...
Mar 20 07:22:10 qemuarm phosphor-dump-manager[367]: Thu Mar 20 07:22:10 UTC 2025 Report is available in /var/lib/phosphor-debug-collector/dumps/1
Mar 20 07:22:10 qemuarm phosphor-dump-manager[367]: Thu Mar 20 07:22:10 UTC 2025 Successfully completed
Mar 20 07:22:10 qemuarm phosphor-dump-manager[223]: User initiated dump completed, resetting flag

root@qemuarm:~# ls /var/lib/phosphor-debug-collector/dumps/1/obmcdump_1_1742479997.tar.xz
/var/lib/phosphor-debug-collector/dumps/1/obmcdump_1_1742479997.tar.xz

tar -xvf obmcdump_1_1742479997.tar.xz
obmcdump_1_1742479997/
obmcdump_1_1742479997/summary.log
...
obmcdump_1_1742479997/mountinfo.log
...

cat obmcdump_1_1742479997/mountinfo.log
/dev/vda on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=118004k,nr_inodes=29501,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=47612k,nr_inodes=819200,mode=755)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=119032k,nr_inodes=1048576)
tmpfs on /run/credentials/systemd-journald.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,noswap)
tmpfs on /run/credentials/systemd-resolved.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,noswap)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /run/credentials/systemd-networkd.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,noswap)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/credentials/getty@tty1.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,noswap)
'''

Change-Id: I4e8fc3c8ba5a8ec40ec91256e0a2e7390e915be9
Signed-off-by: Deepak Kamat <dkamat@nvidia.com>
diff --git a/tools/dreport.d/plugins.d/mountinfo b/tools/dreport.d/plugins.d/mountinfo
new file mode 100644
index 0000000..88b0c8e
--- /dev/null
+++ b/tools/dreport.d/plugins.d/mountinfo
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# config: 2 30
+# @brief: Collect mount information.
+#
+
+# shellcheck source=/dev/null
+. "$DREPORT_INCLUDE"/functions
+
+desc="mount info"
+file_name="mountinfo.log"
+command="mount"
+
+add_cmd_output "$command" "$file_name" "$desc"
\ No newline at end of file