mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
imx6: redo status led and fan services
This commit is contained in:
parent
6d3a583c10
commit
a91c7fb009
@ -18,11 +18,11 @@
|
|||||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
. /etc/profile
|
. /usr/lib/openelec/imx6-system-type
|
||||||
|
|
||||||
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
||||||
echo "Only for TBS Matrix system."
|
echo "Only for TBS Matrix system."
|
||||||
exit 1
|
exit 12
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fan_on() {
|
fan_on() {
|
||||||
|
@ -23,7 +23,7 @@ PKG_ARCH="arm"
|
|||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="http://www.openelec.tv/"
|
PKG_SITE="http://www.openelec.tv/"
|
||||||
PKG_URL=""
|
PKG_URL=""
|
||||||
PKG_DEPENDS_TARGET=""
|
PKG_DEPENDS_TARGET="imx6-status-led"
|
||||||
PKG_PRIORITY="optional"
|
PKG_PRIORITY="optional"
|
||||||
PKG_SECTION="system"
|
PKG_SECTION="system"
|
||||||
PKG_SHORTDESC="i.MX6 SoC fan monitor"
|
PKG_SHORTDESC="i.MX6 SoC fan monitor"
|
||||||
@ -37,9 +37,13 @@ make_target() {
|
|||||||
|
|
||||||
makeinstall_target() {
|
makeinstall_target() {
|
||||||
mkdir -p $INSTALL/usr/config
|
mkdir -p $INSTALL/usr/config
|
||||||
cp -PR $PKG_DIR/config/* $INSTALL/usr/config
|
cp $PKG_DIR/config/* $INSTALL/usr/config
|
||||||
|
|
||||||
mkdir -p $INSTALL/usr/bin
|
mkdir -p $INSTALL/usr/bin
|
||||||
cp -PR $PKG_DIR/bin/* $INSTALL/usr/bin
|
cp $PKG_DIR/bin/* $INSTALL/usr/bin
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/lib/openelec
|
||||||
|
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/openelec
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
. /etc/profile
|
. /usr/lib/openelec/imx6-system-type
|
||||||
|
|
||||||
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
if [ "$SYSTEM_TYPE" != "matrix" ]; then
|
||||||
echo "Only for TBS Matrix system."
|
echo "Only for TBS Matrix system."
|
||||||
exit 1
|
exit 12
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debug_echo() {
|
debug_echo() {
|
@ -2,7 +2,12 @@
|
|||||||
Description=i.MX6 SoC fan monitor service
|
Description=i.MX6 SoC fan monitor service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/imx6-soc-fan-monitor
|
ExecStart=/bin/sh -c "exec /bin/sh /usr/lib/openelec/imx6-soc-fan-monitor"
|
||||||
|
RestartPreventExitStatus=12
|
||||||
|
TimeoutStopSec=5
|
||||||
|
Restart=always
|
||||||
|
RestartSec=60
|
||||||
|
StartLimitInterval=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -36,8 +36,8 @@ make_target() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
makeinstall_target() {
|
makeinstall_target() {
|
||||||
mkdir -p $INSTALL/usr/bin
|
mkdir -p $INSTALL/usr/lib/openelec
|
||||||
cp -PR $PKG_DIR/bin/* $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/openelec
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
. /etc/profile
|
. /usr/lib/openelec/imx6-system-type
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"on")
|
"on")
|
||||||
@ -28,22 +28,21 @@ case "$1" in
|
|||||||
TRIGGER=heartbeat
|
TRIGGER=heartbeat
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
TRIGGER=""
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$SYSTEM_TYPE" in
|
case "$SYSTEM_TYPE" in
|
||||||
"matrix")
|
"matrix")
|
||||||
LED=/sys/class/leds/red/trigger
|
LED="/sys/class/leds/red/trigger"
|
||||||
;;
|
;;
|
||||||
"cuboxi")
|
"cuboxi")
|
||||||
LED=/sys/class/leds/imx6\:red\:front/trigger
|
LED="/sys/class/leds/imx6:red:front/trigger"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
LED=""
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -n "$TRIGGER" -a -n "$LED" ]; then
|
echo "$TRIGGER" > "$LED"
|
||||||
echo $TRIGGER > $LED
|
|
||||||
fi
|
|
6
packages/sysutils/imx6-status-led/profile.d/01-system_type.conf → packages/sysutils/imx6-status-led/scripts/imx6-system-type
Normal file → Executable file
6
packages/sysutils/imx6-status-led/profile.d/01-system_type.conf → packages/sysutils/imx6-status-led/scripts/imx6-system-type
Normal file → Executable file
@ -42,9 +42,3 @@ case "$SYSTEM_TYPE" in
|
|||||||
export SYSTEM_TYPE="undef"
|
export SYSTEM_TYPE="undef"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# don't make from initramfs (no touch there)
|
|
||||||
if [ -e /bin/touch ]; then
|
|
||||||
mkdir -p /var/run
|
|
||||||
touch /var/run/system_type_$SYSTEM_TYPE
|
|
||||||
fi
|
|
@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=i.MX6 status LED service
|
Description=i.MX6 status led
|
||||||
After=kodi.service
|
After=kodi.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=-/bin/sh -c "/usr/bin/imx6-status-led on"
|
ExecStart=-/bin/sh -c "/usr/lib/openelec/imx6-status-led on"
|
||||||
ExecStop=-/bin/sh -c "/usr/bin/imx6-status-led heartbeat"
|
ExecStop=-/bin/sh -c "/usr/lib/openelec/imx6-status-led heartbeat"
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -32,11 +32,9 @@ if [ -z "$BOOT_DISK" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# we don't have mounted /etc in initramfs so just load system type
|
|
||||||
if [ -f $SYSTEM_ROOT/etc/profile.d/01-system_type.conf ]; then
|
|
||||||
. $SYSTEM_ROOT/etc/profile.d/01-system_type.conf
|
|
||||||
else
|
|
||||||
SYSTEM_TYPE=""
|
SYSTEM_TYPE=""
|
||||||
|
if [ -f $SYSTEM_ROOT/usr/lib/openelec/imx6-system-type ]; then
|
||||||
|
. $SYSTEM_ROOT/usr/lib/openelec/imx6-system-type
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mount $BOOT_ROOT r/w
|
# mount $BOOT_ROOT r/w
|
||||||
|
Loading…
x
Reference in New Issue
Block a user