[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.