mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 22:47:51 +00:00
busybox: add ledfix script/service
This commit is contained in:
parent
244f2b4815
commit
25e7ecaa43
@ -127,6 +127,7 @@ makeinstall_target() {
|
|||||||
cp $PKG_DIR/scripts/dtfile $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/dtfile $INSTALL/usr/bin
|
||||||
cp $PKG_DIR/scripts/dtname $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/dtname $INSTALL/usr/bin
|
||||||
cp $PKG_DIR/scripts/dtsoc $INSTALL/usr/bin
|
cp $PKG_DIR/scripts/dtsoc $INSTALL/usr/bin
|
||||||
|
cp $PKG_DIR/scripts/ledfix $INSTALL/usr/bin
|
||||||
cp $PKG_DIR/scripts/lsb_release $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/lsb_release $INSTALL/usr/bin/
|
||||||
cp $PKG_DIR/scripts/apt-get $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/apt-get $INSTALL/usr/bin/
|
||||||
cp $PKG_DIR/scripts/sudo $INSTALL/usr/bin/
|
cp $PKG_DIR/scripts/sudo $INSTALL/usr/bin/
|
||||||
@ -174,10 +175,11 @@ post_install() {
|
|||||||
add_user nobody x 65534 65534 "Nobody" "/" "/bin/sh"
|
add_user nobody x 65534 65534 "Nobody" "/" "/bin/sh"
|
||||||
add_group nogroup 65534
|
add_group nogroup 65534
|
||||||
|
|
||||||
|
enable_service fs-resize.service
|
||||||
|
enable_service ledfix.service
|
||||||
enable_service shell.service
|
enable_service shell.service
|
||||||
enable_service show-version.service
|
enable_service show-version.service
|
||||||
enable_service var.mount
|
enable_service var.mount
|
||||||
enable_service fs-resize.service
|
|
||||||
listcontains "${FIRMWARE}" "rpi-eeprom" && enable_service rpi-flash-firmware.service
|
listcontains "${FIRMWARE}" "rpi-eeprom" && enable_service rpi-flash-firmware.service
|
||||||
|
|
||||||
# cron support
|
# cron support
|
||||||
|
23
packages/sysutils/busybox/scripts/ledfix
Executable file
23
packages/sysutils/busybox/scripts/ledfix
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
# find heartbeat triggers and set them to none
|
||||||
|
case $(dtsoc) in
|
||||||
|
amlogic*)
|
||||||
|
for triggerfile in $(find /sys/devices/platform/leds -name trigger); do
|
||||||
|
trigger=$(awk -F'[][]' '{print $2}' "$triggerfile")
|
||||||
|
if [ "$trigger" = "heartbeat" ]; then
|
||||||
|
echo "none" > "$triggerfile"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# add device-specific led handling here
|
||||||
|
case $(dtname) in
|
||||||
|
khadas,vim3*)
|
||||||
|
echo "255" > /sys/devices/platform/leds/leds/vim3\:red/brightness
|
||||||
|
;;
|
||||||
|
esac
|
14
packages/sysutils/busybox/system.d/ledfix.service
Normal file
14
packages/sysutils/busybox/system.d/ledfix.service
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=LEDfix Service
|
||||||
|
After=network-online.target graphical.target
|
||||||
|
Requires=graphical.target
|
||||||
|
Wants=kodi.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/sh /usr/bin/ledfix
|
||||||
|
RemainAfterExit=yes
|
||||||
|
StartLimitInterval=0
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=kodi.target
|
Loading…
x
Reference in New Issue
Block a user