1#!/usr/bin/env bash 2# 3# config: 2 30 4# @brief: Get the dump and core file information 5# 6 7# shellcheck disable=SC1091 8. "$DREPORT_INCLUDE"/functions 9 10#core files 11file_name="dumplist.log" 12desc="Dumps" 13command="busctl call --verbose --no-pager \ 14 xyz.openbmc_project.Dump.Manager \ 15 /xyz/openbmc_project/dump \ 16 org.freedesktop.DBus.ObjectManager \ 17 GetManagedObjects" 18if ! add_cmd_output "$command" "$file_name" "$desc"; 19then 20 #bmc dumps 21 dir="/var/lib/phosphor-debug-collector/dumps/" 22 desc="BMC dumps" 23 if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then 24 add_cmd_output "echo $'[$desc]'" "$file_name" "$desc" 25 add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc" 26 else 27 log_info "$desc directory is empty" 28 fi 29 30 #hardware dumps 31 dir="/var/lib/phosphor-debug-collector/hardwaredump/" 32 desc="Hardware dumps" 33 if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then 34 add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc" 35 add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc" 36 else 37 log_info "$desc directory is empty" 38 fi 39 40 41 #hostboot dumps 42 dir="/var/lib/phosphor-debug-collector/hostbootdump/" 43 desc="Hostboot dumps" 44 if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then 45 add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc" 46 add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc" 47 else 48 log_info "$desc directory is empty" 49 fi 50 51 52 #sbe dumps 53 dir="/var/lib/phosphor-debug-collector/sbedump/" 54 desc="SBE dumps" 55 if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ]; then 56 add_cmd_output "echo $'\n[$desc]'" "$file_name" "$desc" 57 add_cmd_output "ls -AX $dir/*/*" "$file_name" "$desc" 58 else 59 log_info "$desc directory is empty" 60 fi 61fi 62 63#capture core file list 64dir="/var/lib/systemd/coredump/" 65desc="core files" 66if [ -d "$dir" ] && [ -n "$(ls -A $dir/)" ] && [ -n "$(ls -A $dir/core*)" ]; then 67 add_cmd_output "echo $'[$desc]'" "$file_name" "$desc" 68 add_cmd_output "ls -AX $dir/core*" "$file_name" "$desc" 69else 70 log_info "$desc directory is empty" 71fi 72 73