From 1430d49824b9752e8d65cb45657c96256ec49c01 Mon Sep 17 00:00:00 2001 From: Howard Persh Date: Fri, 12 Jul 2019 10:43:53 -0700 Subject: [PATCH 1/6] Add scripts to create JSON files for CLI backend Scripts to create /var/platform/syseeprom and /var/platform/system, which are back-end files for CLI, for system EEPROM and system information. Signed-off-by: Howard Persh --- .gitmodules | 2 +- files/image_config/platform/rc.local | 6 ++++++ src/sonic-utilities | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f82acbeeb1da..7419536b2650 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,7 +34,7 @@ url = https://github.com/p4lang/ptf.git [submodule "src/sonic-utilities"] path = src/sonic-utilities - url = https://github.com/Azure/sonic-utilities + url = https://github.com/project-arlo/sonic-utilities.git [submodule "platform/broadcom/sonic-platform-modules-arista"] path = platform/broadcom/sonic-platform-modules-arista url = https://github.com/aristanetworks/sonic diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 3596eb18419c..ab15b949c16b 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -354,4 +354,10 @@ if [ -f $FIRST_BOOT_FILE ]; then firsttime_exit fi +# Write contents of system EEPROM as JSON file +/usr/bin/decode-syseeprom | /usr/bin/syseeprom-to-json > /var/platform/syseeprom + +# Start system information poller +/usr/bin/syspoll & + exit 0 diff --git a/src/sonic-utilities b/src/sonic-utilities index 09806b861486..bd16c4467e3c 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 09806b861486091d9db5cb75bdd2cc9428e46844 +Subproject commit bd16c4467e3c4aefecce6f545529aea7cc633d6a From e86f0a22e4d2567d32267062abbca253f6a53daa Mon Sep 17 00:00:00 2001 From: Howard Persh Date: Wed, 17 Jul 2019 10:52:45 -0700 Subject: [PATCH 2/6] In startup script, create directory where CLI back-end files live Signed-off-by: Howard Persh --- files/image_config/platform/rc.local | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index ab15b949c16b..2574f6dbf760 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -354,6 +354,9 @@ if [ -f $FIRST_BOOT_FILE ]; then firsttime_exit fi +# Create dir where following scripts put their output files +mkdir -p /var/platform + # Write contents of system EEPROM as JSON file /usr/bin/decode-syseeprom | /usr/bin/syseeprom-to-json > /var/platform/syseeprom From 4125d6ac621390099aa50471b79c5f3e9c683505 Mon Sep 17 00:00:00 2001 From: Srideep Devireddy Date: Wed, 17 Jul 2019 15:00:23 -0400 Subject: [PATCH 3/6] build dependency pkgs added to docker for build failure fix --- dockers/docker-sonic-mgmt-framework/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index cc8ca47ccf67..ec8d1781ae3f 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -22,7 +22,7 @@ RUN pip install connexion==1.1.15 \ ## Install redis-tools dependencies ## TODO: implicitly install dependencies -RUN apt-get -y install libjemalloc1 +RUN apt-get -y install libjemalloc1 libatomic1 liblua5.1-0 lua-bitop lua-cjson COPY \ {% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%} From e99a91ffc28a0fd13f4ad458719d2511c3665431 Mon Sep 17 00:00:00 2001 From: Howard Persh Date: Fri, 19 Jul 2019 16:01:19 -0700 Subject: [PATCH 4/6] Processing of first boot in rc.local should not have premature exit Signed-off-by: Howard Persh --- files/image_config/platform/rc.local | 1 - 1 file changed, 1 deletion(-) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 6e1a5d85b0d6..28c38bcba908 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -90,7 +90,6 @@ update_mgmt_interface_macaddr() { firsttime_exit() { rm -rf $FIRST_BOOT_FILE - exit 0 } # Given a string of tuples of the form field=value, extract the value for a field From 05c8a1df80f9bf9b41eb846e835bc323a331f3fd Mon Sep 17 00:00:00 2001 From: arunsundark Date: Mon, 22 Jul 2019 16:18:30 -0700 Subject: [PATCH 5/6] docker mount options added for platform, system features --- rules/docker-sonic-mgmt-framework.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index 8e973da313b4..edb7065ce9ed 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -19,4 +19,4 @@ SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK) $(DOCKER_MGMT-FRAMEWORK)_CONTAINER_NAME = mgmt-framework $(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --net=host --privileged -t $(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro - +$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/" From 4c394868d8a05b2810af0e1669a43f4da4fe4337 Mon Sep 17 00:00:00 2001 From: Ravi Vasanthm Date: Thu, 25 Jul 2019 16:26:53 -0700 Subject: [PATCH 6/6] Added mount options for telemetry docker to get access for system and platform info. --- rules/docker-telemetry.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 94920c464381..44c835373e04 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -27,4 +27,5 @@ endif $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --net=host --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TELEMETRY)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/"