diff --git a/Makefile b/Makefile index 66f04e4..86160fb 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ SOURCE_APOLLO_SM_PYBIND = python/ApolloSM_PyBind.cpp LIBRARY_APOLLO_SM_PYBIND = lib/ApolloSM$(shell python3-config --extension-suffix) PYBIND11_PATH=pybind11 # The directory where the Python3 ApolloSM library will be copied to -PYTHON3_INSTALL_PATH=/usr/local/lib64/python3.6/site-packages/ +PYTHON3_INSTALL_PATH ?= $(shell python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") INCLUDE_PATH += \ -Iinclude \ @@ -170,13 +170,17 @@ ${LIBRARY_APOLLO_SM_PYBIND}: ${LIBRARY_APOLLO_SM} # install # ----------------------- install: all - install -m 775 -d ${INSTALL_PATH}/lib - install -b -m 775 ./lib/* ${INSTALL_PATH}/lib - install -m 775 -d ${INSTALL_PATH}/bin - install -b -m 775 ./bin/* ${INSTALL_PATH}/bin - install -m 775 -d ${INSTALL_PATH}/include - cp -r include/* ${INSTALL_PATH}/include - cp lib/ApolloSM*.so ${PYTHON3_INSTALL_PATH} + install -m 775 -d ${INSTALL_PATH}/lib + @echo "Installing lib/* to ${INSTALL_PATH}/lib" + install -b -m 775 ./lib/* ${INSTALL_PATH}/lib + install -m 775 -d ${INSTALL_PATH}/bin + @echo "Installing bin/* to ${INSTALL_PATH}/bin" + install -b -m 775 ./bin/* ${INSTALL_PATH}/bin + install -m 775 -d ${INSTALL_PATH}/include + @echo "Installing include/* to ${INSTALL_PATH}/include" + cp -r include/* ${INSTALL_PATH}/include + @echo "Installing lib/ApolloSM*.so to ${PYTHON3_INSTALL_PATH}" + cp lib/ApolloSM*.so ${PYTHON3_INSTALL_PATH} diff --git a/include/ApolloSM/ApolloSM.hh b/include/ApolloSM/ApolloSM.hh index dd96fe4..4c49402 100644 --- a/include/ApolloSM/ApolloSM.hh +++ b/include/ApolloSM/ApolloSM.hh @@ -45,8 +45,8 @@ public: int GetSerialNumber(); int GetRevNumber(); - int GetShelfID(); int GetSlot(); + std::string GetShelfID(); uint32_t GetZynqIP(); uint32_t GetIPMCIP(); diff --git a/src/ApolloSM/ApolloSM_info.cc b/src/ApolloSM/ApolloSM_info.cc index 52395d1..5b03fc1 100644 --- a/src/ApolloSM/ApolloSM_info.cc +++ b/src/ApolloSM/ApolloSM_info.cc @@ -20,12 +20,12 @@ int ApolloSM::GetRevNumber(){ } return ret; }; -int ApolloSM::GetShelfID(){ - int ret = -1; //default value +std::string ApolloSM::GetShelfID(){ + std::string ret = ""; //default value try{ - ret = ReadRegister("SLAVE_I2C.S1.SM.INFO.SLOT"); + ret = ReadString("SLAVE_I2C.S6.SHELF_ID"); }catch(BUException::BAD_REG_NAME & e2){ - //eat this exception and just return -1; + //eat this exception and just return an empty string } return ret; }; diff --git a/src/standalone/SM_boot.cxx b/src/standalone/SM_boot.cxx index 70acc15..fbdaeff 100644 --- a/src/standalone/SM_boot.cxx +++ b/src/standalone/SM_boot.cxx @@ -32,7 +32,7 @@ #define DEFAULT_CONFIG_FILE "/etc/SM_boot" #define DEFAULT_POLLTIME_IN_SECONDS 10 #define DEFAULT_CONN_FILE "/fw/SM/address_table/connections.xml" -#define DEFAULT_RUN_DIR "/opt/address_table/" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_FILE "/var/run/sm_boot.pid" #define DEFAULT_POWERUP_TIME 5 #define DEFAULT_SENSORS_THROUGH_ZYNQ false // This means: by default, read the sensors through the zynq diff --git a/src/standalone/heartbeat.cxx b/src/standalone/heartbeat.cxx index aca53d4..4bc73a5 100644 --- a/src/standalone/heartbeat.cxx +++ b/src/standalone/heartbeat.cxx @@ -29,7 +29,7 @@ #define DEFAULT_CONFIG_FILE "/etc/heartbeat" #define DEFAULT_POLLTIME_IN_SECONDS 10 -#define DEFAULT_RUN_DIR "/opt/address_table/" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_FILE "/var/run/heartbeat.pid" #define DEFAULT_CONN_FILE "/fw/SM/address_table/connections.xml" diff --git a/src/standalone/i2c_write_monitor.cxx b/src/standalone/i2c_write_monitor.cxx index 7aba2c3..48c77dc 100644 --- a/src/standalone/i2c_write_monitor.cxx +++ b/src/standalone/i2c_write_monitor.cxx @@ -32,7 +32,7 @@ #define DEFAULT_POLLTIME_IN_SECONDS 1 #define DEFAULT_TIMEOUT_IN_SECONDS 60 #define DEFAULT_CONN_FILE "/fw/SM/address_table/connections.xml" -#define DEFAULT_RUN_DIR "/opt/address_table/" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_FILE "/var/run/i2c_write_monitor.pid" // Register name to read for the I2C write check diff --git a/src/standalone/ps_monitor.cxx b/src/standalone/ps_monitor.cxx index b8e9061..15bdbda 100644 --- a/src/standalone/ps_monitor.cxx +++ b/src/standalone/ps_monitor.cxx @@ -40,7 +40,7 @@ #define DEFAULT_CONFIG_FILE "/etc/ps_monitor" #define DEFAULT_POLLTIME_IN_SECONDS 10 -#define DEFAULT_RUN_DIR "/opt/address_table" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_FILE "/var/run/ps_monitor.pid" #define DEFAULT_CONN_FILE "/fw/SM/address_table/connections.xml" diff --git a/src/standalone/pwr_monitor.cxx b/src/standalone/pwr_monitor.cxx index 6951af4..bdda160 100644 --- a/src/standalone/pwr_monitor.cxx +++ b/src/standalone/pwr_monitor.cxx @@ -120,7 +120,7 @@ void UpdateINA3221Sensor(ApolloSM * sm, #define DEFAULT_CONFIG_FILE "/etc/pwr_monitor" #define DEFAULT_POLLTIME_IN_SECONDS 10 -#define DEFAULT_RUN_DIR "/opt/address_table" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_FILE "/var/run/pwr_monitor.pid" #define DEFAULT_CONN_FILE "/fw/SM/address_table/connections.xml" diff --git a/src/standalone/xvc_server.cxx b/src/standalone/xvc_server.cxx index c64831c..ddc30df 100644 --- a/src/standalone/xvc_server.cxx +++ b/src/standalone/xvc_server.cxx @@ -48,7 +48,7 @@ // ================================================================================ // Setup for boost program_options #define DEFAULT_CONFIG_FILE "/etc/xvc_server" -#define DEFAULT_RUN_DIR "/opt/address_table/" +#define DEFAULT_RUN_DIR "/fw/SM/address_table" #define DEFAULT_PID_DIR "/var/run/" #define DEFAULT_XVCPREFIX " " #define DEFAULT_XVCPORT -1