[package] add fancontroled
Add fancontroled (fancontrol for embedded devices) package. fancontroled is linux daemon written in C implementing a temperature dependent fan speed control. fancontroled provides similar functionalities like fancontrol script from lm-sensors; but fancontroled does not need bash or other dependencies (except lm-sensors library). That makes it suitable for embedded devices. More info here: http://fancontroled.lukaperkov.net/ fancontroled.init file contains parameters for D-Link DNS323 device. Signed-off-by: Luka Perkov <openwrt@lukaperkov.net> git-svn-id: svn://svn.openwrt.org/openwrt/packages@24070 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
e1e602144f
commit
77786f17ec
54
utils/fancontroled/Makefile
Normal file
54
utils/fancontroled/Makefile
Normal file
@ -0,0 +1,54 @@
|
||||
#
|
||||
# Copyright (C) 2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fancontroled
|
||||
PKG_VERSION:=0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar
|
||||
PKG_SOURCE_URL:=http://code.lukaperkov.net/fancontroled/
|
||||
PKG_MD5SUM:=8c3a7efa99e58216ad4633d1e6ed1358
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fancontroled
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=fancontroled
|
||||
DEPENDS:=+libsensors
|
||||
URL:=http://fancontroled.lukaperkov.net/
|
||||
endef
|
||||
|
||||
define Package/fancontroled/description
|
||||
fancontroled is linux daemon written in C implementing a temperature dependent fan speed control.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
INC_PATH="-I$(STAGING_DIR)/usr/include/ -I$(STAGING_DIR)/usr/lib/"
|
||||
|
||||
$(STRIP) $(PKG_BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
mkdir -p $(PKG_INSTALL_DIR)/usr/sbin
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
install
|
||||
endef
|
||||
|
||||
define Package/fancontroled/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/fancontroled.init $(1)/etc/init.d/fancontroled
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fancontroled))
|
22
utils/fancontroled/files/fancontroled.init
Normal file
22
utils/fancontroled/files/fancontroled.init
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=75
|
||||
STOP=75
|
||||
|
||||
TEMP_SENSOR_CHIP=lm75
|
||||
TEMP_READ_FIELD=temp1_input
|
||||
MIN_TEMP=30
|
||||
MAX_TEMP=50
|
||||
FAN_SENSOR_CHIP=g760a
|
||||
FAN_CONTROL_FIELD=pwm1
|
||||
PWM_FAN_MIN=1
|
||||
PWM_FAN_MAX=180
|
||||
PID_FILENAME=/var/run/fancontroled.pid
|
||||
|
||||
start() {
|
||||
/usr/sbin/fancontroled -t $TEMP_SENSOR_CHIP -r $TEMP_READ_FIELD -m $MIN_TEMP -M $MAX_TEMP -f $FAN_SENSOR_CHIP -c $FAN_CONTROL_FIELD -p $PWM_FAN_MIN -P $PWM_FAN_MAX -z $PID_FILENAME
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill $(cat $PID_FILENAME)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user