The chosen node is clearly the wrong place for aliases.
Signed-off-by: Mathias Kresin <dev@kresin.me>
local label
local ledpath
local basepath="/sys/firmware/devicetree/base"
- local nodepath="$basepath/chosen/leds/$1"
+ local nodepath="$basepath/aliases/led-$1"
[ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
[ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label")
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power2;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power2;
+ led-running = &power;
- dsl = &adsl;
- internet = &internet;
- usb = &usb;
- usb2 = &usb2;
- wifi = &wifi;
- };
+ led-dsl = &adsl;
+ led-internet = &internet;
+ led-usb = &usb;
+ led-usb2 = &usb2;
+ led-wifi = &wifi;
};
memory@0 {
/ {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
- dsl = &dsl;
- internet = &online;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &internet_green;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &internet_green;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_blue;
- failsafe = &power_red;
- running = &power_blue;
+ aliases {
+ led-boot = &power_blue;
+ led-failsafe = &power_red;
+ led-running = &power_blue;
- dsl = &dsl;
- internet = &internet_blue;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &internet_blue;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
/ {
model = "ARV4525PW - Speedport W501V Typ A";
- chosen {
- leds {
- /* we dont have a power led, lets use the online led */
- boot = &online;
- failsafe = &online;
-
- dsl = &dsl;
- internet = &online;
- wifi = &wifi;
- };
+ aliases {
+ /* we dont have a power led, lets use the online led */
+ led-boot = &online;
+ led-failsafe = &online;
+
+ led-dsl = &dsl;
+ led-internet = &online;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_blue;
- failsafe = &power_red;
- running = &power_blue;
+ aliases {
+ led-boot = &power_blue;
+ led-failsafe = &power_red;
+ led-running = &power_blue;
- internet = &dsl_blue;
- usb = &usb;
- wifi = &wifi;
- };
+ led-internet = &dsl_blue;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
lantiq,pull = <0>;
lantiq,output = <1>;
};
- leds {
+ aliases {
lantiq,pins = "io3", "io5", "io6", "io7", "io9";
lantiq,output = <1>;
};
/ {
model = "ARV7506PW11 - Alice/O2 IAD 4421";
- chosen {
- leds {
- boot = &power;
- failsafe = &power_red;
- running = &power;
-
- dsl = &dsl;
- internet = &internet;
- wifi = &wlan;
- };
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power_red;
+ led-running = &power;
+
+ led-dsl = &dsl;
+ led-internet = &internet;
+ led-wifi = &wlan;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
- internet = &internet;
- wifi = &wlan;
- };
+ led-internet = &internet;
+ led-wifi = &wlan;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &online_green;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online_green;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
lantiq,pull = <2>;
lantiq,output = <1>;
};
- leds {
+ aliases {
lantiq,pins = "io2", "io4", "io5", "io6", "io7", "io8", "io19";
lantiq,output = <1>;
};
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power2;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power2;
+ led-running = &power;
- dsl = &dsl;
- internet = &online;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_green;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_green;
+ led-running = &power_green;
- internet = &internet_green;
- };
+ led-internet = &internet_green;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &power_green;
- internet = &online;
- wifi = &wifi;
- };
+ led-dsl = &power_green;
+ led-internet = &online;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_red;
- failsafe = &power_blue;
- running = &power_red;
+ aliases {
+ led-boot = &power_red;
+ led-failsafe = &power_blue;
+ led-running = &power_red;
- internet = &internet_red;
- wifi = &wifi;
- };
+ led-internet = &internet_red;
+ led-wifi = &wifi;
};
memory@0 {
lantiq,pull = <2>;
lantiq,output = <1>;
};
- leds {
+ aliases {
lantiq,pins = "io3", "io5", "io6", "io8";
lantiq,output = <1>;
lantiq,pull = <0>;
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_red;
- failsafe = &power_blue;
- running = &power_red;
+ aliases {
+ led-boot = &power_red;
+ led-failsafe = &power_blue;
+ led-running = &power_red;
- internet = &internet_red;
- wifi = &wifi;
- };
+ led-internet = &internet_red;
+ led-wifi = &wifi;
};
memory@0 {
lantiq,open-drain = <1>;
lantiq,output = <1>;
};
- leds {
+ aliases {
lantiq,pins = "io3", "io5", "io6", "io8";
lantiq,open-drain = <1>;
lantiq,output = <1>;
/ {
model = "ARV8539PW22 - Speedport W 504V Typ A";
- chosen {
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
-
- dsl = &dsl_green;
- internet = &online_green;
- wifi = &wireless_green;
- };
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
+
+ dsl = &dsl_green;
+ internet = &online_green;
+ wifi = &wireless_green;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_orange;
- failsafe = &power_red;
- running = &power_blue;
+ aliases {
+ led-boot = &power_orange;
+ led-failsafe = &power_red;
+ led-running = &power_blue;
- internet = &broadband_blue;
- wifi = &wireless_blue;
- };
+ led-internet = &broadband_blue;
+ led-wifi = &wireless_blue;
};
memory@0 { /* RAM: Samsung K4H511638F-LC 64MB */
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_orange;
- failsafe = &power_red;
- running = &power_blue;
+ aliases {
+ led-boot = &power_orange;
+ led-failsafe = &power_red;
+ led-running = &power_blue;
- internet = &broadband_blue;
- wifi = &wireless_blue;
- };
+ led-internet = &broadband_blue;
+ led-wifi = &wireless_blue;
};
memory@0 { /* RAM: Samsung K4H511638F-LC 64MB */
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_blue;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_blue;
- internet = &broadband_blue;
- wifi = &wireless_blue;
- };
+ led-internet = &broadband_blue;
+ led-wifi = &wireless_blue;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
- leds {
- boot = &power;
- failsafe = &power;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
- dsl = &dsl;
- internet = &online_green;
+ led-dsl = &dsl;
+ led-internet = &online_green;
};
};
/ {
chosen {
bootargs = "root= console=ttyLTQ0,115200";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &internet;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &internet;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
/ {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
- usb = &usb1;
- usb2 = &usb2;
- };
+ led-usb = &usb1;
+ led-usb2 = &usb2;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 ubi.mtd=1,512 root=/dev/mtdblock9";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &info_green;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &info_green;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power;
- running = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
+ led-running = &power;
- internet = &info_green;
- dsl = &power;
- wifi = &wlan;
- };
+ led-internet = &info_green;
+ led-dsl = &power;
+ led-wifi = &wlan;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- internet = &info_green;
- dsl = &power_green;
- wifi = &wifi;
- };
+ led-internet = &info_green;
+ led-dsl = &power_green;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_green;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_green;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &online;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &online;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online;
+ led-wifi = &wifi;
};
memory@0 {
/ {
model = "P2812HNUF1 - ZyXEL P-2812HNU-F1";
- chosen {
- leds {
- usb = &usb1;
- usb2 = &usb2;
- };
+ aliases {
+ led-usb = &usb1;
+ led-usb2 = &usb2;
};
fpi@10000000 {
/ {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl_green;
- internet = &internet_green;
- wifi = &wireless_green;
- };
+ led-dsl = &dsl_green;
+ led-internet = &internet_green;
+ led-wifi = &wireless_green;
};
cputemp@0 {
/ {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- /* the power led can't be controlled, use the wps led instead */
- boot = &wps;
- failsafe = &wps;
+ aliases {
+ /* the power led can't be controlled, use the wps led instead */
+ led-boot = &wps;
+ led-failsafe = &wps;
- dsl = &dsl;
- internet = &internet;
- usb = &usb0;
- usb2 = &usb2;
- };
+ led-dsl = &dsl;
+ led-internet = &internet;
+ led-usb = &usb0;
+ led-usb2 = &usb2;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- internet = &dsl;
- };
+ led-internet = &dsl;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &internet_green;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &internet_green;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &broadband_green;
- internet = &internet_green;
- wifi = &wireless_green;
- };
+ led-dsl = &broadband_green;
+ led-internet = &internet_green;
+ led-wifi = &wireless_green;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power;
- failsafe = &power;
+ aliases {
+ led-boot = &power;
+ led-failsafe = &power;
- dsl = &dsl;
- internet = &internet;
- usb = &usb;
- usb2 = &usb;
- };
+ led-dsl = &dsl;
+ led-internet = &internet;
+ led-usb = &usb;
+ led-usb2 = &usb;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_green;
- failsafe = &power_red;
- running = &power_green;
+ aliases {
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
- dsl = &dsl;
- internet = &online_green;
- usb = &usb;
- wifi = &wifi;
- };
+ led-dsl = &dsl;
+ led-internet = &online_green;
+ led-usb = &usb;
+ led-wifi = &wifi;
};
memory@0 {
chosen {
bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
+ };
- leds {
- boot = &power_g;
- failsafe = &diag_r;
- running = &power_g;
+ aliases {
+ led-boot = &power_g;
+ led-failsafe = &diag_r;
+ led-running = &power_g;
- dsl = &dsl;
- internet = &router_g;
- wifi = &wifi_g;
- };
+ led-dsl = &dsl;
+ led-internet = &router_g;
+ led-wifi = &wifi_g;
};
memory@0 {