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>
diff --git a/dbus-sdr/meson.build b/dbus-sdr/meson.build
index a0363ec..2afb8a6 100644
--- a/dbus-sdr/meson.build
+++ b/dbus-sdr/meson.build
@@ -17,6 +17,11 @@
]
endif
+sensorsoem_src = []
+if not get_option('sensors-oem').disabled()
+ sensorsoem_src = ['dbus-sdr/sensorcommands_oem.cpp']
+endif
+
dbus_sdr_pre = declare_dependency(
include_directories: root_inc,
dependencies: [
@@ -32,4 +37,5 @@
'dbus-sdr/sensorcommands.cpp',
'dbus-sdr/storagecommands.cpp',
hybrid_src,
+ sensorsoem_src,
]