How to install stock OpenWRT?

I have tried to follow the wiki and was able to install the sinovoip OpenWRT image to EMMC and boot from it. When I build my own image from OpenWRT trunk only a sysupgrade.bin image is generated and if I try to sysupgrade to that image it gives me a “firmware partition not found error” and reboots.

Can anyone give me a hint on what I have to do?

Maybe you can take a look at lexa2s fork

I’ve seen it, but what I want is stock OpenWRT. Not anyone’s fork.

but you can test it, and if it’s working look at his code for getting this working :stuck_out_tongue:

I want stock OpenWRT. I don’t want to change anything to the base code.

You can try to use the Openmptcprouter project:

It’s not original OpenWRT but based on original OpenWRT and has all necessary files (like u-boot, preload-emmc) to build image that can be load into the bpi-r2 board. Just clone it, build project and switch off all components you don’t need (by “make menuconfig” at bpi-r2/source directory).

Maybe I wasn’t clear enough. I am sorry for that. Let me explain my goal again:

I want to run the OpenWRT image provided by the OpenWRT buildboot project, available on this path:

https://downloads.openwrt.org/snapshots/targets/mediatek/mt7623/

I may, if needed, clone the OpenWRT repo ( and not anyone else repo ), make menuconfig, select the proper configuration, and build it. but that’s it. I am not interested in anything else except this.

Worst case, OpenWRT is not a supported distribution as claimed on the product page and I will just make a claim with aliexpress and return the product and search for something else that meets my goals.

Stock OpenWRT image does not have full support for BananaPi R2. As Frank mentioned lexa2 fork offers better support. Recently there was a pull request submitted for stock OpenWRT but it pushed to the main repository yet.

thanks for the info. I still want to run it, even if it doesn’t have full support. I am assuming that full support means that some hardware is not working like usb or lan or whatever. As long as I can flash it, I will be happy for now. So, I just want to know if it is possible or not, and if it is, how to do it.

Exactly for example embedded WiFi chip does not work on stock OpenWRT.

All patches i have applied on my repo (= not in mainline) are not supported by openwrt.

  • internal wifi
  • hdmi
  • poweroff
  • phylink (support with 5.4)
  • hnat/hwqos (partially supported in my 4.14)

HI @frank-w

I’m sure you know enough to be able to answer my question :slight_smile:

Is there a way I can flash the stock openwrt image to emmc? if yes, how?

I only know the standard emmc-way :wink:

Imho you need real image (not kernel.bin or sysupgrade) and then flash via dd if=image of=/dev/mmcblkx where x is your emmc-devicenumber. Also preloader neess to be written to mmcblkxboot0. Sometimes it is needed to set partition-config via uboot/mmc-utils

I did that with some third party image I found on the net, and I have the device running from emmc.

I want to run stock image from emmc. from your answer, I can only assume that, as for now, this is not possible. is this correct?

I don’t know how far official support is…i guess basic support is included so you can create a image for flashing to emmc,but i don’t know the settings for that…maybe @lexa2 can guide you here

ok. will hope @LeXa2 can give me some more info on how to do it.

thanks!

It’s not the first time PR like this had been submitted there. At least one person is trying to get support into upstream for R2 for quite some time now and I believe I’ve seen this person posting here in other threads. While I wish all the best and good luck getting it accepted into upstream my experience tells me that it won’t be an easy and quick ride. Nevertheless proper support seems to be landing piece by piece all over upstream projects (kernel, u-boot, you name it) so things are getting better.

As for the way to get upstream-built OpenWRT into R2 - it might be a bit complicated. You will have to craft SD image yourself using vendor-supplied preloader and u-boot and couple them with owrt-provided kernel and rootfs. I believe that nowdays owrt produces squashfs-based rootfs for R2 which implies that you will have to use block2mtd to simulate mtd device and specify mtd partitions layout on the kernel command line. To get a good hint on how should it look like you may want to check what cmdline gets embedded into the generated owrt kernel. Most probably you will have to modify it somewhat to get it working with eMMC. I’d expect that you will have to turn on in-kernel support for overriding cmdline with the string that was passed from u-boot and then use serial cable to experiment a bit with u-boot console changing cmdline to make it fly.

I see you have provided a detailed information. I would like to look into this and see if I can get something out of your information. Maybe a working openwrt would be helpful for the community.

I this this description explain much how to package openwrt for R2, which I can try it myself with my limited openwrt knowledge.

Thanks.

NP, welcome.

Keep in mind that info above regarding complexity of getting OpenWRT to work with R2 only applies to upstream “vanilla” OpenWRT. There are at least three viable forks available to end-users (including my fork described in this thread) that make installing OpenWRT on R2 an easy task. There’s no real need/urge to use upstream owrt here TBH as: (a) network will be unstable due to one kernel patch that is included in there while it is known to cause net stalls on some boards; (b) squashfs+jffs2 is a bad idea to be used with storage that is large enough to work good with normal fs like ext4; (с) upstream lacks support for sysupgrade so each time you would like to update your installation will be an “install from scratch” experience.

Is luci working on your build? Like Web gui for normal users to deploy openwrt on R2?