shaddow501 Posted February 11, 2020 Posted February 11, 2020 Hello First issue: 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. Second issue: 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 = 18EXTRAVERSION = -sunxi64 NAME = Kleptomaniac Octopus Third issue: 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: /usr/src/linux-headers-5.4.18-sunxi64/arch/arm64 Edit Makefile: and search for vdso_prepare ifeq ($(KBUILD_EXTMOD),) # 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. #prepare: vdso_prepare #vdso_prepare: prepare0 # $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offs$ # $(if $(CONFIG_COMPAT_VDSO),$(Q)$(MAKE) \ # $(build)=arch/arm64/kernel/vdso32 \ # include/generated/vdso32-offsets.h) After all that I was able to compile and work with the kernel module. Hope that it helps anyone. linux-headers-5.4.18-sunxi64.tar.gz 1
Werner Posted February 12, 2020 Posted February 12, 2020 Unless you need this very particular kernel version there is no need for such "hacks" . You can always use the build script to create a full kernel package for your board which will include a headers package as well. Proper header packages will be provided in future again. Check
shaddow501 Posted February 12, 2020 Author Posted February 12, 2020 4 hours ago, Werner said: Unless you need this very particular kernel version there is no need for such "hacks" . You can always use the build script to create a full kernel package for your board which will include a headers package as well. Proper header packages will be provided in future again. Check Dear Werner, that is exactly what I did while building my kernel, but you forget that not all users build their kernel, some go to the download page and just download the Image and it is without the headers... If everything would have worked as it should, I wouldn't waste my time writing this post. By the way the problem I listed 2 & 3 is not only with this kernel headers, I have had this problem since kernel 5.1, So till now ( Kernel 5.4 ) those issues weren't fixed....
aprayoga Posted February 13, 2020 Posted February 13, 2020 On 2/12/2020 at 4:27 AM, shaddow501 said: Second issue: 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 = 18EXTRAVERSION = -sunxi64 NAME = Kleptomaniac Octopus linux-headers-5.4.18-sunxi64.tar.gz 14.83 MB · 1 download I don't think you need to modify the Makefile, you can set LOCALVERSION environment variable before compiling. You could try something like this when you invoke the make LOCALVERSION=-sunxi64 make modules Here is how Armbian compile the kernel:https://github.com/armbian/build/blob/master/lib/compilation.sh#L367-L371
shaddow501 Posted February 13, 2020 Author Posted February 13, 2020 3 hours ago, Igor said: This is the problem. 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. Good Luck. 1
Igor Posted February 13, 2020 Posted February 13, 2020 1 hour ago, shaddow501 said: I have only provided a work around And I explained where is the actual problem And we have to fix on the process levels. Workarounds are useful, don't get me wrong. Thx. 1
Recommended Posts