Skip to content

Commit 27803ec

Browse files
Wirut Getbamrunglguohan
Wirut Getbamrung
authored andcommitted
[docker-platform-monitor]: Add smartmontools 6.6-1 (#2703)
1 parent d993d6f commit 27803ec

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
DOCKER_EXEC_FLAGS="i"
4+
5+
# Determine whether stdout is on a terminal
6+
if [ -t 1 ] ; then
7+
DOCKER_EXEC_FLAGS+="t"
8+
fi
9+
10+
docker exec -$DOCKER_EXEC_FLAGS pmon smartctl "$@"

rules/docker-platform-monitor.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

2424
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += sensors:/usr/bin/sensors
25+
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += smartctl:/usr/sbin/smartctl

rules/smartmontools.mk

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# smartmontools package
2+
#
3+
4+
SMARTMONTOOLS_VERSION_MAJOR = 6.6
5+
SMARTMONTOOLS_VERSION_FULL = $(SMARTMONTOOLS_VERSION_MAJOR)-1
6+
7+
export SMARTMONTOOLS_VERSION_MAJOR SMARTMONTOOLS_VERSION_FULL
8+
9+
SMARTMONTOOLS = smartmontools_$(SMARTMONTOOLS_VERSION_FULL)_amd64.deb
10+
$(SMARTMONTOOLS)_SRC_PATH = $(SRC_PATH)/smartmontools
11+
12+
SONIC_STRETCH_DEBS += $(SMARTMONTOOLS)
13+
SONIC_MAKE_DEBS += $(SMARTMONTOOLS)

sonic-slave-stretch/Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,13 @@ RUN apt-get update && apt-get install -y \
218218
# For lm-sensors
219219
librrd8 \
220220
librrd-dev \
221-
rrdtool
221+
rrdtool \
222+
# For smartmontools 6.6-1
223+
automake1.11 \
224+
libselinux1-dev
225+
226+
# For smartmontools 6.6-1
227+
RUN apt-get -t stretch-backports install -y debhelper
222228

223229
# For linux build
224230
RUN apt-get -y build-dep linux

src/smartmontools/Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SHELL = /bin/bash
2+
.ONESHELL:
3+
.SHELLFLAGS += -e
4+
5+
6+
MAIN_TARGET = smartmontools_$(SMARTMONTOOLS_VERSION_FULL)_amd64.deb
7+
8+
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
9+
rm -rf smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR)
10+
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"
11+
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"
12+
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"
13+
dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc
14+
15+
pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR)
16+
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS)
17+
popd
18+
19+
mv $* $(DEST)/

0 commit comments

Comments
 (0)