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

@ -127,6 +127,7 @@ makeinstall_target() {
cp $PKG_DIR/scripts/dtfile $INSTALL/usr/bin
cp $PKG_DIR/scripts/dtname $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/apt-get $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_group nogroup 65534
enable_service fs-resize.service
enable_service ledfix.service
enable_service shell.service
enable_service show-version.service
enable_service var.mount
enable_service fs-resize.service
listcontains "${FIRMWARE}" "rpi-eeprom" && enable_service rpi-flash-firmware.service
# cron support

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

View 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