2 2
shaddow501

Fix 5.4.18-sunxi64 modules compile issue

Recommended Posts

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 = 18
EXTRAVERSION = -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

Share this post


Link to post
Share on other sites

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 

 

Share this post


Link to post
Share on other sites
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....

Share this post


Link to post
Share on other sites
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 = 18
EXTRAVERSION = -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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
2 2