New to building from source (Banana Pi R2 board)


I'm having trouble understanding a few steps in the firmware building process.
I prepared my build system, but stuck on the git clone part. What am I cloning?
For example, I want to build an image for Banana Pi R2 board using the latest OpenWRT version, v19.x.x. So, what do I clone? What would be the first two or three statements that I type. That's all I need for now to get started.

Thank You

You would clone the whole OpenWrt got repo, which contains all current branches: master, 1907, ...

After cloning, you can checkout the openwrt-19.07 branch, so that you will build its toolchain.


Thank you. Now getting somewhere. I'm in the makefile for BPI-R2, I don't see U-boot listed in the "bootloader" section when I select my board. There are some old files listed in this branch:

How do I go about including U-boot in this build? The board doesn't have any onboard U-Boot, everything has to part of the firmware image.

You are trying to use a fourth-party repo that is 2-3 years old. Pretty ancient and strange.
That has little to do with the current OpenWrt...

Why are you not using the normal Openwrt at ???
(or the Github mirror )

There should be quite normal support for Banana Pi R2 nowadays. No reason to use some ancient fork.

Thank you. That's what I thought, but why my bootloader screen is empty? I cloned the full OpenWRT and updated the sources before starting the makefile.

I have no experience with Banana Pi, but for 99% of routers, all needed packages are included by default.

Basically you just need to select the correct device, and all needed packages get selected automatically.

Is there actually u-boot support for that device?
(Or is some other bootloader used for it in OpenWrt?)

Unlike most boards, the BPI-R2 doesn't come with any bootloader at all, so the board doesn't even start if it's not there. I found the uboot bootloader files on this page.

I know the following files are required, but don't know how to incorporate them in the build so they appear in the above Boot loader menu screen.

  1. bpi_bananapi-r2-preloader.bin
  2. u-boot-mt7623a_unielec_u7623/
  3. u-boot-mt7623n_bpir2/