mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge pull request #4379 from vpeter4/system_type
imx6: redo system type service to start early
This commit is contained in:
commit
d51b456312
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -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"
|
||||
|
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"
|
||||
;;
|
||||
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]
|
||||
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]
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user