[OpenWrt-Devel] [PATCH] x86: fix missing led variable warning during boot

Petr Štetiar ynezz at true.cz
Sun Jun 23 12:11:00 EDT 2019


Fixes following warning during the boot:

 WARNING: Variable 'led' does not exist or is not an array/object

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 target/linux/x86/base-files/etc/diag.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/x86/base-files/etc/diag.sh b/target/linux/x86/base-files/etc/diag.sh
index 3af4b235837b..d043e4f03535 100644
--- a/target/linux/x86/base-files/etc/diag.sh
+++ b/target/linux/x86/base-files/etc/diag.sh
@@ -20,6 +20,8 @@ preinit_match_diag_led() {
 	json_init
 	json_load "$(cat $CFG)"
 	json_get_keys keys led
+	json_is_a led object || return
+
 	json_select led
 	for key in $keys; do
 		json_select "$key"
-- 
1.9.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list