busybox: add ledfix script/service

This commit is contained in:
chewitt
2020-05-03 12:16:41 +00:00
parent 244f2b4815
commit 25e7ecaa43
3 changed files with 40 additions and 1 deletions

View 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