]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
uboot-tools: move ubootenv_add_ubi_default to common functions 18818/head
authorPaweł Owoc <frut3k7@gmail.com>
Fri, 16 May 2025 14:22:54 +0000 (16:22 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 26 Jun 2025 21:12:20 +0000 (23:12 +0200)
The same function is used twice, so let's make it 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>
package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622
package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh

index 7ca793a8d492d9d2f1a4b6e554f0c8c90d38d6df..007fc2ffb6870e01ce3292e638e92900e93488a9 100644 (file)
@@ -21,15 +21,6 @@ ubootenv_add_nor_default() {
        ubootenv_add_mtd "u-boot-env" "0x20000" "0x20000" "0x20000" "1"
 }
 
-ubootenv_add_ubi_default() {
-       . /lib/upgrade/nand.sh
-       local envubi=$(nand_find_ubi ubi)
-       local envdev=/dev/$(nand_find_volume $envubi ubootenv)
-       local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
-       ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
-       ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
-}
-
 case "$board" in
 abt,asr3000|\
 asus,zenwifi-bt8-ubootmod|\
index ce796a6d00b5fa0592acab871331639fa755a443..1ba1019fab0c4803a1c191f65730f7e780eb9805 100644 (file)
@@ -14,15 +14,6 @@ ubootenv_add_mmc_default() {
        ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x80000" "0x80000" "0x80000" "1"
 }
 
-ubootenv_add_ubi_default() {
-       . /lib/upgrade/nand.sh
-       local envubi=$(nand_find_ubi ubi)
-       local envdev=/dev/$(nand_find_volume $envubi ubootenv)
-       local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
-       ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
-       ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
-}
-
 board=$(board_name)
 
 case "$board" in
index 71ec8e8e715161ee90afdcf4992fde8895293621..7fb995fa8234959a0e678085fa73b483b3eefd3a 100644 (file)
@@ -62,3 +62,12 @@ ubootenv_add_mmc() {
        [ -n "$mmcpart" ] && \
                ubootenv_add_uci_config "$mmcpart" "${3}" "${4}" "${5}" "${6}"
 }
+
+ubootenv_add_ubi_default() {
+       . /lib/upgrade/nand.sh
+       local envubi=$(nand_find_ubi ubi)
+       local envdev=/dev/$(nand_find_volume $envubi ubootenv)
+       local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
+       ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
+       ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
+}