uboot-tools: move ubootenv_add_ubi_default to common functions
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>
This commit is contained in:
parent
8aae84757d
commit
165ca3f375
3 changed files with 9 additions and 18 deletions
|
@ -21,15 +21,6 @@ ubootenv_add_nor_default() {
|
||||||
ubootenv_add_mtd "u-boot-env" "0x20000" "0x20000" "0x20000" "1"
|
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
|
case "$board" in
|
||||||
abt,asr3000|\
|
abt,asr3000|\
|
||||||
asus,zenwifi-bt8-ubootmod|\
|
asus,zenwifi-bt8-ubootmod|\
|
||||||
|
|
|
@ -14,15 +14,6 @@ ubootenv_add_mmc_default() {
|
||||||
ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x80000" "0x80000" "0x80000" "1"
|
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)
|
board=$(board_name)
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
|
|
|
@ -62,3 +62,12 @@ ubootenv_add_mmc() {
|
||||||
[ -n "$mmcpart" ] && \
|
[ -n "$mmcpart" ] && \
|
||||||
ubootenv_add_uci_config "$mmcpart" "${3}" "${4}" "${5}" "${6}"
|
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"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue