Support to build storage commands in libipmi20
Currently, the storage commands only is built in the libdynamicsensor
library. To build those commands, we have to enable dynamic-sensor
option which makes sensor commands are built too.
To allow compiling storage commands w/o sensor commands, this commit
adds 'dynamic-storages-only' option to request to build storage commands
in libipmi20 library.
Tested:
1. Disable dynamic-sensor option and enable dynamic-storages-only
option.
2. Built the openBmc image and flash to the board.
3. Request to read/write FRU device via ipmitool.
All of request work well.
4. Request to read SEL list.
Display list of SEL logs.
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: I330919e7eebbb80bf568f36ead69ade670b2f8d1
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 0a7ac1c..d12fb3b 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -861,6 +861,8 @@
// Do not register the hander if it dynamic sensors stack is used.
#ifndef FEATURE_DYNAMIC_SENSORS
+
+#ifndef FEATURE_DYNAMIC_STORAGES_ONLY
// <Get SEL Info>
ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnStorage,
ipmi::storage::cmdGetSelInfo, ipmi::Privilege::User,
@@ -905,6 +907,8 @@
ipmi::storage::cmdReadFruData,
ipmi::Privilege::Operator, ipmiStorageReadFruData);
+#endif // FEATURE_DYNAMIC_STORAGES_ONLY
+
// <Get Repository Info>
ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnStorage,
ipmi::storage::cmdGetSdrRepositoryInfo,