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
tree: ae639afc63d970a4070505d55829c04afb369c0c
  1. dump/
  2. subprojects/
  3. watchdog/
  4. .clang-format
  5. .gitignore
  6. .shellcheck-ignore
  7. checkstop_app.cpp
  8. LICENSE
  9. meson.build
  10. meson.options
  11. OWNERS
  12. README.md
  13. watchdog_timeout.cpp
README.md

openpower-debug-collector

Building the Code

To build this package, do the following steps:

    1. meson build
    2. ninja -C build

To clean the repository run `rm -rf build`.