summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaweł Owoc2025-05-16 13:58:28 +0000
committerHauke Mehrtens2025-06-26 21:12:20 +0000
commit68527d87cc91a3ce53d6af62a0ef3c860944c7d6 (patch)
treeb5d9ca48a29c28105b6484855a615d332b517006
parent35a4608a308a7979acd62d300b74f569dc3f11c1 (diff)
downloadopenwrt-68527d87cc91a3ce53d6af62a0ef3c860944c7d6.tar.gz
uboot-tools: move ubootenv_add_* functions to common functions
Functions ubootenv_add_mtd, ubootenv_add_sys_mtd and ubootenv_add_mmc can be shared so make them common. Signed-off-by: Paweł Owoc <frut3k7@gmail.com> Link: https://github.com/openwrt/openwrt/pull/18818 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx6
-rw-r--r--package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x18
-rw-r--r--package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh18
3 files changed, 18 insertions, 24 deletions
diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx
index 0bfc7e7cf8..a06ffc1f36 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx
@@ -7,12 +7,6 @@ touch /etc/config/ubootenv
board=$(board_name)
-ubootenv_add_mtd() {
- local idx="$(find_mtd_index "${1}")"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "${2}" "${3}" "${4}"
-}
-
case "$board" in
8devices,mango-dvk|\
8devices,mango-dvk-sfp|\
diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
index 723b0981c4..ae0946190d 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
@@ -7,24 +7,6 @@ touch /etc/config/ubootenv
board=$(board_name)
-ubootenv_add_mtd() {
- local idx="$(find_mtd_index "${1}")"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "${2}" "${3}" "${4}"
-}
-
-ubootenv_add_sys_mtd() {
- local idx="$(find_mtd_index "${1}")"
- [ -n "$idx" ] && \
- ubootenv_add_uci_sys_config "/dev/mtd$idx" "${2}" "${3}" "${4}"
-}
-
-ubootenv_add_mmc() {
- local mmcpart="$(find_mmc_part "${1}")"
- [ -n "$mmcpart" ] && \
- ubootenv_add_uci_config "$mmcpart" "${2}" "${3}" "${4}" "${5}"
-}
-
case "$board" in
aliyun,ap8220|\
compex,wpq873|\
diff --git a/package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh b/package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh
index 980c9962b1..23687d9826 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh
+++ b/package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh
@@ -44,3 +44,21 @@ ubootenv_add_app_config() {
config_get numsec "$1" numsec
grep -q "^[[:space:]]*${dev}[[:space:]]*${offset}" "/etc/fw_${cfgtype#uboot}.config" || echo "$dev $offset $envsize $secsize $numsec" >>"/etc/fw_${cfgtype#uboot}.config"
}
+
+ubootenv_add_mtd() {
+ local idx="$(find_mtd_index "${1}")"
+ [ -n "$idx" ] && \
+ ubootenv_add_uci_config "/dev/mtd$idx" "${2}" "${3}" "${4}"
+}
+
+ubootenv_add_sys_mtd() {
+ local idx="$(find_mtd_index "${1}")"
+ [ -n "$idx" ] && \
+ ubootenv_add_uci_sys_config "/dev/mtd$idx" "${2}" "${3}" "${4}"
+}
+
+ubootenv_add_mmc() {
+ local mmcpart="$(find_mmc_part "${1}")"
+ [ -n "$mmcpart" ] && \
+ ubootenv_add_uci_config "$mmcpart" "${2}" "${3}" "${4}" "${5}"
+}