base-files: move uci_set_poe() to uci-defaults.sh
authorSander Vanheule <sander@svanheule.net>
Wed, 24 Jan 2024 10:20:08 +0000 (11:20 +0100)
committerSander Vanheule <sander@svanheule.net>
Mon, 12 Feb 2024 19:46:51 +0000 (20:46 +0100)
PoE devices in the realtek target have the possibility to add PSE info
to the board description via 02_network. Make this available for all
targets, by moving the uci_set_poe() function to the globally available
uci-default.sh script.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
package/base-files/files/lib/functions/uci-defaults.sh
target/linux/realtek/base-files/etc/board.d/02_network

index a75bd116525b7e0988cfe329cb933b5cfd215a11..b89cc8e9e309abbb187a4d93a0aa49e08e6c180b 100644 (file)
@@ -654,6 +654,17 @@ ucidef_set_ntpserver() {
        json_select ..
 }
 
+ucidef_set_poe() {
+       json_select_object poe
+               json_add_string "budget" "$1"
+               json_select_array ports
+                       for port in $2; do
+                               json_add_string "" "$port"
+                       done
+               json_select ..
+       json_select ..
+}
+
 ucidef_add_wlan() {
        local path="$1"; shift
 
index 1c1e4e9cd2238a0049bd6acb6bddb1707ef5da83..db1d99f4ec313ed94195167cf58575aaf33f3dab 100644 (file)
@@ -3,17 +3,6 @@
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
 
-ucidef_set_poe() {
-       json_select_object poe
-               json_add_string "budget" "$1"
-               json_select_array ports
-                       for port in $2; do
-                               json_add_string "" "$port"
-                       done
-               json_select ..
-       json_select ..
-}
-
 _filter_port_list_ordered() {
        local ports="$1"
        local excluded="$2"