Below are step-by-step instructions for installing ImmortalWrt on the Banana Pi BPI-R3 Mini, first on eMMC and then on NAND. These instructions assume that you already have ImmortalWrt or the stock ROM running on SPI-NAND (for the eMMC installation) or ImmortalWrt running on eMMC (for the NAND installation).
scp
utility on your host machinedd
and ubi
utilities on the deviceSet the boot switch to boot from SPI-NAND. This assumes you are currently running the stock ROM or ImmortalWrt from SPI-NAND.
First, transfer the GPT file to the device:
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin root@<device-ip>:/tmp
Then, on the device, write the partition table:
dd if=/tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
After writing the GPT partition table perform a reboot as they need to be updated:
reboot
Transfer the required files to the device:
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb root@<device-ip>:/tmp
Please remember to replace the * with the version you intend to use
On the device, make the mmcblk0boot0
partition writable and then write the files:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
sync
Power off the device, set the boot switch to eMMC, and then power it on. The device should boot into ImmortalWrt with the LAN port on the side closer to the USB-C power connector. The default IP is 192.168.1.1
.
Set the boot switch to boot from eMMC. Important: ImmortalWrt or stock ROM on SPI-NAND will not work for installing to NAND. You must be running ImmortalWrt from eMMC as per the steps above.
Transfer the following files to the device via scp
:
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb root@<device-ip>:/tmp
scp immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb root@<device-ip>:/tmp
Please remember to replace the * with the version you intend to use
Then, write them to the appropriate locations:
mtd write /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 5 -N fit -s $volsize
ubiupdatevol /dev/ubi0_5 /tmp/immortalwrt-*-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Power off the device, set the boot switch to NAND, and then power it back on. It should now boot into ImmortalWrt from NAND.