move service files from Yocto layer

This change relocates phosphor-debug-collector service files from
the Yocto layer to the phosphor-debug-collector repository.
It also ensures that non-user executables are installed in the libexec.

[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#incorrect-placement-of-executables-in-sbin-usrsbin-or-bin-usrbin

Tested:
```
$ find /tmp/phosphor-debug-collector | grep libexec
/tmp/phosphor-debug-collector/usr/local/libexec
/tmp/phosphor-debug-collector/usr/local/libexec/phosphor-debug-collector
/tmp/phosphor-debug-collector/usr/local/libexec/phosphor-debug-collector/phosphor-dump-manager
/tmp/phosphor-debug-collector/usr/local/libexec/phosphor-debug-collector/phosphor-dump-monitor
/tmp/phosphor-debug-collector/usr/local/libexec/phosphor-debug-collector/phosphor-ramoops-monitor
$ find /tmp/phosphor-debug-collector | grep service
/tmp/phosphor-debug-collector/usr/lib/systemd/system/obmc-dump-monitor.service
/tmp/phosphor-debug-collector/usr/lib/systemd/system/ramoops-monitor.service
/tmp/phosphor-debug-collector/usr/lib/systemd/system/xyz.openbmc_project.Dump.Manager.service
```
Booted image in qemu:
```
root@bmc:~# ls -l /usr/libexec/phosphor-debug-collector/
-rwxr-xr-x    1 root     root        367700 Mar  9  2018 phosphor-dump-manager
-rwxr-xr-x    1 root     root         34452 Mar  9  2018 phosphor-dump-monitor
-rwxr-xr-x    1 root     root         26200 Mar  9  2018 phosphor-ramoops-monitor
root@bmc:~# systemctl status xyz.openbmc_project.Dump.Manager.service
* xyz.openbmc_project.Dump.Manager.service - Phosphor Dump Manager
     Loaded: loaded (/usr/lib/systemd/system/xyz.openbmc_project.Dump.Manager.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-12-19 13:27:21 PST; 7 months 15 days ago
 Invocation: 8ff137acc50f4d8299b5d999b886896d
    Process: 374 ExecStartPre=/bin/sh -c mkdir -p /var/lib/phosphor-debug-collector/dumps (code=exited, status=0/SUCCESS)
   Main PID: 479 (phosphor-dump-m)
      Tasks: 1 (limit: 4102)
     Memory: 1.5M (peak: 16.2M)
        CPU: 1min 58.037s
     CGroup: /system.slice/xyz.openbmc_project.Dump.Manager.service
             `-479 /usr/libexec/phosphor-debug-collector/phosphor-dump-manager

Aug 05 04:33:35 bmc phosphor-dump-manager[479]: Initiating new BMC dump with type: core path: /var/lib/systemd/coredump/core.devmem.0.0b7096e8ddc54ce9a7...3000000.zst
Aug 05 04:33:40 bmc phosphor-dump-manager[2926]: cp: can't stat '/var/lib/systemd/coredump/core.devmem.0.0b7096e8ddc54ce9a7799c4d23eea94a.2881.175439361...r directory
Aug 05 04:33:58 bmc phosphor-dump-manager[2887]: Tue Aug 5 11:33:58 UTC 2025 Report is available in /var/lib/phosphor-debug-collector/dumps/6
Aug 05 04:33:59 bmc phosphor-dump-manager[2887]: Tue Aug 5 11:33:59 UTC 2025 Successfully completed
Aug 05 04:35:41 bmc phosphor-dump-manager[479]: OriginatorId is not provided
Aug 05 04:35:41 bmc phosphor-dump-manager[479]: OriginatorType is not provided. Replacing the string with the default value
Aug 05 04:35:41 bmc phosphor-dump-manager[479]: Initiating new BMC dump with type: core path: /var/lib/systemd/coredump/core.devmem.0.0b7096e8ddc54ce9a7...9000000.zst
Aug 05 04:35:46 bmc phosphor-dump-manager[3322]: cp: can't stat '/var/lib/systemd/coredump/core.devmem.0.0b7096e8ddc54ce9a7799c4d23eea94a.3278.175439373...r directory
Aug 05 04:36:10 bmc phosphor-dump-manager[3284]: Tue Aug 5 11:36:10 UTC 2025 Report is available in /var/lib/phosphor-debug-collector/dumps/7
Aug 05 04:36:11 bmc phosphor-dump-manager[3284]: Tue Aug 5 11:36:11 UTC 2025 Successfully completed
Hint: Some lines were ellipsized, use -l to show in full.
root@bmc:~# systemctl status obmc-dump-monitor.service
* obmc-dump-monitor.service - Phosphor Dump core monitor.
     Loaded: loaded (/usr/lib/systemd/system/obmc-dump-monitor.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-12-19 13:26:44 PST; 7 months 15 days ago
 Invocation: eeeb2b3224f54287995e8bd9a022d255
   Main PID: 350 (phosphor-dump-m)
      Tasks: 1 (limit: 4102)
     Memory: 276K (peak: 800K)
        CPU: 650ms
     CGroup: /system.slice/obmc-dump-monitor.service
             `-350 /usr/libexec/phosphor-debug-collector/phosphor-dump-monitor

Dec 19 13:26:44 bmc systemd[1]: Started Phosphor Dump core monitor..
root@bmc:~# systemctl status ramoops-monitor.service
* ramoops-monitor.service - Ramoops monitor.
     Loaded: loaded (/usr/lib/systemd/system/ramoops-monitor.service; enabled; preset: enabled)
     Active: inactive (dead)
  Condition: start condition unmet at Thu 2024-12-19 13:27:39 PST; 7 months 15 days ago
             `- ConditionPathExistsGlob=/var/lib/systemd/pstore/dmesg-ramoops-* was not met

Dec 19 13:27:39 bmc systemd[1]: Ramoops monitor. was skipped because of an unmet condition check (ConditionPathExistsGlob=/var/lib/systemd/pstore/dmesg-ramoops-*).
```

Change-Id: I23b67ac5651569cc2cefaa29f421bc42c3965741
Signed-off-by: William de Abreu Pinho <williamdapinho@gmail.com>
5 files changed
tree: 55436cb900a2a4aa4a0cfc3f39d57ecd110d22d1
  1. dump-extensions/
  2. host-transport-extensions/
  3. service_files/
  4. subprojects/
  5. test/
  6. tools/
  7. .clang-format
  8. .clang-tidy
  9. .gitignore
  10. .shellcheck-ignore
  11. bmc_dump_entry.cpp
  12. bmc_dump_entry.hpp
  13. core_manager.cpp
  14. core_manager.hpp
  15. core_manager_main.cpp
  16. dump-extensions.hpp
  17. dump_entry.cpp
  18. dump_entry.hpp
  19. dump_manager.cpp
  20. dump_manager.hpp
  21. dump_manager_bmc.cpp
  22. dump_manager_bmc.hpp
  23. dump_manager_faultlog.cpp
  24. dump_manager_faultlog.hpp
  25. dump_manager_main.cpp
  26. dump_offload.cpp
  27. dump_offload.hpp
  28. dump_serialize.cpp
  29. dump_serialize.hpp
  30. dump_types.cpp.mako
  31. dump_types.hpp.mako
  32. dump_utils.cpp
  33. dump_utils.hpp
  34. elog_watch.cpp
  35. elog_watch.hpp
  36. example_dump_types.yaml
  37. example_errors_watch.yaml
  38. faultlog_dump_entry.cpp
  39. faultlog_dump_entry.hpp
  40. ffdc
  41. host_transport_exts.hpp
  42. LICENSE
  43. map_gen.py
  44. meson.build
  45. meson.options
  46. OWNERS
  47. ramoops_manager.cpp
  48. ramoops_manager.hpp
  49. ramoops_manager_main.cpp
  50. README.md
  51. watch.cpp
  52. watch.hpp
README.md

phosphor-debug-collector

Phosphor Debug Collector provides mechanisms to collect various log files and system parameters. Used to troubleshoot problems in OpenBMC based systems.

One such mechanism is dreport, a script that collects debug data and packages it into an archive file.

To Build

To build this package with meson, do the following steps:

    1. meson builddir
    2. ninja -C builddir

To clean the built files run ninja -C builddir clean.

To run unit tests

Tests can be run in the CI docker container, refer local-ci-build

or with an OpenBMC x86 sdk(see below for x86 steps).

meson -Dtests=enabled build
ninja -C build test