Well we know that we have the problem, I have only provided a work around in order that we will able to compile modules.
If you want to use this fix use it if you dont want to use this fix dont use it and provide your own solution.
Till now I havent seen any solution that provided to fix this issue so I have added my own.
Again if you want use it if dont want then dont use it.
Up to users to decide what they want to do.
With the 5.4.18-sunxi64 kernel when you select in Armbian-config to install kernel headers it installs the wrong version, it install kernel headers for 5.3 something instead of the 5.4.18.
The way that I was able to work is by compiling the 5.4.18-sunxi64 Linux version including the Kernel headers.
I have attached it here.
When "make scripts" and make modules_prepare instead of link to the 5.4.18-sunxi64 it creates a link for modules in 5.4.18 which makes the modules useless, since it doesnt go to the correct /lib/modules library.
instead that the modules will be installed in lib/modules/5.4.18-sunxi64, it install it in /lib/modules/5.4.18.
The way to fix it is to modify the Makefile and add the -sunxi64.
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 18 EXTRAVERSION = -sunxi64
NAME = Kleptomaniac Octopus
When "make modules_prepare" it fail to finish with this error:
recipe for target 'vdso_prepare' failed and exit.
The way to fix it is to comment out the vdso_prepare in the Makefile at:
and search for vdso_prepare
# We need to generate vdso-offsets.h before compiling certain files in kernel/.
# In order to do that, we should use the archprepare target, but we can't since
# asm-offsets.h is included in some files used to generate vdso-offsets.h, and
# asm-offsets.h is built in prepare0, for which archprepare is a dependency.
# Therefore we need to generate the header after prepare0 has been made, hence
# this hack.
# $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offs$
# $(if $(CONFIG_COMPAT_VDSO),$(Q)$(MAKE) \
# $(build)=arch/arm64/kernel/vdso32 \
After all that I was able to compile and work with the kernel module.