Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-platform-monitor]: Add smartmontools 6.6-1 #2703

Merged
merged 5 commits into from Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dockers/docker-platform-monitor/base_image_files/smartctl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

DOCKER_EXEC_FLAGS="i"

# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi

docker exec -$DOCKER_EXEC_FLAGS pmon smartctl "$@"
3 changes: 2 additions & 1 deletion rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON)
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SMARTMONTOOLS)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_DEBS += $(SONIC_LEDD) $(SONIC_XCVRD) $(SONIC_PSUD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
Expand All @@ -22,3 +22,4 @@ $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/arista:/usr/lib/python2.7/dist-packages/arista:ro

$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += sensors:/usr/bin/sensors
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += smartctl:/usr/sbin/smartctl
13 changes: 13 additions & 0 deletions rules/smartmontools.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# smartmontools package
#

SMARTMONTOOLS_VERSION_MAJOR = 6.6
SMARTMONTOOLS_VERSION_FULL = $(SMARTMONTOOLS_VERSION_MAJOR)-1

export SMARTMONTOOLS_VERSION_MAJOR SMARTMONTOOLS_VERSION_FULL

SMARTMONTOOLS = smartmontools_$(SMARTMONTOOLS_VERSION_FULL)_amd64.deb
$(SMARTMONTOOLS)_SRC_PATH = $(SRC_PATH)/smartmontools

SONIC_STRETCH_DEBS += $(SMARTMONTOOLS)
SONIC_MAKE_DEBS += $(SMARTMONTOOLS)
8 changes: 7 additions & 1 deletion sonic-slave-stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ RUN apt-get update && apt-get install -y \
# For lm-sensors
librrd8 \
librrd-dev \
rrdtool
rrdtool \
# For smartmontools 6.6-1
automake1.11 \
libselinux1-dev

# For smartmontools 6.6-1
RUN apt-get -t stretch-backports install -y debhelper

# For linux build
RUN apt-get -y build-dep linux
Expand Down
19 changes: 19 additions & 0 deletions src/smartmontools/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e


MAIN_TARGET = smartmontools_$(SMARTMONTOOLS_VERSION_FULL)_amd64.deb

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR)
wget -O smartmontools_$(SMARTMONTOOLS_VERSION_MAJOR).orig.tar.gz -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_MAJOR).orig.tar.gz?sv=2015-04-05&sr=b&sig=JZx4qiLuO36T0rsGqk4V2RDuWjRw6NztsLK7vlBYAkg%3D&se=2046-08-20T23%3A47%3A13Z&sp=r"
wget -O smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc?sv=2015-04-05&sr=b&sig=IS7FKUN%2Bvq0T55f4X2hGAViB70Y%2FgzjGgvzpUJLyUfA%3D&se=2046-08-20T23%3A46%3A57Z&sp=r"
wget -O smartmontools_$(SMARTMONTOOLS_VERSION_FULL).debian.tar.xz -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_FULL).debian.tar.xz?sv=2015-04-05&sr=b&sig=H0RFeC41MCvhTQCln85DuPLn5v2goozwz%2FB9sA9p5eQ%3D&se=2046-08-20T23%3A46%3A02Z&sp=r"
dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc

pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR)
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS)
popd

mv $* $(DEST)/