summaryrefslogtreecommitdiff
path: root/repo/smartmontools
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
committerdavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
commit0d37a1ef234c38b27faba43bc3a22f985d311deb (patch)
treedde8df9f508e7323c3d7df599ceade7705c40acd /repo/smartmontools
parentf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (diff)
Remove all firmware
Diffstat (limited to 'repo/smartmontools')
-rw-r--r--repo/smartmontools/smartd.confd10
-rw-r--r--repo/smartmontools/smartd.initd31
-rw-r--r--repo/smartmontools/smartmontools.xibuild33
3 files changed, 74 insertions, 0 deletions
diff --git a/repo/smartmontools/smartd.confd b/repo/smartmontools/smartd.confd
new file mode 100644
index 0000000..7411cb0
--- /dev/null
+++ b/repo/smartmontools/smartd.confd
@@ -0,0 +1,10 @@
+# Configuration file for /etc/init.d/smartd
+
+# Path to the configuration file.
+#cfgfile=/etc/smartd.conf
+
+# Additional options to pass to smartd.
+#command_args=
+
+# Uncomment to use process supervisor.
+#supervisor=supervise-daemon
diff --git a/repo/smartmontools/smartd.initd b/repo/smartmontools/smartd.initd
new file mode 100644
index 0000000..b117aa9
--- /dev/null
+++ b/repo/smartmontools/smartd.initd
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+
+name=smartd
+description="Daemon to monitor the S.M.A.R.T. system built into storage devices"
+description_reload="Reload configuration without exiting"
+extra_started_commands="reload"
+
+: ${cfgfile:="/etc/smartd.conf"}
+
+command=/usr/sbin/smartd
+command_args="--configfile=$cfgfile --no-fork ${command_args:-$SMARTD_OPTS}"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.pid"
+
+required_files="$cfgfile"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+reload() {
+ ebegin "Reloading $name configuration"
+
+ if [ "$supervisor" ]; then
+ $supervisor "$RC_SVCNAME" --signal HUP
+ else
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
+ fi
+ eend $?
+}
diff --git a/repo/smartmontools/smartmontools.xibuild b/repo/smartmontools/smartmontools.xibuild
new file mode 100644
index 0000000..21583a6
--- /dev/null
+++ b/repo/smartmontools/smartmontools.xibuild
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+NAME="smartmontools"
+DESC="Control and monitor S.M.A.R.T. enabled hard drives"
+
+MAKEDEPS="linux-headers"
+
+PKG_VER=7.3
+SOURCE="https://downloads.sourceforge.net/sourceforge/smartmontools/smartmontools-$PKG_VER.tar.gz"
+
+ADDITIONAL="
+smartd.confd
+smartd.initd
+"
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$PKG_DEST"/ install
+
+ install -Dm755 "$BUILD_ROOT"/smartd.initd "$PKG_DEST"/etc/init.d/smartd
+ install -Dm644 "$BUILD_ROOT"/smartd.confd "$PKG_DEST"/etc/conf.d/smartd
+}
+