[openwrt/openwrt] base-files: move uci_set_poe() to uci-defaults.sh
LEDE Commits
lede-commits at lists.infradead.org
Mon Feb 12 11:56:33 PST 2024
svanheule pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6f83a708c8f1df14da9a24609d32bd7263d1798b
commit 6f83a708c8f1df14da9a24609d32bd7263d1798b
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Wed Jan 24 11:20:08 2024 +0100
base-files: move uci_set_poe() to uci-defaults.sh
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 at svanheule.net>
---
package/base-files/files/lib/functions/uci-defaults.sh | 11 +++++++++++
target/linux/realtek/base-files/etc/board.d/02_network | 11 -----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index a75bd11652..b89cc8e9e3 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -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
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index 1c1e4e9cd2..db1d99f4ec 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -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"
More information about the lede-commits
mailing list