diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index fd65763bf1..b768a3c17e 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -84,7 +84,7 @@ RUN apt-get purge -y \ /python-wheels \ ~/.cache -COPY ["docker_init.sh", "lm-sensors.sh", "start.sh", "/usr/bin/"] +COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"] COPY ["docker-pmon.supervisord.conf.j2", "/usr/share/sonic/templates/"] COPY ["ssd_tools/*", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 929fa751b2..7f816d3339 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -27,17 +27,6 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -[program:start] -command=/usr/bin/start.sh -priority=2 -autostart=false -autorestart=false -stdout_logfile=syslog -stderr_logfile=syslog -startsecs=0 -dependent_startup=true -dependent_startup_wait_for=rsyslogd:running - {% if not skip_chassisd and IS_MODULAR_CHASSIS == 1 %} [program:chassisd] command=/usr/local/bin/chassisd @@ -61,7 +50,7 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=0 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_fancontrol and HAVE_FANCONTROL_CONF == 1 %} @@ -74,7 +63,7 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_ledd %} @@ -87,15 +76,15 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=0 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_xcvrd %} [program:xcvrd] {% if delay_xcvrd %} -command=bash -c "sleep 30 && /usr/local/bin/xcvrd" +command=bash -c "sleep 30 && {% if API_VERSION == 3 and 'xcvrd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/xcvrd" {% else %} -command=/usr/local/bin/xcvrd +command={% if API_VERSION == 3 and 'xcvrd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/xcvrd {% endif %} priority=6 autostart=false @@ -104,12 +93,12 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=0 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_psud %} [program:psud] -command=/usr/local/bin/psud +command={% if API_VERSION == 3 and 'psud' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/psud priority=7 autostart=false autorestart=false @@ -117,12 +106,12 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=0 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_syseepromd %} [program:syseepromd] -command=/usr/local/bin/syseepromd +command={% if API_VERSION == 3 and 'syseepromd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd priority=8 autostart=false autorestart=unexpected @@ -130,12 +119,12 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_thermalctld %} [program:thermalctld] -command=/usr/local/bin/thermalctld +command={% if API_VERSION == 3 and 'thermalctld' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/thermalctld priority=9 autostart=false autorestart=unexpected @@ -144,7 +133,7 @@ stderr_logfile=syslog startsecs=10 startretries=50 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} {% if not skip_pcied %} @@ -157,5 +146,5 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=start:exited +dependent_startup_wait_for=rsyslogd:running {% endif %} diff --git a/dockers/docker-platform-monitor/docker_init.sh b/dockers/docker-platform-monitor/docker_init.sh index d073dd223c..6fc7ffeb51 100755 --- a/dockers/docker-platform-monitor/docker_init.sh +++ b/dockers/docker-platform-monitor/docker_init.sh @@ -5,45 +5,102 @@ mkdir -p /etc/supervisor/conf.d/ SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" + +SUPERVISOR_CONF_TEMPLATE="/usr/share/sonic/templates/docker-pmon.supervisord.conf.j2" +SUPERVISOR_CONF_FILE="/etc/supervisor/conf.d/supervisord.conf" +PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/platform/pmon_daemon_control.json" MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf" HAVE_SENSORS_CONF=0 HAVE_FANCONTROL_CONF=0 IS_MODULAR_CHASSIS=0 +# Default use python2 version +SONIC_PLATFORM_API_PYTHON_VERSION=2 + +declare -r EXIT_SUCCESS="0" + +if [ "${RUNTIME_OWNER}" == "" ]; then + RUNTIME_OWNER="kube" +fi + +CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py" +if test -f ${CTR_SCRIPT} +then + ${CTR_SCRIPT} -f pmon -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} +fi + +mkdir -p /var/sonic +echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +# If this platform has synchronization script, run it +if [ -e /usr/share/sonic/platform/platform_wait ]; then + /usr/share/sonic/platform/platform_wait + EXIT_CODE="$?" + if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then + exit "${EXIT_CODE}" + fi +fi + +# If the Python 2 sonic-platform package is not installed, try to install it +python2 -c "import sonic_platform" > /dev/null 2>&1 || pip2 show sonic-platform > /dev/null 2>&1 +if [ $? -ne 0 ]; then + SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py2-none-any.whl" + echo "sonic-platform package not installed, attempting to install..." + if [ -e ${SONIC_PLATFORM_WHEEL} ]; then + pip2 install ${SONIC_PLATFORM_WHEEL} + if [ $? -eq 0 ]; then + echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" + else + echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" + fi + else + echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" + fi +fi + +# If the Python 3 sonic-platform package is not installed, try to install it +python3 -c "import sonic_platform" > /dev/null 2>&1 || pip3 show sonic-platform > /dev/null 2>&1 +if [ $? -ne 0 ]; then + SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py3-none-any.whl" + echo "sonic-platform package not installed, attempting to install..." + if [ -e ${SONIC_PLATFORM_WHEEL} ]; then + pip3 install ${SONIC_PLATFORM_WHEEL} + if [ $? -eq 0 ]; then + echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" + SONIC_PLATFORM_API_PYTHON_VERSION=3 + else + echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" + fi + else + echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" + fi +else + SONIC_PLATFORM_API_PYTHON_VERSION=3 +fi if [ -e $SENSORS_CONF_FILE ]; then HAVE_SENSORS_CONF=1 + mkdir -p /etc/sensors.d + /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/ fi if [ -e $FANCONTROL_CONF_FILE ]; then HAVE_FANCONTROL_CONF=1 + rm -f /var/run/fancontrol.pid + /bin/cp -f $FANCONTROL_CONF_FILE /etc/ fi if [ -e $MODULAR_CHASSISDB_CONF_FILE ]; then IS_MODULAR_CHASSIS=1 fi -confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF, \"IS_MODULAR_CHASSIS\":$IS_MODULAR_CHASSIS}" +confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF, \"API_VERSION\":$SONIC_PLATFORM_API_PYTHON_VERSION, \"IS_MODULAR_CHASSIS\":$IS_MODULAR_CHASSIS}" -if [ -e /usr/share/sonic/platform/pmon_daemon_control.json ]; +if [ -e $PMON_DAEMON_CONTROL_FILE ]; then - sonic-cfggen -j /usr/share/sonic/platform/pmon_daemon_control.json -a "$confvar" -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf + sonic-cfggen -j $PMON_DAEMON_CONTROL_FILE -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE else - sonic-cfggen -a "$confvar" -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf -fi - -# If this platform has an lm-sensors config file, copy it to its proper place -if [ $HAVE_SENSORS_CONF -eq 1 ]; then - mkdir -p /etc/sensors.d - /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/ -fi - -# If this platform has a fancontrol config file, copy it to its proper place -if [ $HAVE_FANCONTROL_CONF -eq 1 ]; then - # Remove stale pid file if it exists - rm -f /var/run/fancontrol.pid - - /bin/cp -f $FANCONTROL_CONF_FILE /etc/ + sonic-cfggen -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE fi exec /usr/local/bin/supervisord diff --git a/dockers/docker-platform-monitor/start.sh b/dockers/docker-platform-monitor/start.sh deleted file mode 100755 index 98aa974e13..0000000000 --- a/dockers/docker-platform-monitor/start.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -declare -r EXIT_SUCCESS="0" - -if [ "${RUNTIME_OWNER}" == "" ]; then - RUNTIME_OWNER="kube" -fi - -CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py" -if test -f ${CTR_SCRIPT} -then - ${CTR_SCRIPT} -f pmon -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} -fi - -mkdir -p /var/sonic -echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status - -# If this platform has synchronization script, run it -if [ -e /usr/share/sonic/platform/platform_wait ]; then - /usr/share/sonic/platform/platform_wait - EXIT_CODE="$?" - if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then - supervisorctl shutdown - exit "${EXIT_CODE}" - fi -fi - -# If the Python 2 sonic-platform package is not installed, try to install it -python2 -c "import sonic_platform" > /dev/null 2>&1 || pip2 show sonic-platform > /dev/null 2>&1 -if [ $? -ne 0 ]; then - SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py2-none-any.whl" - echo "sonic-platform package not installed, attempting to install..." - if [ -e ${SONIC_PLATFORM_WHEEL} ]; then - pip2 install ${SONIC_PLATFORM_WHEEL} - if [ $? -eq 0 ]; then - echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" - else - echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" - fi - else - echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" - fi -fi - -# If the Python 3 sonic-platform package is not installed, try to install it -python3 -c "import sonic_platform" > /dev/null 2>&1 || pip3 show sonic-platform > /dev/null 2>&1 -if [ $? -ne 0 ]; then - SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py3-none-any.whl" - echo "sonic-platform package not installed, attempting to install..." - if [ -e ${SONIC_PLATFORM_WHEEL} ]; then - pip3 install ${SONIC_PLATFORM_WHEEL} - if [ $? -eq 0 ]; then - echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" - else - echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" - fi - else - echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" - fi -fi diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 7ab0f2812c..547fbf6081 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -17,12 +17,18 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY3) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_LEDD) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PCIED) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_LEDD_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PCIED_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_LEDD_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PCIED_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3) ifeq ($(PDDF_SUPPORT),y) diff --git a/rules/sonic-ledd.dep b/rules/sonic-ledd.dep index f021637615..d9ae18537c 100644 --- a/rules/sonic-ledd.dep +++ b/rules/sonic-ledd.dep @@ -1,10 +1,16 @@ -SPATH := $($(SONIC_LEDD)_SRC_PATH) +SPATH := $($(SONIC_LEDD_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ledd.mk rules/sonic-ledd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_LEDD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_LEDD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_LEDD)_DEP_FILES := $(DEP_FILES) -$(SONIC_LEDD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_LEDD)_SMDEP_PATHS := $(SPATH) +$(SONIC_LEDD_PY2)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_LEDD_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_LEDD_PY2)_DEP_FILES := $(DEP_FILES) +$(SONIC_LEDD_PY2)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_LEDD_PY2)_SMDEP_PATHS := $(SPATH) + +$(SONIC_LEDD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_LEDD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_LEDD_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_LEDD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_LEDD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-ledd.mk b/rules/sonic-ledd.mk index 99d6f3e320..1439d2c506 100644 --- a/rules/sonic-ledd.mk +++ b/rules/sonic-ledd.mk @@ -1,8 +1,19 @@ # sonic-ledd (SONiC Front-panel LED control daemon) Debian package -SONIC_LEDD = sonic_ledd-1.1-py2-none-any.whl -$(SONIC_LEDD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ledd -$(SONIC_LEDD)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_LEDD)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_LEDD)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_LEDD) +# SONIC_LEDD_PY2 package + +SONIC_LEDD_PY2 = sonic_ledd-1.1-py2-none-any.whl +$(SONIC_LEDD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ledd +$(SONIC_LEDD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_LEDD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) +$(SONIC_LEDD_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_LEDD_PY2) + +# SONIC_LEDD_PY3 package + +SONIC_LEDD_PY3 = sonic_ledd-1.1-py3-none-any.whl +$(SONIC_LEDD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ledd +$(SONIC_LEDD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_LEDD_PY2) +$(SONIC_LEDD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_LEDD_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_LEDD_PY3) diff --git a/rules/sonic-pcied.dep b/rules/sonic-pcied.dep index b191d36ec9..ddb07f722f 100644 --- a/rules/sonic-pcied.dep +++ b/rules/sonic-pcied.dep @@ -1,10 +1,16 @@ -SPATH:= $($(SONIC_PCIED)_SRC_PATH) +SPATH:= $($(SONIC_PCIED_PY2)_SRC_PATH) DEP_FILES:= $(SONIC_COMMON_FILES_LIST) rules/sonic-pcied.mk rules/sonic-pcied.dep DEP_FILES+= $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES:= $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_PCIED)_CACHE_MODE:= GIT_CONTENT_SHA -$(SONIC_PCIED)_DEP_FLAGS:= $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_PCIED)_DEP_FILES:= $(DEP_FILES) -$(SONIC_PCIED)_SMDEP_FILES:= $(SMDEP_FILES) -$(SONIC_PCIED)_SMDEP_PATHS:= $(SPATH) +$(SONIC_PCIED_PY2)_CACHE_MODE:= GIT_CONTENT_SHA +$(SONIC_PCIED_PY2)_DEP_FLAGS:= $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_PCIED_PY2)_DEP_FILES:= $(DEP_FILES) +$(SONIC_PCIED_PY2)_SMDEP_FILES:= $(SMDEP_FILES) +$(SONIC_PCIED_PY2)_SMDEP_PATHS:= $(SPATH) + +$(SONIC_PCIED_PY3)_CACHE_MODE:= GIT_CONTENT_SHA +$(SONIC_PCIED_PY3)_DEP_FLAGS:= $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_PCIED_PY3)_DEP_FILES:= $(DEP_FILES) +$(SONIC_PCIED_PY3)_SMDEP_FILES:= $(SMDEP_FILES) +$(SONIC_PCIED_PY3)_SMDEP_PATHS:= $(SPATH) diff --git a/rules/sonic-pcied.mk b/rules/sonic-pcied.mk index dfcca1cab6..5c80ae2768 100644 --- a/rules/sonic-pcied.mk +++ b/rules/sonic-pcied.mk @@ -1,7 +1,17 @@ # sonic-pcied (SONiC PCIe Monitor daemon) Debian package -SONIC_PCIED = sonic_pcied-1.0-py2-none-any.whl -$(SONIC_PCIED)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-pcied -$(SONIC_PCIED)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_PCIED)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_PCIED) +# SONIC_PCIED_PY2 package + +SONIC_PCIED_PY2 = sonic_pcied-1.0-py2-none-any.whl +$(SONIC_PCIED_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-pcied +$(SONIC_PCIED_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_PCIED_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_PCIED_PY2) + +# SONIC_PCIED_PY3 package + +SONIC_PCIED_PY3 = sonic_pcied-1.0-py3-none-any.whl +$(SONIC_PCIED_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-pcied +$(SONIC_PCIED_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PCIED_PY2) +$(SONIC_PCIED_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_PCIED_PY3) diff --git a/rules/sonic-psud.dep b/rules/sonic-psud.dep index 29cc82f68b..f58d57571d 100644 --- a/rules/sonic-psud.dep +++ b/rules/sonic-psud.dep @@ -1,10 +1,16 @@ -SPATH := $($(SONIC_PSUD)_SRC_PATH) +SPATH := $($(SONIC_PSUD_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-psud.mk rules/sonic-psud.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_PSUD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_PSUD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_PSUD)_DEP_FILES := $(DEP_FILES) -$(SONIC_PSUD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_PSUD)_SMDEP_PATHS := $(SPATH) +$(SONIC_PSUD_PY2)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_PSUD_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_PSUD_PY2)_DEP_FILES := $(DEP_FILES) +$(SONIC_PSUD_PY2)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_PSUD_PY2)_SMDEP_PATHS := $(SPATH) + +$(SONIC_PSUD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_PSUD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_PSUD_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_PSUD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_PSUD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-psud.mk b/rules/sonic-psud.mk index 7cdbf50c0e..b07aa31b20 100644 --- a/rules/sonic-psud.mk +++ b/rules/sonic-psud.mk @@ -1,8 +1,19 @@ # sonic-psud (SONiC PSU daemon) Debian package -SONIC_PSUD = sonic_psud-1.0-py2-none-any.whl -$(SONIC_PSUD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud -$(SONIC_PSUD)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_PSUD)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_PSUD)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_PSUD) +# SONIC_PSUD_PY2 package + +SONIC_PSUD_PY2 = sonic_psud-1.0-py2-none-any.whl +$(SONIC_PSUD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud +$(SONIC_PSUD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_PSUD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) +$(SONIC_PSUD_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_PSUD_PY2) + +# SONIC_PSUD_PY3 package + +SONIC_PSUD_PY3 = sonic_psud-1.0-py3-none-any.whl +$(SONIC_PSUD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud +$(SONIC_PSUD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PSUD_PY2) +$(SONIC_PSUD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_PSUD_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_PSUD_PY3) diff --git a/rules/sonic-syseepromd.dep b/rules/sonic-syseepromd.dep index d5fc42a585..f27e436adf 100644 --- a/rules/sonic-syseepromd.dep +++ b/rules/sonic-syseepromd.dep @@ -1,10 +1,16 @@ -SPATH := $($(SONIC_SYSEEPROMD)_SRC_PATH) +SPATH := $($(SONIC_SYSEEPROMD_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-syseepromd.mk rules/sonic-syseepromd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_SYSEEPROMD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_SYSEEPROMD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_SYSEEPROMD)_DEP_FILES := $(DEP_FILES) -$(SONIC_SYSEEPROMD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_SYSEEPROMD)_SMDEP_PATHS := $(SPATH) +$(SONIC_SYSEEPROMD_PY2)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_SYSEEPROMD_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_SYSEEPROMD_PY2)_DEP_FILES := $(DEP_FILES) +$(SONIC_SYSEEPROMD_PY2)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_SYSEEPROMD_PY2)_SMDEP_PATHS := $(SPATH) + +$(SONIC_SYSEEPROMD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_SYSEEPROMD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_SYSEEPROMD_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_SYSEEPROMD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_SYSEEPROMD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-syseepromd.mk b/rules/sonic-syseepromd.mk index 6038aa73ab..0732e3b531 100644 --- a/rules/sonic-syseepromd.mk +++ b/rules/sonic-syseepromd.mk @@ -1,8 +1,19 @@ # sonic-syseepromd (SONiC Syseeprom gathering daemon) Debian package -SONIC_SYSEEPROMD = sonic_syseepromd-1.0-py2-none-any.whl -$(SONIC_SYSEEPROMD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd -$(SONIC_SYSEEPROMD)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_SYSEEPROMD)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_SYSEEPROMD)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD) +# SONIC_SYSEEPROMD_PY2 package + +SONIC_SYSEEPROMD_PY2 = sonic_syseepromd-1.0-py2-none-any.whl +$(SONIC_SYSEEPROMD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd +$(SONIC_SYSEEPROMD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_SYSEEPROMD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) +$(SONIC_SYSEEPROMD_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2) + +# SONIC_SYSEEPROMD_PY3 package + +SONIC_SYSEEPROMD_PY3 = sonic_syseepromd-1.0-py3-none-any.whl +$(SONIC_SYSEEPROMD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd +$(SONIC_SYSEEPROMD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_SYSEEPROMD_PY2) +$(SONIC_SYSEEPROMD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_SYSEEPROMD_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY3) diff --git a/rules/sonic-thermalctld.dep b/rules/sonic-thermalctld.dep index aa437849fd..5b9d05cb64 100644 --- a/rules/sonic-thermalctld.dep +++ b/rules/sonic-thermalctld.dep @@ -1,10 +1,16 @@ -SPATH := $($(SONIC_THERMALCTLD)_SRC_PATH) +SPATH := $($(SONIC_THERMALCTLD_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-thermalctld.mk rules/sonic-thermalctld.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_THERMALCTLD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_THERMALCTLD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_THERMALCTLD)_DEP_FILES := $(DEP_FILES) -$(SONIC_THERMALCTLD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_THERMALCTLD)_SMDEP_PATHS := $(SPATH) +$(SONIC_THERMALCTLD_PY2)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_THERMALCTLD_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_THERMALCTLD_PY2)_DEP_FILES := $(DEP_FILES) +$(SONIC_THERMALCTLD_PY2)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_THERMALCTLD_PY2)_SMDEP_PATHS := $(SPATH) + +$(SONIC_THERMALCTLD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_THERMALCTLD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_THERMALCTLD_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_THERMALCTLD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_THERMALCTLD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-thermalctld.mk b/rules/sonic-thermalctld.mk index 900d3a49e7..6eb16c5eb3 100644 --- a/rules/sonic-thermalctld.mk +++ b/rules/sonic-thermalctld.mk @@ -1,8 +1,19 @@ # sonic-thermalctld (SONiC Thermal control daemon) Debian package -SONIC_THERMALCTLD = sonic_thermalctld-1.0-py2-none-any.whl -$(SONIC_THERMALCTLD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld -$(SONIC_THERMALCTLD)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_THERMALCTLD)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_THERMALCTLD)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD) +# SONIC_THERMALCTLD_PY2 package + +SONIC_THERMALCTLD_PY2 = sonic_thermalctld-1.0-py2-none-any.whl +$(SONIC_THERMALCTLD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld +$(SONIC_THERMALCTLD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_THERMALCTLD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) +$(SONIC_THERMALCTLD_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2) + +# SONIC_THERMALCTLD_PY3 package + +SONIC_THERMALCTLD_PY3 = sonic_thermalctld-1.0-py3-none-any.whl +$(SONIC_THERMALCTLD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld +$(SONIC_THERMALCTLD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_THERMALCTLD_PY2) +$(SONIC_THERMALCTLD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_THERMALCTLD_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY3) diff --git a/rules/sonic-xcvrd.dep b/rules/sonic-xcvrd.dep index 724f4280a7..0bda526b48 100644 --- a/rules/sonic-xcvrd.dep +++ b/rules/sonic-xcvrd.dep @@ -1,10 +1,16 @@ -SPATH := $($(SONIC_XCVRD)_SRC_PATH) +SPATH := $($(SONIC_XCVRD_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-xcvrd.mk rules/sonic-xcvrd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_XCVRD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_XCVRD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_XCVRD)_DEP_FILES := $(DEP_FILES) -$(SONIC_XCVRD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_XCVRD)_SMDEP_PATHS := $(SPATH) +$(SONIC_XCVRD_PY2)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_XCVRD_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_XCVRD_PY2)_DEP_FILES := $(DEP_FILES) +$(SONIC_XCVRD_PY2)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_XCVRD_PY2)_SMDEP_PATHS := $(SPATH) + +$(SONIC_XCVRD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_XCVRD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_XCVRD_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_XCVRD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_XCVRD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-xcvrd.mk b/rules/sonic-xcvrd.mk index a3dd8ae3e7..5a0c6a44b8 100644 --- a/rules/sonic-xcvrd.mk +++ b/rules/sonic-xcvrd.mk @@ -1,8 +1,19 @@ # sonic-xcvrd (SONiC Transceiver monitoring daemon) Debian package -SONIC_XCVRD = sonic_xcvrd-1.0-py2-none-any.whl -$(SONIC_XCVRD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd -$(SONIC_XCVRD)_DEPENDS = $(SONIC_PY_COMMON_PY2) -$(SONIC_XCVRD)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_XCVRD)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_XCVRD) +# SONIC_XCVRD_PY2 package + +SONIC_XCVRD_PY2 = sonic_xcvrd-1.0-py2-none-any.whl +$(SONIC_XCVRD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd +$(SONIC_XCVRD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_PLATFORM_API_PY2) +$(SONIC_XCVRD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) +$(SONIC_XCVRD_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_XCVRD_PY2) + +# SONIC_XCVRD_PY3 package + +SONIC_XCVRD_PY3 = sonic_xcvrd-1.0-py3-none-any.whl +$(SONIC_XCVRD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd +$(SONIC_XCVRD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_XCVRD_PY2) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_PLATFORM_API_PY3) +$(SONIC_XCVRD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_XCVRD_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_XCVRD_PY3)