+loadaddr=0x48000000
+bootargs=root=/dev/mmcblk1p65
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_sdmmc ; fi
-+bootconf=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_pcie=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_sata=config-mt7622-bananapi-bpi-r64-sata
++bootconf=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_pcie=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_sata=config-1#mt7622-bananapi-bpi-r64-sata
+bootdelay=0
+bootfile=openwrt-mediatek-mt7622-bananapi_bpi-r64-initramfs-recovery.itb
+bootfile_emmcbl2=openwrt-mediatek-mt7622-bananapi_bpi-r64-emmc-preloader.bin
+loadaddr=0x48000000
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
+bootargs=root=/dev/mmcblk0p65
-+bootconf=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_pcie=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_sata=config-mt7622-bananapi-bpi-r64-sata
++bootconf=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_pcie=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_sata=config-1#mt7622-bananapi-bpi-r64-sata
+bootdelay=0
+bootfile=openwrt-mediatek-mt7622-bananapi_bpi-r64-initramfs-recovery.itb
+bootfile_upg=openwrt-mediatek-mt7622-bananapi_bpi-r64-squashfs-sysupgrade.itb
+loadaddr=0x48000000
+bootargs=root=/dev/ubiblock0_2p1
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
-+bootconf=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_pcie=config-mt7622-bananapi-bpi-r64-pcie1
-+bootconf_sata=config-mt7622-bananapi-bpi-r64-sata
++bootconf=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_pcie=config-1#mt7622-bananapi-bpi-r64-pcie1
++bootconf_sata=config-1#mt7622-bananapi-bpi-r64-sata
+bootdelay=0
+bootfile=openwrt-mediatek-mt7622-bananapi_bpi-r64-initramfs-recovery.itb
+bootfile_fip=openwrt-mediatek-mt7622-bananapi_bpi-r64-snand-bl31-uboot.fip
+
--- /dev/null
+++ b/bananapi_bpi-r3_sdmmc_env
-@@ -0,0 +1,75 @@
+@@ -0,0 +1,80 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+bootargs=root=/dev/mmcblk0p65
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_sdmmc ; fi
+bootconf=config-mt7986a-bananapi-bpi-r3
++bootconf_base=config-mt7986a-bananapi-bpi-r3
++bootconf_nor=mt7986a-bananapi-bpi-r3-nor
++bootconf_nand=mt7986a-bananapi-bpi-r3-nand
++bootconf_sd=mt7986a-bananapi-bpi-r3-sd
++bootconf_emmc=mt7986a-bananapi-bpi-r3-emmc
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb
+bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb
+bootmenu_7=\e[31mInstall bootloader, recovery and production to NAND.\e[0m=if nand info ; then run ubi_init ; else echo "NAND not detected" ; fi ; run bootmenu_confirm_return
+bootmenu_8=Reboot.=reset
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
-+boot_update_conf=if nand info ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-snand ; else if sf probe ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-nor ; else setenv bootconf config-mt7986a-bananapi-bpi-r3 ; fi ; fi
++boot_update_conf=if nand info ; then setenv bootconf $bootconf_base#$bootconf_sd#$bootconf_nand ; else if sf probe ; then setenv bootconf $bootconf_base#$bootconf_sd#$bootconf_nor ; else setenv bootconf $bootconf_base#$bootconf_sd ; fi ; fi
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
+boot_production=led $bootled_pwr on ; run boot_update_conf ; run sdmmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- /dev/null
+++ b/bananapi_bpi-r3_nor_env
-@@ -0,0 +1,55 @@
+@@ -0,0 +1,60 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=root=/dev/mtdblock0p1
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
-+bootconf=config-mt7986a-bananapi-bpi-r3-emmc-nor
++bootconf=config-mt7986a-bananapi-bpi-r3
++bootconf_base=config-mt7986a-bananapi-bpi-r3
++bootconf_nor=mt7986a-bananapi-bpi-r3-nor
++bootconf_nand=mt7986a-bananapi-bpi-r3-nand
++bootconf_sd=mt7986a-bananapi-bpi-r3-sd
++bootconf_emmc=mt7986a-bananapi-bpi-r3-emmc
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin
+boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
+boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
-+boot_update_conf=if mmc partconf 0 ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-nor ; else setenv bootconf config-mt7986a-bananapi-bpi-r3-nor ; fi
++boot_update_conf=if mmc partconf 0 ; then setenv bootconf $bootconf_base#$bootconf_nor#$bootconf_emmc ; else setenv bootconf $bootconf_base#$bootconf_nor#$bootconf_sd ; fi
+boot_nor=run boot_production ; run boot_recovery
+boot_write_fip=mtd erase fip && mtd write fip $loadaddr
+boot_write_preloader=mtd erase bl2 && mtd write bl2 $loadaddr
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- /dev/null
+++ b/bananapi_bpi-r3_snand_env
-@@ -0,0 +1,69 @@
+@@ -0,0 +1,74 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=root=/dev/ubiblock0_2p1
-+bootconf=config-mt7986a-bananapi-bpi-r3-snand
++bootconf=config-mt7986a-bananapi-bpi-r3
++bootconf_base=config-mt7986a-bananapi-bpi-r3
++bootconf_nor=mt7986a-bananapi-bpi-r3-nor
++bootconf_nand=mt7986a-bananapi-bpi-r3-nand
++bootconf_sd=mt7986a-bananapi-bpi-r3-sd
++bootconf_emmc=mt7986a-bananapi-bpi-r3-emmc
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb
+boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
-+boot_update_conf=if mmc partconf 0 ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-snand ; else setenv bootconf config-mt7986a-bananapi-bpi-r3-snand ; fi
++boot_update_conf=if mmc partconf 0 ; then setenv bootconf $bootconf_base#$bootconf_nand#$bootconf_emmc ; else setenv bootconf $bootconf_base#$bootconf_nand#$bootconf_sd ; fi
+part_default=production
+part_recovery=recovery
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- /dev/null
+++ b/bananapi_bpi-r3_emmc_env
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,61 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=root=/dev/mmcblk0p65
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
-+bootconf=config-mt7986a-bananapi-bpi-r3-emmc
++bootconf=config-mt7986a-bananapi-bpi-r3
++bootconf_base=config-mt7986a-bananapi-bpi-r3
++bootconf_nor=mt7986a-bananapi-bpi-r3-nor
++bootconf_nand=mt7986a-bananapi-bpi-r3-nand
++bootconf_sd=mt7986a-bananapi-bpi-r3-sd
++bootconf_emmc=mt7986a-bananapi-bpi-r3-emmc
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
+boot_tftp=run boot_update_conf ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
-+boot_update_conf=if nand info ; then setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-snand ; else setenv bootconf config-mt7986a-bananapi-bpi-r3-emmc-nor ; fi
++boot_update_conf=if nand info ; then setenv bootconf $bootconf_base#$bootconf_emmc#$bootconf_nand ; else setenv bootconf $bootconf_base#$bootconf_emmc#$bootconf_nor ; fi
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
+mmc_read_vol=mmc read $loadaddr $part_addr 0x8 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+part_default=production