OpenWrt 24.10.0 Build help

This is a huge shot in the dark, but I am hoping some kind soul can help me through my build newb'ness.

I have an Orange Pi 5 Plus (Opi5+). There is even OpenWrt image build for 23.05 Found here: https://drive.google.com/drive/folders/1yQxX4WP8Owm6peGu9ezZdTtr8exhopSY
I have concerns about this image existing on a google drive, as well as possible Chinese backdoors baked into this old image. This image does work. I am also locked out from upgrading some packages due to the age of my kernel. This is the real reason I want the latest build, as this is the gateway into my network and I want it to be secure.

I did try to build OpenWrt with this image following the guide https://openwrt.org/docs/guide-developer/toolchain/building_openwrt_on_openwrt
However I was eventually blocked by the bison pkg not supporting my architecture which prevented me from building.

I'd like to build OpenWrt 24.10, but OpenWrt doesn't support Opi5+. I do have the repo used to build the image in the google drive here: https://github.com/orangepi-xunlong/openwrt. Is there a way to merge 24.10.0 updates into this branch and then build that?

Ultimately I don't know what files were used to make the xunlong fork work. The config file https://github.com/orangepi-xunlong/openwrt/blob/openwrt-22.03/configs/orangepi-5-plus-rk3588_defconfig seems to indicate:
CONFIG_TARGET_rockchip=y
CONFIG_TARGET_rockchip_armv8=y
CONFIG_TARGET_rockchip_armv8_DEVICE_xunlong_orangepi-5-plus=y

If I specified that in 24.10 .config file would I be able to build for my Opi5+ or is there more I need to do?

You could diff the corresponding vanilla OpenWrt branch with that downstream repo and see what was changed, see if you can create a patch and port it over to 24.10.x.

I know how to do this in windows. I have no idea how to do a diff on debian, and slowly comb through what changed. I am generally doing this work in the CLI on debian, so I really don't know how to compare.

To put it another way, I can get around linux, but in terms of creating builds and anything fancier than cloning a git repo I am lost.

Could you suggest where I could start looking?

I'm not sure which branch supports what. 22.03 looks like the most up-to-date that mentions Orange Pi 5 Plus. Here are all the changes since the latest upstream commit in that branch:

Start with the commit history at https://github.com/orangepi-xunlong/openwrt/commits/openwrt-22.03/ (that's about the same as @Dante linked).

Basically, you need to apply the last few commits to the current 24.10 branch. Once you've got that straight, you can create a PR and add official support for this device.

How do I do that? I am assuming I clone the 22.03 fork to my git folder. How to I pull down / apply the last few commits from the origin repo? Is there a command, do I need to manually copy and paste the changes?

Is there an easy way to analyze the diff?

I think you need to try to apply the diff from this downstream repo to the vanilla OpenWrt and then fix the conflicts.

git clone git@github.com:orangepi-xunlong/openwrt.git openwrt-orangepi
cd openwrt-orangepi
git switch openwrt-22.03
git diff HEAD 94adc23fa693d1b129ce1718573dfb12594f20f8 > complete.diff

Then clone the OpenWrt, switch to whichever branch (I'd start with 22.03 just to see if the diff works) and do:

git apply complete.diff

This will most likely fail. That's up to you to figure out.

You could also checkout the vanilla repo, add Orange Pi one as a remote and try to cherry-pick the changes.

A few more details -- it looks like they were building their own Kernel which is why openwrt was able to build. https://github.com/orangepi-xunlong/openwrt/commit/15212ed11ba931f6910eec5479bc5332c265acd2#diff-e93ecc8a8de53a139385bcc25c5328c63cead3c6fc70b5cca8acb8aa629bc436

Which look all to be for kernel 5.10. I am guessing the order of operations would be build a newer linux kernel, and only then could I do the updated openwrt build.

I'm not sure if recent OpenWrt version can work with an older kernel, but you could try to apply patches to upstream and keep the modified kernel.

The pre-built openwrt does work, but the packages upon upgrade complain about an outdated kernel and won't let me update the package. The old version of Kernel and OpenWrt most likely opens me up to a bunch of security issues.

I think my biggest issue is that xunlong repos aren't maintained like standard repo. If you go to the one for OpenWrt master branch lacks all the correct configs for opi5+ and only the 22.03 branch has the right configs. If you go to https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.6-rk35xx where they are building the linux kernel. They do have multiple versions, but 5.4 is the default for some reason.

Had I known all this I would have passed on the opi5. However, when it was running openwrt it was very fast and exactly what I wanted, as I plan it to host my docker instances as well and basically replace my big homelab dell.

In terms of next steps, I will try compiling the 6.6 kernel from the git I posted above. If that is not possible, then its really not worth my effort trying to get OpnWrt to work.

If I do get it to compile, then I will try as you guys said by merging the updates in and seeing what breaks. I do think its a good call to start with 22.03 to see if works. If it does, I could see what happens when I try updating the kernel before try to apply newer openwrt fixes to it.

1 Like

Given that the SoC is nowadays supported in mainline Linux, getting vanilla OpenWrt running shouldn't be too difficult. All the bits and pieces are there, it "just" needs to be merged together.