Adding OpenWrt support for WF-HR1901

Hello. I recently purchased this board on aliexpress, to use with openwrt. The vendor gave me this patch so I can add the board to openwrt 19.07.

But after applying it, when compiling I get this error:

Error
Applying /home/gleb/Projects/router_firmware/IPQ4019/openwrt/target/linux/ipq40xx/patches-4.14/900-dts-ipq4019-ap-dk01.1.patch using plaintext: 
patching file arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi
patching file arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts

Applying /home/gleb/Projects/router_firmware/IPQ4019/openwrt/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch using plaintext: 
patching file arch/arm/boot/dts/Makefile
patch: **** malformed patch at line 45:         qcom-msm8660-surf.dtb \

So I had to manually add the following lines to 901-arm-boot-add-dts-files.patch and everything compiled fine.

+	qcom-ipq4019-hr1901.dtb \
+	qcom-ipq4019-hr1901n.dtb \

But does anyone know what could be causing this error?

And could you also tell me if it is possible to adapt that patch to use it with openwrt 22.

1 Like

Your link to the patch isn't working. That said, yes, of course it is possible to adapt the patch for newer OpenWrt. How much adapting you need to do, however, is dependent on the patch.

1 Like

Hello Gleb. I also have this router. I'm currently working on adapting your patch for it. I'll post it here on the forum when I'm done.

1 Like

Hello. I already made it work with master and 22.03. I can share my patch

Here is the "patch" i use with 22.03. I'm using the old dts files provided by vendor. The only issue i have is when I add the following lines

+	qcom-ipq4019-hr1901.dtb \
+	qcom-ipq4019-hr1901n.dtb \

to 901-arm-boot-add-dts-files.patch, I get the error

Applying /home/gleb/Projects/router_firmware/IPQ4019/openwrt/target/linux/ipq40xx/patches-4.14/901-arm-boot-add-dts-files.patch using plaintext: 
patching file arch/arm/boot/dts/Makefile
patch: **** malformed patch at line 45:         qcom-msm8660-surf.dtb \

,so instead of using this i add the lines to /openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.10.120/arch/arm/boot/dts/Makefile manually.

1 Like