. /lib/functions/leds.sh
-status_led="$(get_dt_led status)"
+boot="$(get_dt_led boot)"
+failsafe="$(get_dt_led failsafe)"
+running="$(get_dt_led running)"
+upgrade="$(get_dt_led upgrade)"
+
+get_status_led() {
+ status_led="$boot"
+}
set_state() {
+ status_led="$boot"
+
case "$1" in
preinit)
status_led_blink_preinit
;;
failsafe)
+ status_led_off
+ [ -n "$running" ] && {
+ status_led="$running"
+ status_led_off
+ }
+ status_led="$failsafe"
status_led_blink_failsafe
;;
preinit_regular)
status_led_blink_preinit_regular
;;
+ upgrade)
+ [ -n "$running" ] && {
+ status_led="$upgrade"
+ status_led_blink_preinit_regular
+ }
+ ;;
done)
- status_led_on
+ status_led_off
+ [ -n "$running" ] && {
+ status_led="$running"
+ status_led_on
+ }
;;
esac
}
model = "D-Link DIR825B1";
aliases {
- led-status = &orange_power;
+ led-boot = &orange_power;
+ led-failsafe = &orange_power;
+ led-running = &orange_power;
+ led-upgrade = &orange_power;
};
chosen {
/ {
aliases {
- led-status = &power_green;
+ led-boot = &power_green;
+ led-failsafe = &power_green;
+ led-running = &power_green;
+ led-upgrade = &power_green;
};
chosen {
model = "Netgear WNR612 V2";
aliases {
- led-status = &led_power;
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
+ led-upgrade = &power;
};
gpio-keys-polled {
gpio-leds {
compatible = "gpio-leds";
- led_power: power {
+ power: power {
label = "netgear:green:power";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
/ {
aliases {
- led-status = &led_system;
+ led-boot = &led_system;
+ led-failsafe = &led_system;
+ led-running = &led_system;
+ led-upgrade = &led_system;
};
gpio-keys-polled {
/ {
aliases {
- led-status = &led_system;
+ led-boot = &led_system;
+ led-failsafe = &led_system;
+ led-running = &led_system;
+ led-upgrade = &led_system;
};
gpio-keys-polled {
model = "Ubiquiti UniFi AP";
aliases {
- led-status = &dome_green;
+ led-boot = &dome_green;
+ led-failsafe = &dome_green;
+ led-running = &dome_green;
+ led-upgrade = &dome_green;
};
extosc: ref {
model = "AVM FRITZ!WLAN Repeater 300E";
aliases {
- led-status = &power;
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
+ led-upgrade = &power;
};
gpio-keys {
model = "TP-LINK TL-WR2543N/ND";
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
chosen {
model = "TP-Link TL-WR1043ND Version 1";
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
extosc: ref {
model = "TP-Link TL-WR941N/ND v2/v3";
aliases {
- led-status = &led_system;
+ led-boot = &led_system;
+ led-failsafe = &led_system;
+ led-running = &led_system;
+ led-upgrade = &led_system;
};
keys {
aliases {
serial0 = &uart;
- led-status = &wlan;
+ led-boot = &wlan;
+ led-failsafe = &wlan;
+ led-upgrade = &wlan;
};
leds {
compatible = "embeddedwireless,dorin", "qca,ar9331";
aliases {
- led-status = &status;
+ led-boot = &status;
+ led-failsafe = &status;
+ led-running = &status;
+ led-upgrade = &status;
serial0 = &uart;
};
aliases {
serial0 = &uart;
- led-status = &led_system;
+ led-boot = &led_system;
+ led-failsafe = &led_system;
+ led-running = &led_system;
+ led-upgrade = &led_system;
};
gpio-keys-polled {
aliases {
serial0 = &uart;
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
leds {
/ {
aliases {
serial0 = &uart;
- led-status = &led_system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
gpio-keys-polled {
gpio-leds {
compatible = "gpio-leds";
- led_system: system {
+ system: system {
label = "tl-wr703n:blue:system";
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
};
aliases {
serial0 = &uart;
- led-status = &led_system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
gpio-keys-polled {
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
- led_system: system {
+ system: system {
label = "tp-link:green:system";
gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
};
aliases {
serial0 = &uart;
- led-status = &status;
+ led-boot = &status;
+ led-failsafe = &status;
+ led-running = &status;
+ led-upgrade = &status;
};
keys {
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
leds {
aliases {
serial0 = &uart;
- led-status = &status;
+ led-boot = &status;
+ led-failsafe = &status;
+ led-running = &status;
+ led-upgrade = &status;
};
keys {
aliases {
serial0 = &uart;
- led-status = &status;
+ led-boot = &status;
+ led-failsafe = &status;
+ led-running = &status;
+ led-upgrade = &status;
};
keys {
compatible = "tplink,tl-wdr4300";
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
leds {
model = "TP-Link TL-WR841N/ND Version 11";
aliases {
- led-status = &system_led;
+ led-boot = &system_led;
+ led-failsafe = &system_led;
+ led-running = &system_led;
+ led-upgrade = &system_led;
};
};
model = "TP-Link TL-WR841N/ND Version 9";
aliases {
- led-status = &qss_led;
+ led-boot = &qss_led;
+ led-failsafe = &qss_led;
+ led-running = &qss_led;
+ led-upgrade = &qss_led;
};
};
model = "I-O DATA WN-AC1600DGR2";
aliases {
- led-status = &power;
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
+ led-upgrade = &power;
};
chosen {
model = "Buffalo BHR-4GRV2";
aliases {
- led-status = &power;
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
+ led-upgrade = &power;
};
chosen {
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
leds {
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
gpio_leds: leds {
};
aliases {
- led-status = &led_system;
+ led-boot = &led_system;
+ led-failsafe = &led_system;
+ led-running = &led_system;
+ led-upgrade = &led_system;
};
gpio_leds: leds {
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
leds {
compatible = "phicomm,k2t";
aliases {
- led-status = &status_red;
+ led-boot = &status_red;
+ led-failsafe = &status_red;
+ led-running = &status_red;
+ led-upgrade = &status_red;
};
chosen {
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
mdio-gpio0 = &mdio2;
};
};
aliases {
- led-status = &system;
+ led-boot = &system;
+ led-failsafe = &system;
+ led-running = &system;
+ led-upgrade = &system;
};
gpio_leds: leds {