Skip to content

Commit cfd006c

Browse files
dumpheader: Add default serial number in the header
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]>
1 parent 4978f0a commit cfd006c

File tree

2 files changed

+1633
-3
lines changed

2 files changed

+1633
-3
lines changed

dump/tools/common/include/gendumpheader

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,19 @@ declare -rx PEL_ID_PROP='PlatformLogID'
3333
declare -x modelNo
3434
modelNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
3535
$INVENTORY_ASSET_INT Model | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
36+
3637
#Variables
37-
declare -x serialNo
38-
serialNo=$(busctl get-property $INVENTORY_MANAGER $INVENTORY_PATH \
39-
$INVENTORY_ASSET_INT SerialNumber | cut -d " " -f 2 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
38+
declare -x serialNo="0000000"
39+
4040
declare -x dDay
4141
dDay=$(date -d @"$EPOCHTIME" +'%Y%m%d%H%M%S')
4242
declare -x bmcSerialNo
4343
bmcSerialNo=$(busctl call $INVENTORY_MANAGER $INVENTORY_BMC_BOARD \
4444
org.freedesktop.DBus.Properties Get ss $INVENTORY_ASSET_INT \
4545
SerialNumber | cut -d " " -f 3 | sed "s/^\(\"\)\(.*\)\1\$/\2/g")
4646

47+
. $DREPORT_INCLUDE/opfunctions
48+
4749
#Function to add NULL
4850
function add_null() {
4951
local a=$1
@@ -555,6 +557,7 @@ function plat_dump_header() {
555557

556558
#main function
557559
function gen_header_package() {
560+
fetch_serial_number
558561
dump_file_entry
559562
dump_section_entry
560563
if [ "$dump_type" = "$OP_DUMP" ]; then

0 commit comments

Comments
 (0)