Enable OEM creation of non-Type1 SDRs

Enabling the dbus-sdrs feature is useful for managing Type 1 SDR's
using D-Bus. What doesn't work quite as well in the model is creating
non-Type 1 records. The current method works alright for Type 11 FRU
records. Any other SDR's beyond the FRU are problematic because the
code depends on manually defining custom 'if' clauses to compare the
incoming SDR ID, and determining what kind of SDR to create. It is a
fixed process that is inflexible, and assumes every BMC vendor wants
the same SDR arrangement.

This commit creates a model that allows the each OEM to customize
creating each SDR using their own algorithm. The OEM creates a
sensorcommands_oem.cpp/hpp file containing code for handling the
creation of custom SDRs. The code here is compiled and linked based on
enabling a Meson build switch.

The code follows the model that was already present in
dbus-sdr/sensorcommands.cpp. There are two functions that maintain the
original inflexible code, which is now expected to be primarily used
as a template for the OEM cpp/hpp contents.

Tested:
Created sensorcommands_oem.cpp/hpp files with OEM functionality
Enabled the original code, and compiled
Used ipmitool sdr dump sdrs.bin in the BMC Console
Confirmed the SDRs matched the values prior to this commit.
Enabled the OEM code and compiled
Used ipmitool sdr dump sdrs.bin in the BMC console
Confirmed the contents of the BIN file contained the SDRs generated by
the sensorcommands_oem.cpp source.

Change-Id: I100e747b52677be53b499713d51c6c1126411570
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
4 files changed
tree: 133cacbc45f683b65f4f5f0437d538e97ae03661
  1. app/
  2. dbus-sdr/
  3. docs/
  4. include/
  5. libipmid/
  6. scripts/
  7. softoff/
  8. subprojects/
  9. test/
  10. user_channel/
  11. xyz/
  12. .build.sh
  13. .clang-format
  14. .gitignore
  15. .shellcheck
  16. .travis.yml
  17. apphandler.cpp
  18. apphandler.hpp
  19. chassishandler.cpp
  20. chassishandler.hpp
  21. dcmihandler.cpp
  22. dcmihandler.hpp
  23. error-HostEvent.hpp
  24. fruread.hpp
  25. generate_whitelist.sh
  26. generate_whitelist_create.sh
  27. globalhandler.cpp
  28. globalhandler.hpp
  29. groupext.cpp
  30. host-cmd-manager.cpp
  31. host-cmd-manager.hpp
  32. host-interface.cpp
  33. host-interface.hpp
  34. host-ipmid-whitelist.conf
  35. ipmi_fru_info_area.cpp
  36. ipmi_fru_info_area.hpp
  37. ipmiallowlist.hpp
  38. ipmid-new.cpp
  39. ipmisensor.cpp
  40. LICENSE
  41. meson.build
  42. meson.options
  43. OWNERS
  44. read_fru_data.cpp
  45. read_fru_data.hpp
  46. README.md
  47. selutility.cpp
  48. selutility.hpp
  49. sensordatahandler.cpp
  50. sensordatahandler.hpp
  51. sensorhandler.cpp
  52. sensorhandler.hpp
  53. settings.cpp
  54. settings.hpp
  55. storageaddsel.cpp
  56. storageaddsel.hpp
  57. storagehandler.cpp
  58. storagehandler.hpp
  59. sys_info_param.cpp
  60. sys_info_param.hpp
  61. systemintfcmds.cpp
  62. systemintfcmds.hpp
  63. transportconstants.hpp
  64. transporthandler.cpp
  65. transporthandler.hpp
  66. whitelist-filter.cpp
README.md

Compile ipmid with default options:

meson builddir
ninja -C builddir

Compile ipmid with yocto defaults:

meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in ipmid/subprojects.

Enable/Disable meson wrap feature

meson builddir -Dwrap_mode=nofallback
ninja -C builddir

Enable debug traces

meson builddir -Dbuildtype=debug
ninja -C builddir

Generate test coverage report:

meson builddir -Db_coverage=true -Dtests=enabled
ninja -C builddir test
ninja -C builddir coverage