[openwrt/openwrt] pistachio: use generic diag.sh

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 21 08:59:55 EDT 2020


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/373d4cc3605196c93cee18cfcfbd70f80c87cf8c

commit 373d4cc3605196c93cee18cfcfbd70f80c87cf8c
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Thu Aug 20 22:18:41 2020 +0200

    pistachio: use generic diag.sh
    
    Remove local diag.sh in favor of generic one and add the required
    led-* aliases to DTS.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/pistachio/base-files/etc/diag.sh      | 30 ----------------------
 .../905-MIPS-DTS-img-marduk-Add-led-aliases.patch  | 27 +++++++++++++++++++
 2 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/target/linux/pistachio/base-files/etc/diag.sh b/target/linux/pistachio/base-files/etc/diag.sh
deleted file mode 100755
index ed69d43385..0000000000
--- a/target/linux/pistachio/base-files/etc/diag.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-. /lib/functions/leds.sh
-
-status_led="marduk:red:heartbeat"
-
-set_state() {
-
-	case "$1" in
-	preinit)
-		status_led_blink_preinit
-		;;
-	failsafe)
-		status_led_blink_failsafe
-		;;
-	upgrade | \
-	preinit_regular)
-		status_led_blink_preinit_regular
-		;;
-	done)
-		status_led_on
-		;;
-	esac
-}
diff --git a/target/linux/pistachio/patches-5.4/905-MIPS-DTS-img-marduk-Add-led-aliases.patch b/target/linux/pistachio/patches-5.4/905-MIPS-DTS-img-marduk-Add-led-aliases.patch
new file mode 100644
index 0000000000..c6cf5acbb8
--- /dev/null
+++ b/target/linux/pistachio/patches-5.4/905-MIPS-DTS-img-marduk-Add-led-aliases.patch
@@ -0,0 +1,27 @@
+--- a/arch/mips/boot/dts/img/pistachio_marduk.dts
++++ b/arch/mips/boot/dts/img/pistachio_marduk.dts
+@@ -19,6 +19,11 @@
+ 		ethernet0 = &enet;
+ 		spi0 = &spfi0;
+ 		spi1 = &spfi1;
++
++		led-boot = &led_heartbeat;
++		led-failsafe = &led_heartbeat;
++		led-running = &led_heartbeat;
++		led-upgrade = &led_heartbeat;
+ 	};
+ 
+ 	chosen {
+@@ -88,11 +93,10 @@
+ 
+ 	leds {
+ 		compatible = "pwm-leds";
+-		heartbeat {
++		led_heartbeat: heartbeat {
+ 			label = "marduk:red:heartbeat";
+ 			pwms = <&pwm 3 300000>;
+ 			max-brightness = <255>;
+-			linux,default-trigger = "heartbeat";
+ 		};
+ 	};
+ 



More information about the lede-commits mailing list