IPZ VPD Parser support
This commit enables the app ibm-read-vpd to read the
IPZ format vpd. To build this app, the application
build must be configured with the "--enable-ibm-parser"
option.
The application populates the Inventory with the parsed
VPD data. The parser relies on a JSON config file
that maps the input VPD file path to the Inventory D-Bus
object that hosts the VPD data as properties.
The JSON file also supplies any additional interfaces
and properties that the D-Bus object should implement.
Argument required to run this application-
ibm-read-vpd --file vpd_file
Tested:
Also tested this on Rainier simulation model and verified that VPD
for FRUs is properly published as properties of D-Bus objects in the
Inventory.
Change-Id: Ic9305f25625adced7f64123589dd083e2679afbb
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index 05bf92e..5e6bb8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@
PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
+
# Suppress the --with-libtool-sysroot error
LT_INIT
@@ -50,6 +51,33 @@
PROPGEN="$PYTHON $srcdir/extra-properties.py -e $PROP_YAML"
AC_SUBST(PROPGEN)
+# Setup option for IBM VPD formats.
+AC_ARG_ENABLE([ibm-parser],
+ AS_HELP_STRING([--enable-ibm-parser ],
+ [Enable IBM IPZ and Keyword format VPD parser support.
+ ]))
+
+AM_CONDITIONAL([IBM_PARSER], [test "x$enable_ibm_parser" = "xyes"])
+AS_IF([test "x$enable_ibm_parser" == "xyes"], [
+# Check necessary header files
+ AC_CHECK_HEADER(
+ [CLI/CLI.hpp],
+ [],
+ [AC_MSG_ERROR([Could not find CLI11 CLI.hpp])]
+ )
+ AC_CHECK_HEADER(
+ [nlohmann/json.hpp],
+ [],
+ [AC_MSG_ERROR([Could not find nlohmann/json.hpp. Require nlohmann/json package])]
+ )
+ AX_APPEND_COMPILE_FLAGS([-DIPZ_PARSER], [CXXFLAGS])
+ AC_DEFINE(INVENTORY_JSON, "/usr/share/vpd/vpd_inventory.json", [JSON file that defines inventory blueprint])
+ ])
+
+# Check/set gtest specific functions.
+AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
+AC_SUBST(GTEST_CPPFLAGS)
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile test/Makefile])
AC_OUTPUT