DavidVentura / Wireguard_qml

UBPorts app in QML for Wireguard
MIT License
4 stars 5 forks source link

Help adding kernel support for Fairphone 4 #28

Open Bu156 opened 1 year ago

Bu156 commented 1 year ago

What device do you have? Fairphone 4

What is the output of uname -a on the device? Linux AloeHumilis 4.19.157-perf+ #1 SMP PREEMPT Tue Feb 28 09:20:04 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Where is the kernel repo? https://gitlab.com/ubports/porting/reference-device-ports/android11/fairphone-4/kernel-fairphone-sm7225

Bu156 commented 1 year ago

I have tried compiling the modules myself, but I run into errors about the wireguard headers redefining kernel functions as static.

Joni-Samanen commented 1 year ago

I'm also interested in this. Can I ask the steps you made to patch the kernel? I've never done it but I'm willing to dive in. I'm very much in need to get wireguard working on my Fairphone 4, so far no luck. I tried installing wireguard via apt but space runs out..

Bu156 commented 1 year ago

I didn't patch the kernel, I'm trying to create an external module which I can load. Anyhow, here are the rough steps I took:

What followed for me is a bunch of issues regarding wrong types and static declarations, but you might have more luck with it.

Joni-Samanen commented 1 year ago

Ahh right sorry, got the terminology mixed. I'll try compiling the module too and see what happens.

Joni-Samanen commented 1 year ago

Just to make sure: I can do this on another machine and then move the module to FP4? I get

GEN ./Makefile YACC scripts/kconfig/zconf.tab.c LEX scripts/kconfig/zconf.lex.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'ubports_fp4_defconfig' /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: Is: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: your: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: PATH: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: set: expected numeric value /home/kali/git/kernel-fairphone-sm7225/scripts/gcc-version.sh: 30: printf: correctly?: expected numeric value init/Kconfig:17: syntax error init/Kconfig:16: invalid option make[2]: *** [/home/kali/git/kernel-fairphone-sm7225/scripts/kconfig/Makefile:96: defconfig] Error 1 make[1]: *** [/home/kali/git/kernel-fairphone-sm7225/Makefile:570: defconfig] Error 2 make[1]: Leaving directory '/home/kali/git/kernel-out' make: *** [Makefile:151: sub-make] Error 2

when running the first command. Tried in my host (Arch) and a VM (Kali). I'll try to debug what's wrong.

Joni-Samanen commented 1 year ago

Out of curiosity, have you managed to get wireguard to work (at all) in userspace with your FP4? I tried to unset pin but I don't get a handshake when connecting.

Fuseteam commented 3 weeks ago

This MR might help https://gitlab.com/ubports/porting/community-ports/android10/xiaomi-poco-x3/kernel-xiaomi-surya/-/merge_requests/6