xref: /openbmc/openpower-debug-collector/dump/tools/bmcdump/plugins/guardlist (revision 24226c4f3fbd0c0b3aa4319527ffc1f88ce7dc43)
1*24226c4fSGopichand Paturi#!/bin/bash
2*24226c4fSGopichand Paturi#
3*24226c4fSGopichand Paturi# config: 234 40
4*24226c4fSGopichand Paturi# @brief: Collect GUARD record information.
5*24226c4fSGopichand Paturi#
6*24226c4fSGopichand Paturi
7*24226c4fSGopichand Paturi# shellcheck disable=SC1091
8*24226c4fSGopichand Paturi. "$DREPORT_INCLUDE"/functions
9*24226c4fSGopichand Paturi
10*24226c4fSGopichand Paturidesc="GUARD Records"
11*24226c4fSGopichand Paturisource /etc/profile.d/power-target.sh
12*24226c4fSGopichand Paturi
13*24226c4fSGopichand Paturiguard_part_file="/var/lib/phosphor-software-manager/hostfw/running/GUARD"
14*24226c4fSGopichand Paturi
15*24226c4fSGopichand Paturi# Check file is present and not empty.
16*24226c4fSGopichand Paturiif [ -e "$guard_part_file" ]; then
17*24226c4fSGopichand Paturi    add_copy_file "$guard_part_file" "$desc"
18*24226c4fSGopichand Paturifi
19*24226c4fSGopichand Paturi
20*24226c4fSGopichand Paturi# collect guarded list
21*24226c4fSGopichand Paturiguard_log_file=guard.log
22*24226c4fSGopichand Paturiif [ -e "/usr/bin/guard" ]; then
23*24226c4fSGopichand Paturi    desc="Guard list"
24*24226c4fSGopichand Paturi    add_cmd_output "echo $'[$desc]'" "$guard_log_file" "$desc"
25*24226c4fSGopichand Paturi    add_cmd_output "/usr/bin/guard -l" "$guard_log_file" "$desc"
26*24226c4fSGopichand Paturi
27*24226c4fSGopichand Paturi    desc="Guard resolved records"
28*24226c4fSGopichand Paturi    add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc"
29*24226c4fSGopichand Paturi    add_cmd_output "/usr/bin/guard -a" "$guard_log_file" "$desc"
30*24226c4fSGopichand Paturi
31*24226c4fSGopichand Paturi    desc="Guard ephemeral records"
32*24226c4fSGopichand Paturi    add_cmd_output "echo $'\n[$desc]'" "$guard_log_file" "$desc"
33*24226c4fSGopichand Paturi    add_cmd_output "/usr/bin/guard -e" "$guard_log_file" "$desc"
34*24226c4fSGopichand Paturifi
35