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>
1 file changed