[BPI-R4] Imagebuilder R4 ArchlinuxArm

OK, I will try [bpir3-alarm-sdmmc-ap.img.gz] from SEP/14/2025. Hope it’s a good candidate. This formatting looks better, only first line has some error.

[root@bpir3 ~]#  bpir-toolbox --nand-format
ubidetach: error!: cannot detach "/dev/mtd0"
           error 19 (No such device)
ubiformat: mtd0 (nand), size 128450560 bytes (122.5 MiB), 980 eraseblocks of 131072 bytes (128.0 KiB), min. I/O                                              size 2048 bytes
libscan: scanning eraseblock 979 -- 100 % complete
ubiformat: 980 eraseblocks have valid erase counter, mean value is 3
ubiformat: formatting eraseblock 979 -- 100 % complete
UBI device number 0, total 980 LEBs (124436480 bytes, 118.6 MiB), available 956 LEBs (121389056 bytes, 115.7 MiB                                             ), LEB size 126976 bytes (124.0 KiB)
Volume ID 0, size 9 LEBs (1142784 bytes, 1.0 MiB), LEB size 126976 bytes (124.0 KiB), static, name "fip", alignm                                             ent 1
Volume ID 1, size 2 LEBs (253952 bytes, 248.0 KiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "ubootenv",                                              alignment 1
Volume ID 2, size 2 LEBs (253952 bytes, 248.0 KiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "ubootenv2"                                             , alignment 1
Set volume size to 119738368
Volume ID 3, size 943 LEBs (119738368 bytes, 114.1 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootf                                             s", alignment 1
Skipping bl2 on NAND
DEBUG: Adding image /usr/share/bpir-uboot/u-boot-bpir3-emmc.bin
DEBUG: Metadata size: 96 bytes
DEBUG: Payload size: 858112 bytes
Non-Trusted Firmware BL33: offset=0x60, size=0xD1800, cmdline="--nt-fw"
0+0 records in
0+0 records out
0 bytes copied, 7.4077e-05 s, 0.0 kB/s
Binary files /tmp/bpir-toolbox-tmp/dump.bin and /tmp/bpir-toolbox-tmp/fip.bin differ
Updating fip on NAND
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
'/boot/dtbs/mt7986a-bananapi-bpi-r3.dtb' -> '/tmp/bpir-toolbox-tmp/fixed.dtb'
Creating .dtbo from bootargs.dts
Creating .dtbo from emmc-clock-fix.dts
Creating .dtbo from memory.dts
Creating .dtbo from nand-enable.dts
Applying #define MTK_PUPD_SET_R1R0_00 = 100
Creating .dtbo from emmc-enable.dts
input  = /tmp/bpir-toolbox-tmp/fixed.dtb
output = /tmp/bpir-toolbox-tmp/atf.dtb
overlay[0] = /tmp/bpir-toolbox-tmp/dtbos/bootargs.dtbo
overlay[1] = /tmp/bpir-toolbox-tmp/dtbos/emmc-clock-fix.dtbo
overlay[2] = /tmp/bpir-toolbox-tmp/dtbos/emmc-enable.dtbo
overlay[3] = /tmp/bpir-toolbox-tmp/dtbos/memory.dtbo
overlay[4] = /tmp/bpir-toolbox-tmp/dtbos/nand-enable.dtbo
BOOTARGS = root= earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200 debug=7 rw rootwait audit=0
diff: /tmp/bpir-toolbox-tmp/mnt/boot/dtbs/mt7986a-bananapi-bpi-r3-atf.dtb: No such file or directory
Updating atf.dtb on NAND:
'/tmp/bpir-toolbox-tmp/atf.dtb' -> '/tmp/bpir-toolbox-tmp/mnt/boot/dtbs/mt7986a-bananapi-bpi-r3-atf.dtb'
DEFAULT linux-bpir-git
  MENU title U-Boot menu
  PROMPT 0
  TIMEOUT 50
LABEL linux-bpir-git
  MENU LABEL Archlinux ARM for BananaPi Routers
  LINUX /boot/Image.gz
  INITRD /boot/initramfs-bpir.img
  FDT /boot/dtbs/mt7986a-bananapi-bpi-r3-atf.dtb
diff: /tmp/bpir-toolbox-tmp/mnt/boot/extlinux/extlinux.conf: No such file or directory
Updating extlinux.conf on NAND:
'/tmp/bpir-toolbox-tmp/extlinux.conf' -> '/tmp/bpir-toolbox-tmp/mnt/boot/extlinux/extlinux.conf'
diff: /tmp/bpir-toolbox-tmp/mnt/boot/Image.gz: No such file or directory
Updating Image.gz on NAND:
'/boot/Image.gz' -> '/tmp/bpir-toolbox-tmp/mnt/boot/Image.gz'
diff: /tmp/bpir-toolbox-tmp/mnt/boot/initramfs-bpir.img: No such file or directory
Updating initramfs-bpir.img on NAND:
'/boot/initramfs-bpir.img' -> '/tmp/bpir-toolbox-tmp/mnt/boot/initramfs-bpir.img'
/tmp/bpir-toolbox-tmp/mnt:
total 0
drwxr-xr-x 4 root root 448 Sep  4 20:42 boot

/tmp/bpir-toolbox-tmp/mnt/boot:
total 23852
-rwx------ 1 root root  7842262 Sep  4 20:42 Image.gz
drwxr-xr-x 2 root root      248 Sep  4 20:42 dtbs
drwxr-xr-x 2 root root      232 Sep  4 20:42 extlinux
-rwx------ 1 root root 16578315 Sep  4 20:42 initramfs-bpir.img

/tmp/bpir-toolbox-tmp/mnt/boot/dtbs:
total 24
-rw-r--r-- 1 root root 24055 Sep  4 20:42 mt7986a-bananapi-bpi-r3-atf.dtb

/tmp/bpir-toolbox-tmp/mnt/boot/extlinux:
total 4
-rw-r--r-- 1 root root 247 Sep  4 20:42 extlinux.conf

On first glance looks good, the detach error is normal, as it was not attached before.

After this you can apply any changes with --nand-update.

OK, tested boot from NAND and it’s working fine, yay :slight_smile: For my use case I would like to auto exec “bpir-dhcpc lan1” on every boot so I can detach UART and place it back to living room. How do I enable this command to autoexec / retry on every boot ?

Sry, I see now that sshd is not running so the NAND recovery utils are only available via serial UART connection. Disconnecting all the cables/antennas + opening the case + connecting UART every time I want use NAND recovery is not very practical, but I can live with it for now. If you somehow manage to enable any remote connection to the console it would be perfect. Maybe initrd (2GB) could help if storage is the limiting factor… Thanks again for all your help and your recovery utils :+1:

You can make a UART connector on the rectangular hole of the case. It fits a male 2.54mm plug exactly.

Ssh is not supported from the initrd

You can use a linux sd-image as recovery for your nvme installed linux. That has ssh enabled.