ovacikar Posted 16 hours ago Posted 16 hours ago Hi, I need linux kernel source to compile a custom module. The one I downloaded from kernel.org did not work, got module format error, indicating the kernel is different. i did not have this problem compiling the same module for Armbian lepotato (amlogic) Where do I get the kernel source for my Orangepi Zero 2? Linux orangepizero2 6.12.20-current-sunxi64 #1 SMP Sat Mar 22 19:54:28 UTC 2025 aarch64 GNU/Linux linux-headers-current-sunxi64/bookworm,now 25.2.3 arm64 [installed] Armbian Linux current headers 6.12.20-current-sunxi64 linux-image-current-sunxi64/bookworm,now 25.2.3 arm64 [installed] Armbian Linux current kernel image 6.12.20-current-sunxi64 0 Quote
Igor Posted 8 hours ago Posted 8 hours ago 7 hours ago, ovacikar said: Hi, I need linux kernel source to compile a custom module. The one I downloaded from kernel.org did not work, got module format error, indicating the kernel is different. We just figured out we have dropped packing kernel sources at some point. Until we figure out how to re-enable that or if this makes sense, use build framework to add a custom module. It has the ability to do that. 7 hours ago, ovacikar said: i did not have this problem compiling the same module for Armbian lepotato (amlogic) Allwinner kernel is heavily patched, version is not necessarily latest, quite distanced from mainline, while Amlogic, on the other hand, is closer, changed less. 0 Quote
ovacikar Posted 4 hours ago Author Posted 4 hours ago (edited) I set the version in userpatches/lib.config , then executed this: ./compile.sh BOARD=orangepizero2 BRANCH=current kernel-config KERNEL_BTF=no KERNEL_GIT=full and when the kernel menu came up, just exited to shell. Is this the kernel source directory I can point the compiler script of the module ? /build/cache/sources/linux-kernel-worktree/6.12__sunxi64__arm64$ ls arch COPYING defconfig fs io_uring Kconfig LICENSES mm rust security usr block CREDITS Documentation include ipc kernel MAINTAINERS net samples sound virt certs crypto drivers init Kbuild lib Makefile README scripts tools Edited 4 hours ago by ovacikar 0 Quote
going Posted 1 hour ago Posted 1 hour ago 14 часов назад, ovacikar сказал: Linux orangepizero2 6.12.20-current-sunxi64 #1 SMP Sat Mar 22 19:54:28 UTC 2025 aarch64 GNU/Linux linux-headers-current-sunxi64/bookworm,now 25.2.3 arm64 [installed] The kernel headers that you have installed are quite enough to build the kernel module, the source codes of which you have. If the source codes are already in the kernel, then you just need to configure the kernel before compiling. launch: 2 часа назад, ovacikar сказал: ./compile.sh BOARD=orangepizero2 BRANCH=current kernel-config After you finish the configuration, the build system saves your configuration file (it will tell you where it did it). Save it under the name ./config/kernel/linux-sunxi64-current.config It is assumed that you are in the armbian/build directory. launch: ./compile.sh BOARD=orangepizero2 BRANCH=current kernel 0 Quote
ovacikar Posted 1 hour ago Author Posted 1 hour ago This 3rd party module needs both kernel headers and kernel source. The Makefile bundled with the code applies patches to an existing kernel module source code and compiles it. I ran the build script on a separate debian vm and created a tarball of the source tree. i will try to transfer it to the opi later today. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.