Open Bu156 opened 1 year ago
I have tried compiling the modules myself, but I run into errors about the wireguard headers redefining kernel functions as static.
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..
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:
scripts/gcc-wrapper.py
with the script from these sources, as I can't use Python 2:
https://github.com/ayufan-rock64/linux-kernel/commit/c3714cbbcfbf0f72179e611ee16bf040f5b1695d#diff-8b99c545c4f541534435d1b8da9ba020ae93dfa359f8acd1e3247585d5a5f5e3/usr/bin/make O=../kernel-out ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabihf- PYTHON=python3 defconfig KBUILD_DEFCONFIG=ubports_fp4_defconfig -j$(nproc)
/usr/bin/make O=../kernel-out ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabihf- PYTHON=python3 modules_prepare -j$(nproc)
cd
to the wireguard sources and run the following
make -C src -j$(nproc) KERNELDIR=$(pwd)/../kernel-out ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabihf- PYTHON=python3 module
What followed for me is a bunch of issues regarding wrong types and static declarations, but you might have more luck with it.
Ahh right sorry, got the terminology mixed. I'll try compiling the module too and see what happens.
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.
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.
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/LinuxWhere is the kernel repo? https://gitlab.com/ubports/porting/reference-device-ports/android11/fairphone-4/kernel-fairphone-sm7225