Banana Pi R2 + Bootloader

OK, thanks I compile openwrt 19.07.4 for Banana pi r2 currently. I ll share my experience with you.

Afaik no recent openwrt supports internal wifi/hdmi

Hi Frank, i compiled OPENWRT 19.7.4 for Banana Pi R2 after this instruction

Everything goes well. Problem is the last step.

mtd write /tmp/bpi_bananapi-r2-kernel.bin kernel mtd write /tmp/root.squashfs rootfs

No Errors. After reboot and i got folling error

dev_num = 0 mmc0 is current device dev_num = 0

MMC read: dev # 0, block # 4096, count 24576 … 24576 blocks read: OK bootm flag=0, states=70f Wrong Image Format for bootm command ERROR: can’t get kernel image! BPI-R2>

I saw, that i have correct a file uEnv.txt. But how can i change this file in EMMC ?

Thanks in advice Best regards Joerg

I guess openwrt there uses mtd partitions (defined in dts of uboot and for kernel in cmdline). You write kernel with mtd command…

After kernel load fails you were dropped to uboot console where you can try different things. At least show environment (where bootmenu is defined) with “printenv”. In these you can look whats called in order and how kernel gets loaded…i guess something like load kerneldata from mtd (maybe using mmc read with block offset of mtd partition) into memory and then call this memoryaddress with bootm. Maybe you can boot from sdcard and show mtd partitions with the mtd command you’ve used for writing

Hi, i have done some experiments with OPENWRT 19.07.05

The instruction on OPENWRT Site is not correct. After creating the openWRT Image after this instruction you have to write the image file openwrt-mediatek-mt7623-bpi_bananapi-r2-squashfs-img.gz after extraction on a SD Card. Now you can boot from this card and you und you have a option, that you can copy the image to eMMC from uBoot.

This is very good.

OPENWRT 19.07. is running very good. VLAN Tagging is working.

Now i have the problem, that i cannot install new packages. OPENWRT say, that it is a incompatible architecture by installing keepalived and kmod-macvlan

Best regards Joerg

Take a look in your /etc/opkg.conf see here

For bpi r2 you need armhf

I wish to have OpenWRT on R2 work out of the box without re-compiling kernel…Have no idea when that become true…

Joerg wrote it does work basicly, only the problem with installing packages…i don’t know if changing the /etc/opkg.conf fixes this…

Assumeing /dev/sdx is your sd card, is “write the image file on a sd card” means gzip -d -c openwrt-mediatek-mt7623-bpi_bananapi-r2-squashfs-img.gz | sudo dd out=/dev/sdx?

Hi, sounds under Linux good. I extract the file with 7zip under windows and burned the extracted file to SDCard with Win32DiskImager

It is better to use Baleno Ethcer It is available for Windows, Linux and Mac.

It can uncompress the image itself. so no need to uncompress it manually.

@jb2002 have a working way,why should he change his way? Win32diskimager is more popular.

Have you tried changing opkg.conf? What was configured before?

Hi, Win32DIskImager works very good. Before compiling you have to select the modules in “make menuconfig” of OpenWRT. The selected modules are packages after compiling

Use the Image Builder to include the packages in kernel image

In the extracted image builder directory:

make image PACKAGE=“package1 package2 …and so on”

[OpenWrt Wiki] Using the Image Builder

Not all OPKG Packages working from default from OpenWRT repositiory (TCPDUMP is working with OPKG online, but luci have to be include from local package with image builder)

Best regards Joerg

did you need changing the config or does it work out of the box for packages like tcpdump?

It Works out of the Box -compiled with 19.07.5

In addition to that Here is an example using the imagebuilder

[openwrt-imagebuilder-mediatek-mt7623.Linux-x86_64/] make image PACKAGES=“isc-dhcp-relay-ipv4 ethtool iftop kmod-arptables kmod-ebtables-ipv4 kmod-fs-ext4 mcproxy kmod-ipt-ipset kmod-vxlan kmod-nf-conntrack-netlink kmod-nf-conntrack kmod-ipt-dhcpmac -dnsmasq”

The result will be found under

openwrt-imagebuilder-mediatek-mt7623.Linux-x86_64/bin/targets/mediatek/mt7623/ [openwrt-imagebuilder-mediatek-mt7623.Linux-x86_64 = extraction from Openwrt comilation]

Best regards Joerg

Is the imagebuilder part of openwrt? Can this also be done with root makefile (calling imagebuilder with args)?

Yes, imagebuilder is part of OpenWRT. You have to activate the imagebuilder unser “make menuconfig”. I did not try the imagebuilder with root. I used it with user rights.

i meant not the user root…the makefile in openwrt source-root-folder.

as you do make menuconfig and make kernelconfig, it maybe have a command to call imagebuilder. e.g. make image params

Hi, the configuration is stored in a template file “.config”. This file will be used by OpenWRT makefile.