summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-extended/smartmontools
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/meta-openembedded/meta-oe/recipes-extended/smartmontools
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-extended/smartmontools')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/0001-os_linux.cpp-Use-realpath-BSD-POSIX-instead-of-canon.patch28
-rwxr-xr-xexternal/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/initd.smartd112
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartd.service12
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartmontools.default6
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.6.bb53
5 files changed, 211 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/0001-os_linux.cpp-Use-realpath-BSD-POSIX-instead-of-canon.patch b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/0001-os_linux.cpp-Use-realpath-BSD-POSIX-instead-of-canon.patch
new file mode 100644
index 00000000..91e64d21
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/0001-os_linux.cpp-Use-realpath-BSD-POSIX-instead-of-canon.patch
@@ -0,0 +1,28 @@
+From f28aa188e5b0ea85369febe657b8807b8025038b Mon Sep 17 00:00:00 2001
+From: chrfranke <authors@smartmontools.org>
+Date: Wed, 8 Nov 2017 06:15:50 +0000
+Subject: [PATCH] os_linux.cpp: Use 'realpath()' (BSD, POSIX) instead of
+ 'canonicalize_file_name()' (GNU extension). This fixes build on systems with
+ musl libc (#921).
+
+git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@4603 4ea69e1a-61f1-4043-bf83-b5c94c648137
+
+Upstream-Status: Backport [https://www.smartmontools.org/ticket/921]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ os_linux.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os_linux.cpp b/os_linux.cpp
+index 134d5bc..935f9c7 100644
+--- a/os_linux.cpp
++++ b/os_linux.cpp
+@@ -3176,7 +3176,7 @@ static bool is_hpsa(const char * name)
+ {
+ char path[128];
+ snprintf(path, sizeof(path), "/sys/block/%s/device", name);
+- char * syshostpath = canonicalize_file_name(path);
++ char * syshostpath = realpath(name, (char *)0);
+ if (!syshostpath)
+ return false;
+
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/initd.smartd b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/initd.smartd
new file mode 100755
index 00000000..54adcb40
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/initd.smartd
@@ -0,0 +1,112 @@
+#! /bin/sh
+
+# smartmontools init file for smartd
+# Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+# $Id: smartd.initd.in 3360 2011-06-06 19:25:36Z chrfranke $
+
+# For RedHat and cousins:
+# chkconfig: - 60 60
+# description: Self Monitoring and Reporting Technology (SMART) Daemon
+# processname: smartd
+
+# For SuSE and cousins
+### BEGIN INIT INFO
+# Provides: smartd
+# Required-Start: $syslog $remote_fs
+# Should-Start: sendmail
+# Required-Stop: $syslog $remote_fs
+# Should-Stop: sendmail
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Monitors disk and tape health via S.M.A.R.T.
+# Description: Start S.M.A.R.T. disk and tape monitor.
+### END INIT INFO
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+# You should have received a copy of the GNU General Public License (for
+# example COPYING); if not, write to the Free Software Foundation, Inc., 675
+# Mass Ave, Cambridge, MA 02139, USA.
+# This code was originally developed as a Senior Thesis by Michael Cornwell
+# at the Concurrent Systems Laboratory (now part of the Storage Systems
+# Research Center), Jack Baskin School of Engineering, University of
+# California, Santa Cruz. http://ssrc.soe.ucsc.edu/.
+
+# Uncomment the line below to pass options to smartd on startup.
+# Note that distribution specific configuration files like
+# /etc/{default,sysconfig}/smartmontools might override these
+#smartd_opts="--interval=1800"
+
+SMARTD_BIN=/usr/sbin/smartd
+SMARTDPID=/var/run/smartd.pid
+[ -x $SMARTD_BIN ] || exit 0
+RET=0
+
+# source configuration file
+[ -r /etc/default/rcS ] && . /etc/default/rcS
+[ -r /etc/default/smartmontools ] && . /etc/default/smartmontools
+
+smartd_opts="--pidfile $SMARTDPID $smartd_opts"
+
+case "$1" in
+ start)
+ if [ "$start_smartd" != "yes" ]; then
+ [ "$VERBOSE" != "no" ] && echo "Not starting S.M.A.R.T. daemon smartd, disabled via /etc/default/smartmontools"
+ exit 0
+ fi
+ echo -n "Starting S.M.A.R.T. daemon: smartd"
+ if start-stop-daemon --start --quiet --pidfile $SMARTDPID \
+ --exec $SMARTD_BIN -- $smartd_opts; then
+ echo "."
+ else
+ echo " (failed)"
+ RET=1
+ fi
+ ;;
+ stop)
+ echo -n "Stopping S.M.A.R.T. daemon: smartd"
+ start-stop-daemon --stop --quiet --oknodo --pidfile $SMARTDPID
+ echo "."
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ force-reload)
+ $0 reload || $0 restart
+ ;;
+ reload)
+ echo -n "Reload S.M.A.R.T. daemon: smartd"
+ if start-stop-daemon --stop --quiet --signal 1 \
+ --pidfile $SMARTDPID; then
+ echo "."
+ else
+ echo " (failed)"
+ RET=1
+ fi
+ ;;
+ report)
+ echo -n "Checking SMART devices now"
+ if start-stop-daemon --stop --quiet --signal 10 \
+ --pidfile $SMARTDPID; then
+ echo "."
+ else
+ echo " (failed)"
+ RET=1
+ fi
+ ;;
+ status)
+ if pidof $SMARTD_BIN >/dev/null; then
+ echo "$SMARTD_BIN is running."
+ else
+ echo "$SMARTD_BIN is not running."
+ RET=1
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload|reload|report|status}"
+ exit 1
+esac
+exit $RET
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartd.service b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartd.service
new file mode 100644
index 00000000..f3db946c
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Self Monitoring and Reporting Technology (SMART) Daemon
+After=syslog.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/smartmontools
+ExecStart=@SBINDIR@/smartd -n $smart_opts
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartmontools.default b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartmontools.default
new file mode 100644
index 00000000..602e00be
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/files/smartmontools.default
@@ -0,0 +1,6 @@
+# uncomment to start smartd on system startup for SysV init script
+# For systemd service file, use `systemctl enable smartd'.
+#start_smartd=yes
+
+# uncomment to pass additional options to smartd on startup
+#smartd_opts="--interval=1800"
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.6.bb b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.6.bb
new file mode 100644
index 00000000..c77c1055
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.6.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Control and monitor storage systems using S.M.A.R.T"
+DESCRIPTION = "\
+The smartmontools package contains two utility programs (smartctl \
+and smartd) to control and monitor storage systems using the Self-\
+Monitoring, Analysis and Reporting Technology System (SMART) built \
+into most modern ATA and SCSI hard disks. In many cases, these \
+utilities will provide advanced warning of disk degradation and failure."
+
+HOMEPAGE = "http://smartmontools.sourceforge.net/"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz \
+ file://initd.smartd \
+ file://smartmontools.default \
+ file://smartd.service \
+ file://0001-os_linux.cpp-Use-realpath-BSD-POSIX-instead-of-canon.patch \
+ "
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'libcap-ng selinux', d)}"
+PACKAGECONFIG[libcap-ng] = "--with-libcap-ng=yes,--with-libcap-ng=no,libcap-ng"
+PACKAGECONFIG[selinux] = "--with-selinux=yes,--with-selinux=no,libselinux"
+
+SRC_URI[md5sum] = "9ae2c6e7131cd2813edcc65cbe5f223f"
+SRC_URI[sha256sum] = "51f43d0fb064fccaf823bbe68cf0d317d0895ff895aa353b3339a3b316a53054"
+
+inherit autotools update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "smartd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append () {
+ #install the init.d/smartd
+ install -d ${D}${sysconfdir}/init.d
+ install -p -m 0755 ${WORKDIR}/initd.smartd ${D}${sysconfdir}/init.d/smartd
+ install -d ${D}${sysconfdir}/default
+ install -p -m 0644 ${WORKDIR}/smartmontools.default ${D}${sysconfdir}/default/smartmontools
+
+ #install systemd service file
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/smartd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/smartd.service
+}
+
+INITSCRIPT_NAME = "smartd"
+INITSCRIPT_PARAMS = "start 60 2 3 4 5 . stop 60 0 1 6 ."
+
+RDEPENDS_${PN} += "mailx"