BananaPI BPI-R2 Openwrt18.06 Demo Image and Source Code Release 2019-03-06

Hi,

the SD image boots properly but there are a few things that are not working out-of-the-box (dhcp server on br-lan, luci) and I have no time to investigate for the moment, I will come back later.

Thanks anyway, from my side it is the most intresting target distribution, but for that I would need a working and HW assisted OpenVPN (with crypto), and all other common router functions with HW (NAT and QoS above all. On-board wifi is really poor both from HW perspective and SW support;

hi

can you please offer an whole image with openwrt for dd 'ing on an emty mmc mem card.

i try to build by my self , but i have trouble with the ethernet switch of the bpi2 after install the image by dd and booting the bpir2 with them,

i can’t ping the default 192.168.1.1 address from my pc with the address 192.168.1.10

holger

Why, why, why the hell did you do this to git?! This one is based on the upstream repo and upstream repo is also a git repo and it even is available on the github. Why had you choosed to distribute your changes as a single huge commit hiding all the changes you’ve done to the upstream repo? Why hadn’t you follow the sane people’s route by using github fork and creating a new branch starting from the upstream commit you choose as a base for your changes?

It’s really painful to deal with this kind of “forks”. Nevertheless thanks for your efforts, maybe other people would be able to extract something useful to be pushed into the upstream from your changeset.

Hello, sorry for this, I have changed, thanks for your advice.

1 Like

hi

ok , then tell me where is an Dokumentation to install openwrt to an blank mmc card for an bananapi r2.

i know the download at openwrt.org , but i can’t deal with the offered files. look like the are can only use for upgrade.

holger

Hello, I just push my commit to the fork repo, please have a try.

you will see the image under here: /build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/

you could also use dd command to install image:

image

Hi ,

Ich will try in the evening today.

I give you then asap an Response Here.

Holger

Thanks for the quick fix.

Thank you for all the work. I only have a problem, I don’t get an ip from the router and if I manually set my PC to 192.168.1.2 I cannot reach the router.

“ip a” indicates the router should be 192.168.1.1.

I have noticed (with the previous version) that if I make the following modification in the file /etc /config/network, I can ping the router and reach via ssh.

uncomment the “config globals ‘globals’” and “config interface ‘wan6’”

I make the adjustment with vi and check with mat cat whether the adjustment has also been made in the file.

however, if I adjust this file and reboot the router, they will reset the adjustment.

ask : which file should I adjust to make the adjustment permanent

1 Like

hi

i check my build dir but there is no .img file.

i configure and compile the code like the description says.

i got no error at the compile time

holger

Don’t work. I can access by serial interface, but I can’t access to 192.168.1.1. DHCP don’t work. Static ip don’t work.

this demo image only has very basic function, let me check this and then add my .config here. thanks

hello, the image will be generated in this path: build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/

if you don’t see this, please provide me your compiled log.

Please verify you use this patch…

Hi everybody.

I tried to install the pre-built image of OpenWRT for the BananaPi R2 published here:

https://dev.banana-pi.org.cn/Image/BPI-R2/Openwrt/1806/

But all packets coming from the LAN SW seem to be malformed and on the WAN side I can assign an IP using a DHCP but the SSH service is not listening on that interface, I suppose for some firewall configuration. For these reason I can not access my board.

I also tried to compile my own image and I had the same problem with the malformed packets. So I follow this post:

And ended editing this file:

openwrt/target/linux/rb532/base-files/etc/config/network

# Copyright (C) 2006 OpenWrt.org

config interface loopback
	option ifname	lo
	option proto	static
	option ipaddr	127.0.0.1
	option netmask	255.0.0.0

config interface wan
	option ifname	eth0
	option proto	dhcp

config interface lan
	option type	bridge
	option ifname	eth1
	option proto	static
	option ipaddr	192.168.1.1
	option netmask	255.255.255.0
#	option ip6assign 60

#config interface wan6
#	option ifname   eth0
#	option proto    dhcpv6

#config globals globals
#	option ula_prefix auto

After compiling, it works, i can login in [email protected] using SSH. The problem now is that i can not install any package because I have no free space. Which is not true, because I’m using a 32GB SD card, from which only 70MB are being used by the image…

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   503.7M     72.0K    503.6M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
root@OpenWrt:~# 

root@OpenWrt:~# opkg install openvswitch-ovn
Installing openvswitch-ovn (2.8.5-1) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg openvswitch-ovn needs 1
 * opkg_install_cmd: Cannot install package openvswitch-ovn.

Do you know if there is a way to resize the file system or to configure it using make menuconfig ?

Bye.

did you find a way to get luci working?

So I had managed to find a spare hour and took a look into what had been changed compared to the official upstream sources. By the looks of it the main change in sources is an addition of SD and EMMC image building targets - which was done is a “dirty” way having preloader and u-boot binary blobs pushed as files into the git. Second change is the change to the build procedure by injecting device tree files into the kernel build tree halfway across the build.

Am I missing something? What is supported and what is not for this image? Dual GMACs? Hardware assisted VLANs? DSA-enabled switch chip management? Hardware NAT? I mean, it is cool that these sources look extremely close to the upstream OpenWRT but as an end-user what I care more is the available functionality as my goal is to use this board as a router instead of toying with it compiling and testing different stuff.

Important notes for people trying to compile this:

  • Beware of make dirclean and make clean: mtk-bpi-r2-preloader-emmc.bin, mtk-bpi-r2-preloader-sd.bin and mtk-bpi-r2-uboot.bin would be cleaned up from staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image and you will have to re-overwrite dts/dtsi files in the build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/linux-4.14.82/arch/arm/boot/dts/. Proper dirclean path: make dirclean; git checkout staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/mtk-bpi-r2-{preloader-emmc,preloader-sd,uboot}.bin. Then execute make, then re-copy dts/dtsi files, then repeat make.
  • Make sure you had enabled generation of “ramdisk” in “Target Images” menuconfig. Resulting image won’t be generated if initramfs target image is disabled.
  • For “make oldconfig” users: make sure to switch to “GCC compiler Version (gcc 7.x)” in the “Advanced configuration options (for developers) —> Toolchain Options”. It won’t compile with gcc 5.x without tweaks to compiler flags in some random places.
1 Like

Finally tried the image compiled from this source on my BPiR2. Findings:

  • Default image config lacks a lot of kernel modules that are required to use all available functionality of the SoC. Namely: USB2/3, HW crypto engine, ATA. This is due to a fact that upstream had created a separate subtarget mt7623n for BPiR2 which does not have DEVICE_PACKAGES populated with “kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-core kmod-ata-ahci-mtk” the same way it is done for mt7622 reference board target. One will have to enable above modules manually in order to get resp. parts of SoC working.
  • No support for volatile storage. Image is a pure read-only squashfs root without jffs2 partition to store overlay data. One would have to use external root to make this image useful for anything more than basic tests. Or would have to hack in “rootfs_data” partition subdivision somehow to get jffs2 working.
  • Two GMACs seems to be present and working.
  • DSA is working.

Above are findings “at a first glance”. Will report back after doing more tests and tweaks.

… several hack-compile-fail-hack iterations later …

Well, I had managed to get more-or-less working image with in-kernel ATA support, working jffs2 overlay and full 2GB of memory available for use. Hacks I’ve done to make it happen are quick-n-dirty changes to DTS (proper block2mtd config for mtd emulation over SD card; fix to enable full 2GB of memory), kernel config (enable AHCI_MTK, ATA and SCSI), a fix to vendor-supplied hack that builds eMMC and SD images (do not require/use initramfs), some misc fixes to openwrt’s mediatek-specific makefiles. In current state changes are too dirty and hackish to share. My plan is to tidy them up and create a PR to vendor’s repo (and - with some luck - also to upstream). Although don’t make hopes too high as my free time to spend on this project is really limited due to Real Life ™ so ETA would be more like weeks than days.