Gopichand Paturi | 24226c4 | 2024-05-16 14:51:22 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
Gopichand Paturi | 0d72381 | 2024-10-24 04:04:07 -0500 | [diff] [blame^] | 3 | declare -rx TYPE_FAULTDATA="faultdata" |
| 4 | |
Gopichand Paturi | 24226c4 | 2024-05-16 14:51:22 -0500 | [diff] [blame] | 5 | # @brief fetch serial number |
| 6 | # @param serial number |
| 7 | function fetch_serial_number() { |
| 8 | serialNo=$(busctl get-property xyz.openbmc_project.Inventory.Manager \ |
| 9 | /xyz/openbmc_project/inventory/system xyz.openbmc_project.Inventory.Decorator.Asset \ |
| 10 | SerialNumber | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g") |
| 11 | |
| 12 | if [ -z "$serialNo" ]; then |
| 13 | serialNo="0000000" |
| 14 | fi |
| 15 | } |
| 16 | |
| 17 | # @brief Add BMC dump File Name |
| 18 | # @param BMC Dump File Name |
| 19 | function get_bmc_dump_filename() { |
| 20 | fetch_serial_number |
SwethaParasa | 9a39f43 | 2024-10-18 02:00:33 -0500 | [diff] [blame] | 21 | dump_id=$(printf %08d $dump_id) |
Gopichand Paturi | 24226c4 | 2024-05-16 14:51:22 -0500 | [diff] [blame] | 22 | if [ $dump_type = "$TYPE_FAULTDATA" ]; then |
| 23 | header_dump_name="FLTDUMP" |
| 24 | name="NAGDUMP.${serialNo}.${dump_id}.${dDay}" |
| 25 | else |
| 26 | header_dump_name="BMCDUMP" |
| 27 | name="BMCDUMP.${serialNo}.${dump_id}.${dDay}" |
| 28 | fi |
| 29 | } |