mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 06:57:50 +00:00
imx6-soc-fan: remove package
This commit is contained in:
parent
bf40ac3d77
commit
fce3960ae6
@ -1,67 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
. /usr/lib/libreelec/imx6-system-type
|
||||
|
||||
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
||||
echo "Only for TBS Matrix system."
|
||||
exit 12
|
||||
fi
|
||||
|
||||
fan_on() {
|
||||
echo 1 > /sys/class/leds/fan/brightness
|
||||
}
|
||||
|
||||
fan_off() {
|
||||
echo 0 > /sys/class/leds/fan/brightness
|
||||
}
|
||||
|
||||
soc_temp() {
|
||||
local temp=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)
|
||||
temp="$(( $temp / 1000 ))"
|
||||
echo "$temp"
|
||||
}
|
||||
|
||||
echo "SoC temp: $(soc_temp) C"
|
||||
|
||||
ACTION=$1
|
||||
INTERVAL=$2
|
||||
|
||||
if [ -n "$ACTION" -a "$ACTION" = "on" ]; then
|
||||
echo "Turning fan on."
|
||||
fan_on
|
||||
elif [ -n "$ACTION" -a "$ACTION" = "off" ]; then
|
||||
echo "Turning fan off."
|
||||
fan_off
|
||||
elif [ -n "$ACTION" -a "$ACTION" = "log" ]; then
|
||||
if [ -n "$INTERVAL" ]; then
|
||||
interval=$INTERVAL
|
||||
else
|
||||
interval=60
|
||||
fi
|
||||
|
||||
while true; do
|
||||
echo "SoC temp: $(soc_temp) C"
|
||||
|
||||
sleep $interval
|
||||
done
|
||||
else
|
||||
echo "Unknown argument - must be on, off or log [interval]."
|
||||
fi
|
@ -1,37 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# imx6-soc-fan-monitor.conf.sample - i.MX6 SoC fan monitor config file
|
||||
# used only for TBS Matrix system
|
||||
#
|
||||
|
||||
# default limits without config file
|
||||
# when fan is turned on
|
||||
# high=70
|
||||
# when fan is turned off
|
||||
# low=60
|
||||
# temperature checking interval
|
||||
# interval=30
|
||||
# periodically show temperature
|
||||
# debug=no
|
||||
|
||||
high=70
|
||||
low=55
|
||||
interval=30
|
||||
debug=no
|
@ -1,48 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="imx6-soc-fan"
|
||||
PKG_VERSION="1.0"
|
||||
PKG_ARCH="arm"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.openelec.tv/"
|
||||
PKG_URL=""
|
||||
PKG_DEPENDS_TARGET="imx6-status-led"
|
||||
PKG_SECTION="system"
|
||||
PKG_SHORTDESC="i.MX6 SoC fan monitor"
|
||||
PKG_LONGDESC="i.MX6 SoC fan monitor for TBS Matrix system"
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
make_target() {
|
||||
: # nothing
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/config
|
||||
cp $PKG_DIR/config/* $INSTALL/usr/config
|
||||
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp $PKG_DIR/bin/* $INSTALL/usr/bin
|
||||
|
||||
mkdir -p $INSTALL/usr/lib/libreelec
|
||||
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/libreelec
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service imx6-soc-fan-monitor.service
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC 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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
. /usr/lib/libreelec/imx6-system-type
|
||||
|
||||
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
||||
echo "Only for TBS Matrix system."
|
||||
exit 12
|
||||
fi
|
||||
|
||||
debug_echo() {
|
||||
if [ -n "$debug" -a "$debug" == "yes" ]; then
|
||||
echo $*
|
||||
fi
|
||||
}
|
||||
|
||||
fan_on() {
|
||||
echo 1 > /sys/class/leds/fan/brightness
|
||||
}
|
||||
|
||||
fan_off() {
|
||||
echo 0 > /sys/class/leds/fan/brightness
|
||||
}
|
||||
|
||||
soc_temp() {
|
||||
local temp=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)
|
||||
temp="$(( $temp / 1000 ))"
|
||||
echo "$temp"
|
||||
}
|
||||
|
||||
# default limits
|
||||
high=75
|
||||
low=60
|
||||
interval=30
|
||||
debug=no
|
||||
|
||||
userconfig=/storage/.config/imx6-soc-fan-monitor.conf
|
||||
if [ -e $userconfig ]; then
|
||||
. $userconfig
|
||||
echo "Values from config: low=$low high=$high interval=$interval debug=$debug"
|
||||
else
|
||||
echo "Default values: low=$low high=$high interval=$interval debug=$debug"
|
||||
fi
|
||||
|
||||
#(
|
||||
# # turn fan on for a moment
|
||||
# fan_on
|
||||
# sleep 2
|
||||
# fan_off
|
||||
#)&
|
||||
|
||||
while true; do
|
||||
temp=$(soc_temp)
|
||||
debug_echo "SoC temp: $temp [low: $low, high: $high]"
|
||||
if [ $temp -gt $high ]; then
|
||||
debug_echo "SoC temp exceeds $high celsius, fan on"
|
||||
fan_on
|
||||
fi
|
||||
|
||||
if [ $temp -lt $low ]; then
|
||||
debug_echo "SoC temp below $low celsius, fan off"
|
||||
fan_off
|
||||
fi
|
||||
|
||||
sleep $interval
|
||||
done
|
@ -1,13 +0,0 @@
|
||||
[Unit]
|
||||
Description=i.MX6 SoC fan monitor service
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -c "exec /bin/sh /usr/lib/libreelec/imx6-soc-fan-monitor"
|
||||
RestartPreventExitStatus=12
|
||||
TimeoutStopSec=5
|
||||
Restart=always
|
||||
RestartSec=60
|
||||
StartLimitInterval=0
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user