opdreport: Fix script errors while using fetch_serial_number function
readonly type variables are not passed to child processes/scripts,
this causes broken file paths when these variables are used in
child processes/scripts. Use declare -rx instead.
```
Verified:
Before
openpower-dump-monitor[4810]: Adding Dump Header: /usr/share/dreport.d/include.d/gendumpheader
openpower-dump-monitor[4948]: /usr/share/dreport.d/include.d/gendumpheader: line 48: /opfunctions: No such file or directory
openpower-dump-monitor[4969]: /usr/share/dreport.d/include.d/gendumpheader: line 564: fetch_serial_number: command not found
phosphor-dump-manager[5055]: performing dump compression /tmp/BMCDUMP.139F210.00000016.20250605083005
phosphor-dump-manager[520]: A new dump file found /var/lib/phosphor-debug-collector/opdump/3000000E/SYSDUMP.139F210.3000000E.20250605083051
After
openpower-dump-monitor[1238]: Adding Dump Header: /usr/share/dreport.d/include.d/gendumpheader
phosphor-dump-manager[526]: A new dump file found /var/lib/phosphor-debug-collector/opdump/30000012/SYSDUMP.139F210.30000012.20250605093640
```
Change-Id: I0544efd674d4abdefe43a36a46c76d0f31fb0f8b
Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com>
diff --git a/dump/tools/opdump/opdreport b/dump/tools/opdump/opdreport
index 92a7ce9..7439709 100644
--- a/dump/tools/opdump/opdreport
+++ b/dump/tools/opdump/opdreport
@@ -35,13 +35,13 @@
)
# Constants
+declare -rx DREPORT_SOURCE="/usr/share/dreport.d"
+declare -rx DREPORT_INCLUDE="$DREPORT_SOURCE/include.d"
readonly OP_DUMP="opdump"
-readonly DREPORT_SOURCE="/usr/share/dreport.d"
readonly TRUE=1
readonly FALSE=0
readonly TIME_STAMP="date -u"
readonly UNLIMITED="unlimited"
-readonly DREPORT_INCLUDE="$DREPORT_SOURCE/include.d"
readonly INVENTORY_MANAGER='xyz.openbmc_project.Inventory.Manager'
readonly INVENTORY_PATH='/xyz/openbmc_project/inventory/system'
readonly INVENTORY_ASSET_INT='xyz.openbmc_project.Inventory.Decorator.Asset'