Howto build 19.07.3 openwrt image for bpi r2

requires root-permissions on standard system…better will be ./openwrt or ~/openwrt :slight_smile: or maybe a directory in /usr/src which does also require root-permissions for create and changing owner/group (to allow clone/build as normal user)

correct, I would prefer ~/openwrt. Reason for me were shortening pathnames, but the build system has it´s own long and deep path structure. It´s a battle you are in every case the loser.

On an ext[234] filesystem you can create a symlink to deeper directory if you need it multiple times (e.g. builddir with toolchain)

e.g.

ln -s build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/ builddir

works also with version 19.07.4

edited again:

  • removed mount_root (yes Frank, you are right!)

  • added some hints regarding burn into emmc

The flashing steps can be consolidated if you use a utility like Balena etcher which can flash compressed images. Also marking the ramdisk target is unnecessary.

I can also add that I did all of this via WSL2 on windows (Ubuntu 20.04) and worked great.

But otherwise, your steps are exactly the steps I followed.

Hi!

does this build support DSA (Distributed Switch Architecture) or is there a way to patch it?

check if you see it during boot:

dmesg | grep dsa

or if you see all 4 lan + 1 wan interfaces here:

ls -l /sys/class/net

If you use 5.4 you could get patches from my 5.4-main branch and add them to yout patches-5.4 dir

root@BananaPi:/# dmesg | grep dsa
[    1.544986] libphy: dsa slave smi: probed
[    1.549281] mt7530 mdio-bus:00 wan (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY]
[    1.558237] mt7530 mdio-bus:00 lan0 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
[    1.567234] mt7530 mdio-bus:00 lan1 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
[    1.576216] mt7530 mdio-bus:00 lan2 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
[    1.585139] mt7530 mdio-bus:00 lan3 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
root@BananaPi:/#

I would like to provide switch functions. Which modules should I add before make?

my actual build uses version 5 uname -r reports 5.4.70

You have already dsa enabled so you don’t need to add these Patches

Thanks for testing, I will try to compile myself.

Meanwhile I found that the following location shows the related patches:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=tree;f=target/linux/mediatek/patches-5.4

e.g. 0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch

For r2 you don’t need mt7531 patch…only for r64. Dsa driver for r2 is included in mainline 4.14+

This is a bit off-topic:

@frank-w: Your kernel looks also interesting and I do have some questions for build.conf:

my board says BPi-R64-V1.1, so I need to set boardversion=1.1, right?

in general: is boardversion=1.0 for R2 and boardversion=1.1 for R64?

Afair board-version was only used for r64 to choose switch driver (rtl8367 vs mt7531).

Hi frank, do you have a link for the usb-serial adapter pictured here: 3D designed case for R2 ?

(The plywood case)

it’s a cp21x2

1 Like

when I build 19.07.6,cannot find any options in bootloaders in ‘make menuconfig’ but snapshot is OK

I do not understand the question…what do you search for? Imho for r2/r64 static uboot.bin is used (no compile from source)

howto edited again: removed unnecessary options in menuconfig, adding hint for luci translations removed patch in script for image generation set correct image name for unzip and transfer to sdcard added hint for umount of volumes on sdcard works with actual snapshot (currently kernel version 5.10.64, OpenWrt SNAPSHOT r17554)