[Banana Pi BPI-R64] Mainline OpenWRT image

Hello everyone I was struggling to change the network managed by my newly installed router (BananaPI BPI-R2 + Banana Pi BPI-R2 19.07.7 OpenWRT Router image Kernel 4.14.112 2021-04-15). I saw a quote on the wiki and didn’t understood what it meant.

Is it possible on the last OpenWRT Image to change the lan address from 192.168.1.1/24 to 192.168.10.1/24 to create a separate subnet?

You are my last chance with this card…

My Banana pi also seems to be reset every time I reboot, I may have failed my install, I don’t know thanks everyoneCapture%20d%E2%80%99%C3%A9cran%20du%202023-03-23%2015-18-37

This thread is about BPI-R64 but i guess all openwrt images from bpi have problem with saving the settings. BPI-R2 and R64 should be still supported by mainline openwrt.

Hi. Today I upgrade my R64 to new OpenWRT. And what I see.

OpenWrt 23.05.0, r23497-6637af95aa

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.0M      5.0M         0 100% /rom
tmpfs                   496.5M     80.0K    496.4M   0% /tmp
/dev/mmcblk0p66          92.2M     38.4M     53.9M  42% /overlay
overlayfs:/overlay       92.2M     38.4M     53.9M  42% /
tmpfs                   512.0K         0    512.0K   0% /dev

Now overlay have volume only 92.2M but early It was 1Gb. Why in new version OpenWRT memory has been reduced?

Added: I don’t know but even If I return to latest firmware I have only 92M. Maybe eMMC chip on my R64 degradate.

The default size for the firmware and rootfilesystem has always been 102 MiB which is a common default for many OpenWrt boards with block storage.

You can increase the size the production partition (e.g. using gparted) and after a subsequent sysupgrade you should enjoy increased rootfs_overlay size.

Hi.How can I edit image? I can’t mount it:

:~/BananaPI$ sudo mount openwrt-23.05.0-mediatek-mt7622-bananapi_bpi-r64-sdcard.img /tmp/tmp
mount: /tmp/tmp: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

Or increase the size the production partition need on R64 device directly?

Basicly you can mount an image with losetup (bind image to loopdevice),partprobe (probe partitions in loopdevice) and mount, but daniel imho mean that you modify partition from flashed system with parted (not running).

Hi. Can you explain more, what I need do for mount image? Because only add option loop give me same error:

~/BananaPI$ sudo mount -o loop openwrt-23.05.0-mediatek-mt7622-bananapi_bpi-r64-sdcard.img /tmp/tmp
[sudo] password for dmitry:
mount: /tmp/tmp: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

daniel imho mean that you modify partition from flashed system with parted (not running).

And this need addition explain. Because gparted this is Ubuntu utilite. It don’t exist on OpenWRT.

I think this is because Image have volume only 50Mb. This is very little(only production partition has volume 100Mb). And because of this I can’t mount image.

Sorry, you cannot mount OpenWrt images or whole disk images in general.’

What you can do (on any Linux host you are using the prepare or edit the image) is:

lodev="$(losetup -f)"
losetup $lodev openwrt-23.05.0-mediatek-mt7622-bananapi_bpi-r64-sdcard.img
gparted $lodev

GNU parted is packaged and supported on OpenWrt, of course.

GNU parted is packaged and supported on OpenWrt, of course.

Sorry. I think Gparted from ubuntu.

Due parted I can only edit main image. But can’t edit production partition witch contein in main image:

(parted) print
Error: Invalid argument during seek for read on /dev/loop0
Retry/Ignore/Cancel? r
Error: Invalid argument during seek for read on /dev/loop0
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel? o
Model: Loopback device (loopback)
Disk /dev/loop0: 57.4MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Maybe I can set production partition size during compile OpenWRT from sourse? Because use only 100Mb when you have 7Gb. This is bad, I can’t install even Samba.

I have change production partition size in Hex editor. How change GPT table you can read there. And for SD partition all work, but eMMC partition don’t want load. Maybe It have one more CRC about which I don’t know.

You have to un-gzip the file before attaching it to the loop device.

Yes, or you can set CONFIG_TARGET_ROOTFS_PARTSIZE even when running the ImageBuilder, so you won’t have to build everything from source.

You have to un-gzip the file before attaching it to the loop device.

Yes I had to un-gziped file. *.gz file have size 19Mb, this file have size 57.4Mb.

Hi today I decided to update my bpi64 from OpenWRT 23.05.2 to 23.05.5 and fount that sata disks not working. (I had set u-boot env bootconf to “config-1#mt7622-bananapi-bpi-r64-sata”, I chacked it several times). But when I plug sata drive it not working. On 23.05.2 It work fine.

1 Like

I had check other versions. On 23.05.3 work fine, but 23.05.4 not working.

Which kernel do you use? Can you look in dmesg/logs for any error related?

Newer kernels have this issue,but openwrt should be still on 6.6…but maybe breaking commit was downported

And please use dtc to show your devicetree to make sure dt-overlay was correctly applied.

dtc -I fs -O dts /sys/firmware/devicetree/base

I use OpenWRT from official site. This mean 23.05.3 (5.15.150), 23.05.4(5.15.162), 23.05.5(5.15.167). I install every version through SD card image.

Where I need use:

dtc -I fs -O dts /sys/firmware/devicetree/base

router tell:

-ash: dtc: not found

Package in debian/ubuntu is devicetree-compiler,not sure how you can install in openwrt…

You can check it with cat un sysfs,but you have to find the correct file

This is sys/firmware/devisetree folder:

And it same on 23.05.3 and 23.05.4. Now I have update by web interface and have same trubles on 23.05.4.