imx6: redo status led and fan services

This commit is contained in:
Peter Vicman 2015-10-15 08:37:52 +02:00
parent 6d3a583c10
commit a91c7fb009
9 changed files with 32 additions and 32 deletions

View File

@ -18,11 +18,11 @@
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
. /usr/lib/openelec/imx6-system-type
if [ "$SYSTEM_TYPE" != "matrix" ]; then
echo "Only for TBS Matrix system."
exit 1
exit 12
fi
fan_on() {

View File

@ -23,7 +23,7 @@ PKG_ARCH="arm"
PKG_LICENSE="GPL"
PKG_SITE="http://www.openelec.tv/"
PKG_URL=""
PKG_DEPENDS_TARGET=""
PKG_DEPENDS_TARGET="imx6-status-led"
PKG_PRIORITY="optional"
PKG_SECTION="system"
PKG_SHORTDESC="i.MX6 SoC fan monitor"
@ -37,9 +37,13 @@ make_target() {
makeinstall_target() {
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
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() {

View File

@ -18,11 +18,11 @@
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
. /usr/lib/openelec/imx6-system-type
if [ "$SYSTEM_TYPE" != "matrix" ]; then
echo "Only for TBS Matrix system."
exit 1
exit 12
fi
debug_echo() {

View File

@ -2,7 +2,12 @@
Description=i.MX6 SoC fan monitor 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]
WantedBy=multi-user.target

View File

@ -36,8 +36,8 @@ make_target() {
}
makeinstall_target() {
mkdir -p $INSTALL/usr/bin
cp -PR $PKG_DIR/bin/* $INSTALL/usr/bin
mkdir -p $INSTALL/usr/lib/openelec
cp $PKG_DIR/scripts/* $INSTALL/usr/lib/openelec
}
post_install() {

View File

@ -18,7 +18,7 @@
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
. /usr/lib/openelec/imx6-system-type
case "$1" in
"on")
@ -28,22 +28,21 @@ case "$1" in
TRIGGER=heartbeat
;;
*)
TRIGGER=""
exit 0
;;
esac
case "$SYSTEM_TYPE" in
"matrix")
LED=/sys/class/leds/red/trigger
LED="/sys/class/leds/red/trigger"
;;
"cuboxi")
LED=/sys/class/leds/imx6\:red\:front/trigger
LED="/sys/class/leds/imx6:red:front/trigger"
;;
*)
LED=""
exit 0
;;
esac
if [ -n "$TRIGGER" -a -n "$LED" ]; then
echo $TRIGGER > $LED
fi
echo "$TRIGGER" > "$LED"

View File

@ -42,9 +42,3 @@ case "$SYSTEM_TYPE" in
export SYSTEM_TYPE="undef"
;;
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

View File

@ -1,11 +1,11 @@
[Unit]
Description=i.MX6 status LED service
Description=i.MX6 status led
After=kodi.service
[Service]
Type=oneshot
ExecStart=-/bin/sh -c "/usr/bin/imx6-status-led on"
ExecStop=-/bin/sh -c "/usr/bin/imx6-status-led heartbeat"
ExecStart=-/bin/sh -c "/usr/lib/openelec/imx6-status-led on"
ExecStop=-/bin/sh -c "/usr/lib/openelec/imx6-status-led heartbeat"
RemainAfterExit=yes
[Install]

View File

@ -32,11 +32,9 @@ if [ -z "$BOOT_DISK" ]; then
esac
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
# mount $BOOT_ROOT r/w