lm-sensors: add init script 5231/head
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 6 Dec 2017 01:03:39 +0000 (18:03 -0700)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Tue, 16 Jan 2018 22:35:14 +0000 (15:35 -0700)
"sensors -s" needs to happen at boot-time so that any "set"
statements in sensors.conf file can take effect.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
utils/lm-sensors/Makefile
utils/lm-sensors/files/lm-sensors.init [new file with mode: 0644]

index 13aa5b9235de20c4917e0e1c0bb697fd103cdefa..3ea3b4f23713f9eb576cd441cb5d56c60f4fbb57 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lm-sensors
 PKG_VERSION:=3.3.5
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/groeck/lm-sensors.git
@@ -101,6 +101,8 @@ ifeq ($(ARCH),i386)
        $(INSTALL_DIR) $(1)/etc
        $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
 endif
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/lm-sensors.init $(1)/etc/init.d/lm-sensors
 endef
 
 define Package/lm-sensors-detect/install
diff --git a/utils/lm-sensors/files/lm-sensors.init b/utils/lm-sensors/files/lm-sensors.init
new file mode 100644 (file)
index 0000000..5ac7a72
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 Philip Prindeville, Redfish Solutions LLC
+
+START=28
+STOP=
+
+PROG=/usr/sbin/sensors
+
+start() {
+       [ -f /etc/sensors.conf -o -f /etc/sensors3.conf ] || return
+
+       $PROG -s
+}
+