glinet,gl-ar300m16|\
glinet,gl-s200-nor|\
glinet,gl-s200-nor-nand)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
;;
buffalo,wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
;;
buffalo,wbmr-300hpd)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x2000" "0x1000" "2"
;;
esac
board=$(board_name)
ubootenv_add_mmc_default() {
- local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")"
- ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
- ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
+ ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x0" "0x40000" "0x40000" "1"
+ ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x40000" "0x40000" "0x40000" "1"
}
ubootenv_add_nor_default() {
- local envdev="/dev/mtd$(find_mtd_index "u-boot-env")"
- ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
- ubootenv_add_uci_config "$envdev" "0x20000" "0x20000" "0x20000" "1"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x20000" "1"
+ ubootenv_add_mtd "u-boot-env" "0x20000" "0x20000" "0x20000" "1"
}
ubootenv_add_ubi_default() {
glinet,gl-xe3000|\
huasifei,wh3000|\
nradio,c8-668gl)
- local envdev=$(find_mmc_part "u-boot-env")
- ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
+ ubootenv_add_mmc "u-boot-env" "" "0x0" "0x80000"
;;
asus,rt-ax59u)
ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
routerich,ax3000-v1|\
tenbay,wr3000k|\
tplink,re6000xd)
- local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
- ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x20000" "1"
;;
openembed,som7981)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000"
smartrg,sdg-8733|\
smartrg,sdg-8733a|\
smartrg,sdg-8734)
- local envdev=$(find_mmc_part "u-boot-env" "mmcblk0")
- ubootenv_add_uci_config "$envdev" "0x0" "0x8000" "0x8000"
+ ubootenv_add_mmc "u-boot-env" "mmcblk0" "0x0" "0x8000" "0x8000"
;;
tplink,archer-ax80-v1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "8"
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
;;
zyxel,ex5601-t0)
- local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
- ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x40000" "2"
;;
zyxel,ex5700-telenor)
ubootenv_add_uci_config "/dev/ubootenv" "0x0" "0x4000" "0x4000" "1"
. /lib/functions.sh
ubootenv_add_mmc_default() {
- local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")"
- ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
- ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
+ ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x0" "0x80000" "0x80000" "1"
+ ubootenv_add_mmc "ubootenv" "${1:-mmcblk0}" "0x80000" "0x80000" "0x80000" "1"
}
ubootenv_add_ubi_default() {
ubnt,unifi-6-lr-v1-ubootmod|\
ubnt,unifi-6-lr-v2-ubootmod|\
ubnt,unifi-6-lr-v3-ubootmod)
- ubootenv_add_uci_config "/dev/mtd$(find_mtd_index "u-boot-env")" "0x0" "0x4000" "0x1000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x4000" "0x1000"
;;
ubnt,unifi-6-lr-v2|\
ubnt,unifi-6-lr-v3)
fi
;;
synology,ds213j)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
;;
esac
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}"
-}
-
case "$board" in
elecom,wrc-x3000gs2|\
iodata,wn-dax3000gr)
- idx="$(find_mtd_index 0:appsblenv)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
+ ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000"
;;
glinet,gl-b3000)
- idx="$(find_mtd_index 0:APPSBLENV)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
+ ubootenv_add_mtd "0:APPSBLENV" "0x0" "0x40000" "0x20000"
;;
linksys,mr5500|\
linksys,mx2000|\
linksys,mx5500|\
linksys,spnmx56)
- idx="$(find_mtd_index u_env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"
+ ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000"
;;
xiaomi,ax6000)
ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"
beeline,smartbox-pro|\
tplink,ec330-g5u-v1|\
wifire,s1500-nbn)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x1000" "0x20000"
;;
buffalo,wsr-1166dhp|\
buffalo,wsr-600dhp|\
;;
hootoo,ht-tm05|\
ravpower,rp-wd03)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
+ ubootenv_add_mtd "u-boot-env" "0x4000" "0x1000" "0x1000"
;;
beeline,smartbox-flash|\
iptime,t5004|\
snr,snr-cpe-me1|\
snr,snr-cpe-me2-sfp|\
snr,cpe-w4n-mt)
- idx="$(find_mtd_index uboot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
+ ubootenv_add_mtd "uboot-env" "0x0" "0x1000" "0x1000"
;;
xiaomi,miwifi-mini)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
zyxel,lte5398-m904|\
zyxel,lte7490-m904|\
zyxel,nr7101)
- idx="$(find_mtd_index Config)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
+ ubootenv_add_mtd "Config" "0x0" "0x1000" "0x80000"
;;
bolt,arion|\
xiaomi,mi-router-cr6606|\
case "$board" in
apresia,aplgs120gtss)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x10000"
- idx2="$(find_mtd_index u-boot-env2)"
- [ -n "$idx2" ] && \
- ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x40000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x40000" "0x10000"
+ ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x40000" "0x10000"
;;
d-link,dgs-1210-10mp|\
d-link,dgs-1210-10p|\
zyxel,gs1900-24ep|\
zyxel,gs1900-24hp-v1|\
zyxel,gs1900-24hp-v2)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x10000"
- idx2="$(find_mtd_index u-boot-env2)"
- [ -n "$idx2" ] && \
- ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x400" "0x10000"
+ ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"
;;
tplink,sg2008p-v1|\
tplink,sg2210p-v3|\
tplink,sg2452p-v4)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x10000"
;;
iodata,bsh-g24mb)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
- idx2="$(find_mtd_index u-boot-env2)"
- [ -n "$idx2" ] && \
- ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x3800" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
+ ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x3800" "0x10000"
;;
*)
- idx="$(find_mtd_index u-boot-env)"
- [ -n "$idx" ] && \
- ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
- idx2="$(find_mtd_index u-boot-env2)"
- [ -n "$idx2" ] && \
- ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
+ ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
+ ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"
;;
esac