Adds the smartmontools package containing smartctl and smartd Signed-off-by: Bart vdr. Meulen <bartvdrmeu...@gmail.com> Signed-off-by: Remy Bohmer <li...@bohmer.net> --- generic/etc/init.d/smartd | 30 ++++++++++++++++ generic/etc/smartd.conf | 2 + rules/initmethod-bbinit.in | 6 +++ rules/initmethod-bbinit.make | 6 +++ rules/smartmontools.in | 45 ++++++++++++++++++++++++ rules/smartmontools.make | 78 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 167 insertions(+), 0 deletions(-) create mode 100644 generic/etc/init.d/smartd create mode 100644 generic/etc/smartd.conf create mode 100644 rules/smartmontools.in create mode 100644 rules/smartmontools.make
diff --git a/generic/etc/init.d/smartd b/generic/etc/init.d/smartd new file mode 100644 index 0000000..2849ffa --- /dev/null +++ b/generic/etc/init.d/smartd @@ -0,0 +1,30 @@ +#!/bin/sh + +DAEMON=/usr/sbin/smartd +PIDFILE=/var/run/smartd.pid + +case $1 in +start) + echo -n "Starting smartd..." + start-stop-daemon --start --oknodo \ + --pidfile $PIDFILE --exec $DAEMON + + if [ "$?" = "0" ]; then + echo "done" + exit 0 + else + echo "failed" + exit 1 + fi + + ;; +stop) + echo "Stopping smartd" + start-stop-daemon --stop --oknodo --quiet \ + --pidfile $PIDFILE --exec $DAEMON + ;; +*) + echo "usage: $0 [start|stop]" + ;; +esac + diff --git a/generic/etc/smartd.conf b/generic/etc/smartd.conf new file mode 100644 index 0000000..21b03b5 --- /dev/null +++ b/generic/etc/smartd.conf @@ -0,0 +1,2 @@ +# The word DEVICESCAN tells smartd to scan for all ATA and SCSI devices. +DEVICESCAN diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in index 1b4d8f2..7b6277f 100644 --- a/rules/initmethod-bbinit.in +++ b/rules/initmethod-bbinit.in @@ -291,6 +291,12 @@ config INITMETHOD_BBINIT_LINK_SPLASHUTILS prompt "splashutils" default "S00splashutils" +config INITMETHOD_BBINIT_SMARTD + string + depends on SMARTMONTOOLS_SMARTD_INITD + prompt "smartd" + default "S40smartd" + endmenu endif diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make index eb06752..ff81a41 100644 --- a/rules/initmethod-bbinit.make +++ b/rules/initmethod-bbinit.make @@ -375,6 +375,12 @@ ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_SPLASHUTILS)),) /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_SPLASHUTILS)) endif +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_SMARTD)),) + @$(call install_link, initmethod-bbinit, \ + ../init.d/smartd, \ + /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_SMARTD)) +endif + @$(call install_finish, initmethod-bbinit) @$(call touch) diff --git a/rules/smartmontools.in b/rules/smartmontools.in new file mode 100644 index 0000000..b481c1b --- /dev/null +++ b/rules/smartmontools.in @@ -0,0 +1,45 @@ +## SECTION=shell_and_console + +config SMARTMONTOOLS + tristate + prompt "smartmontools" + select BUSYBOX_START_STOP_DAEMON if SMARTMONTOOLS_SMARTD_INITD + help + 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 + harddisks. In many cases, these utilities will provide advanced warning of + disk degradation and failure. +if SMARTMONTOOLS + +config SMARTMONTOOLS_SMARTCTL + bool + default y + prompt "install smartctl" + help + Control and Monitor Utility for SMART Disks + +config SMARTMONTOOLS_SMARTD + bool + default n + prompt "install smartd" + help + SMART Disk Monitoring Daemon + +config SMARTMONTOOLS_SMARTD_CONFIG + bool + depends on SMARTMONTOOLS_SMARTD + default n + prompt "install smartd.conf" + help + SMART Disk Monitoring Daemon Configuration File + +config SMARTMONTOOLS_SMARTD_INITD + bool + depends on SMARTMONTOOLS_SMARTD + default n + prompt "install /etc/init.d/smartd" + help + SMART Disk Monitoring Daemon Configuration File + +endif diff --git a/rules/smartmontools.make b/rules/smartmontools.make new file mode 100644 index 0000000..aac6f3a --- /dev/null +++ b/rules/smartmontools.make @@ -0,0 +1,78 @@ +# -*-makefile-*- +# +# Copyright (C) 2010 by Bart vdr. Meulen <bartvdrmeu...@gmail.com> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SMARTMONTOOLS) += smartmontools + +# +# Paths and names +# +SMARTMONTOOLS_VERSION := 5.39 +SMARTMONTOOLS := smartmontools-$(SMARTMONTOOLS_VERSION) +SMARTMONTOOLS_SUFFIX := tar.gz +SMARTMONTOOLS_URL := $(PTXCONF_SETUP_SFMIRROR)/smartmontools/$(SMARTMONTOOLS).$(SMARTMONTOOLS_SUFFIX) +SMARTMONTOOLS_SOURCE := $(SRCDIR)/$(SMARTMONTOOLS).$(SMARTMONTOOLS_SUFFIX) +SMARTMONTOOLS_DIR := $(BUILDDIR)/$(SMARTMONTOOLS) +SMARTMONTOOLS_LICENSE := GPLv2 + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(SMARTMONTOOLS_SOURCE): + @$(call targetinfo) + @$(call get, SMARTMONTOOLS) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +SMARTMONTOOLS_CONF_TOOL := autoconf +SMARTMONTOOLS_CONF_OPT := \ + $(CROSS_AUTOCONF_USR) \ + --disable-sample + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/smartmontools.targetinstall: + @$(call targetinfo) + + @$(call install_init, smartmontools) + @$(call install_fixup, smartmontools,PACKAGE,smartmontools) + @$(call install_fixup, smartmontools,PRIORITY,optional) + @$(call install_fixup, smartmontools,VERSION,$(SMARTMONTOOLS_VERSION)) + @$(call install_fixup, smartmontools,SECTION,base) + @$(call install_fixup, smartmontools,AUTHOR,"Bart vdr. Meulen <bartvdrmeu...@gmail.com>") + @$(call install_fixup, smartmontools,DEPENDS,) + @$(call install_fixup, smartmontools,DESCRIPTION,missing) + +ifdef PTXCONF_SMARTMONTOOLS_SMARTCTL + @$(call install_copy, smartmontools, 0, 0, 0755, -, /usr/sbin/smartctl) +endif +ifdef PTXCONF_SMARTMONTOOLS_SMARTD + @$(call install_copy, smartmontools, 0, 0, 0755, -, /usr/sbin/smartd) +endif +ifdef PTXCONF_SMARTMONTOOLS_SMARTD_CONFIG + @$(call install_alternative, smartmontools, 0, 0, 0644, /etc/smartd.conf) +endif +ifdef PTXCONF_SMARTMONTOOLS_SMARTD_INITD + @$(call install_alternative, smartmontools, 0, 0, 0755, /etc/init.d/smartd) +endif + + @$(call install_finish, smartmontools) + + @$(call touch) + + +# vim: syntax=make -- 1.7.0.4 -- ptxdist mailing list ptxdist@pengutronix.de