OpenWRT image for BPi R64 with 5.4 kernel

As per title, I’d need to compile an image of OpenWRT for a BPi R64 mounting a 5.4.x kernel. From my tests, I realized that in the commits where the kernel 5.4.xx was still getting used by the Mediatek ARM boards the “sdcard” image wasn’t getting compiled, and in the most recent commits where that image does compile the kernel version is the 5.10.x. Does anyone have any idea on how to proceed?

Before the introduction of the unified single sysupgrade image (which works on all 3 storage types, SD Card, eMMC and SPI-NAND), the openwrt-mediatek-mt7622-bpi_bananapi-r64-squashfs-sysupgrade.bin is actually an SD Card image.

However, to install to eMMC openwrt-mediatek-mt7622-bpi_bananapi-r64-rootdisk-squashfs-sysupgrade-emmc.bin.gz should be used. SPI-NAND is unsupported when using the old pre-5.10 images.

Porting support for the new unified image to older kernels can be a bit tricky, but it’s surely possible if you really want/need it.

I have that one. How would I get that to run on my BPi? I tried flashing it from Luci’s interface with no luck.

which version of OpenWrt are you currently running?

Not sure, I’m running the pre-compiled image from OpenWRT’s wiki. It’s probably one of the latest commits I guess. If you mean the branch I’m working on the master/snapshot branch since there is no support for stable versions.

So once you are on the new Linux 5.10 based image you can’t downgrade to earlier releases which use whole-flash images using sysupgrade.

If you are working on master/snapshot branch, only Linux 5.10 is supported (and a bit of work would be needed to support the single uImage.FIT apporach in Linux 5.4…)

If you (for which ever reason?!) want to work on Linux 5.4, you will need to use the openwrt-21.02 branch and that still comes with the old-style images. And you will need to write the sysupgrade.bin image to an SD card using dd (or a graphical tool to write image to SD card) and boot that in the BPi-R64.

Would this work despite it being a sysupgrade image? Does that mean that the OpenWrt 21.02 is supported by the BPi then?

With OpenWrt 21.02.x and Linux 5.4: Despite the name the sysupgrade.bin file is actually a full flash image, starting with the GPT partition table and legacy preloader, and hence you can write it directly to the SD card. If you want to install it eMMC, a different image is needed and SPI-NAND is entirely unsupported.

Yes, but support in master branch is much better. In OpenWrt 21.02 with Linux 5.4 you will miss some features. Why do you want to stick with Linux 5.4?

Does that apply to the older commits of the master branch too? Or only to the stable one?

Why do you want to stick with Linux 5.4?

I need to work with MPTCPv0 and it’s unsupported in Linux 5.6+

Hm, I guess you should base you work on the openwrt-21.02 branch in that case and you will have to stick with the old-style images until mptcp becomes available on Linux 5.10…

Looking at the mptcp implementation it’s also quite likely that it will defeat all offloading magic of the MT7622 and you will be down to pure software forwarding. So don’t expect any performance miracles…

Alright I have the stable image compiled. How do I burn it to the SD card now though? I tried with dd if=openwrt-mediatek-mt7622-bpi_bananapi-r64-squashfs-sysupgrade.bin of=/dev/sdb but it won’t boot. I tried with Raspberry Pi Imager but it will refuse to burn it because its size “is not a multiple of 512 bytes”. Do you have any suggestion?image

Taking a closer look at the old images in 21.02, it’s not exactly like I thought: None of them contain the headers needed to boot from SD Card. Honestly, I have no idea how this was working.

@dwmw2 may have an idea what you can do.

I tried to follow this guide with no luck. I’m booting from an Ubuntu SD card and using its u-boot menu to try to flash OpenWRT. Is that wrong?

Nevermind, i managed to install that version of OpenWRT on the eMMC successfully. Do you think I’m in a good position to upgrade to a newer OpenWRT mounting the kernel 5.4.x from here? image

Hm, I wouldn’t swear it ever did. I got a BPi-R64 and went down the rathole of trying to get a full preloader+ATF+U-Boot setup working, but don’t think I ever got to the point of fixing things up to build a full image… did I?