base-files: add support for heartbeat led trigger
authorAlexey Smirnov <s.alexey@gmail.com>
Tue, 4 Jan 2022 07:11:51 +0000 (10:11 +0300)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 24 Sep 2022 16:00:12 +0000 (18:00 +0200)
This patch adds support for creation heartbeat led trigger with,
for example, this command:

ucidef_set_led_heartbeat "..." "..." "..."

from /etc/board.d/01_leds.

Signed-off-by: Alexey Smirnov <s.alexey@gmail.com>
(cherry picked from commit 66071729a27919e555752fce25210b1b035eb319)

package/base-files/files/lib/functions/uci-defaults.sh

index 02882f43ca4ed719a1f84144c1d8ea67fa7f1553..f96e645e73ccc4401115bd7b307e333730c396b9 100644 (file)
@@ -418,6 +418,15 @@ ucidef_set_led_default() {
        json_select ..
 }
 
+ucidef_set_led_heartbeat() {
+       _ucidef_set_led_common "$1" "$2" "$3"
+
+       json_add_string trigger heartbeat
+       json_select ..
+
+       json_select ..
+}
+
 ucidef_set_led_gpio() {
        local gpio="$4"
        local inverted="$5"