Skip to content

Commit

Permalink
dumpheader: Add default serial number in the header
Browse files Browse the repository at this point in the history
Whenever the serialNo is empty, use a default serial
number (all zeroes) so that scripts/apps that decode
the dump header would not throw errors.

Use fetch_serial_number() so that default serialNo
gets populated whenever the serialNo is empty.

Verified that the default serial number is utilized.

Change-Id: I0d9a8cc9e257ed0a852aaca5e6cb0c1833abd41e
Signed-off-by: Gopichand Paturi <[email protected]>
  • Loading branch information
gcpin committed Nov 9, 2024
1 parent 678cef7 commit 0a094e7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dump/tools/common/include/gendumpheader
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ declare -rx PEL_ID_PROP='PlatformLogID'
declare -x modelNo
modelNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
$INVENTORY_ASSET_INT Model | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")

#Variables
declare -x serialNo
serialNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
$INVENTORY_ASSET_INT SerialNumber | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
declare -x serialNo="0000000"

declare -x dDay
dDay=$(date -d @"$EPOCHTIME" +'%Y%m%d%H%M%S')
declare -x bmcSerialNo
bmcSerialNo=$(busctl call $INVENTORY_MANAGER $INVENTORY_BMC_BOARD \
org.freedesktop.DBus.Properties Get ss $INVENTORY_ASSET_INT \
SerialNumber | cut -d " " -f 3 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")

#Source common functions
. $DREPORT_INCLUDE/opfunctions

#Function to add NULL
function add_null() {
local a=$1
Expand Down Expand Up @@ -555,10 +558,7 @@ function plat_dump_header() {

#main function
function gen_header_package() {
if [ -z "$serialNo" ]; then
serialNo="0000000"
fi

fetch_serial_number
dump_file_entry
dump_section_entry
if [ "$dump_type" = "$OP_DUMP" ]; then
Expand Down

0 comments on commit 0a094e7

Please sign in to comment.