X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=target%2Flinux%2Fipq806x%2Fbase-files%2Flib%2Fipq806x.sh;h=ea45381d91c2fbedab833b76e4597ade7200dbea;hb=4bdf615878dd98106b3fdb9e092f7349b1a8d39f;hp=0b11b721a751d4ef431cedcd93264168974181f6;hpb=36afaae847135144611962eafd33e9c69ff5e1e2;p=lede-git%2F.git diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh index 0b11b721a7..ea45381d91 100644 --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh @@ -59,3 +59,15 @@ ipq806x_board_name() { echo "$name" } + +ipq806x_get_dt_led() { + local label + local ledpath + local basepath="/sys/firmware/devicetree/base" + local nodepath="$basepath/aliases/led-$1" + + [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") + [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") + + echo "$label" +}