anbox / anbox-modules

Anbox kernel modules
327 stars 224 forks source link

ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/anbox-ashmem/1/build/ashmem_linux.ko] undefined! #67

Open munish259272 opened 3 years ago

munish259272 commented 3 years ago

sudo dkms install anbox-ashmem/1

[root@centos boot]# sudo dkms install anbox-ashmem/1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j20 KERNELRELEASE=5.9.13-1.el8.elrepo.x86_64 all KERNEL_SRC=/lib/modules/5.9.13-1.el8.elrepo.x86_64/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.9.13-1.el8.elrepo.x86_64 (x86_64)
Consult /var/lib/dkms/anbox-ashmem/1/build/make.log for more information.
[root@centos boot]# cat /var/lib/dkms/anbox-ashmem/1/build/make.log
DKMS make.log for anbox-ashmem-1 for kernel 5.9.13-1.el8.elrepo.x86_64 (x86_64)
Thu Dec 10 19:16:42 IST 2020
make -C /lib/modules/5.9.13-1.el8.elrepo.x86_64/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/kernels/5.9.13-1.el8.elrepo.x86_64'
  AR      /var/lib/dkms/anbox-ashmem/1/build/built-in.a
  CC [M]  /var/lib/dkms/anbox-ashmem/1/build/deps.o
  CC [M]  /var/lib/dkms/anbox-ashmem/1/build/ashmem.o
  LD [M]  /var/lib/dkms/anbox-ashmem/1/build/ashmem_linux.o
  MODPOST /var/lib/dkms/anbox-ashmem/1/build/Module.symvers
ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/anbox-ashmem/1/build/ashmem_linux.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:111: /var/lib/dkms/anbox-ashmem/1/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/anbox-ashmem/1/build/Module.symvers'
make[1]: *** [Makefile:1697: modules] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.9.13-1.el8.elrepo.x86_64'
make: *** [Makefile:12: all] Error 2

sudo dkms install anbox-binder/1

[root@centos boot]# sudo dkms install anbox-binder/1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j20 KERNELRELEASE=5.9.13-1.el8.elrepo.x86_64 all KERNEL_SRC=/lib/modules/5.9.13-1.el8.elrepo.x86_64/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.9.13-1.el8.elrepo.x86_64 (x86_64)
Consult /var/lib/dkms/anbox-binder/1/build/make.log for more information.
[root@centos boot]# cat /var/lib/dkms/anbox-binder/1/build/make.log
DKMS make.log for anbox-binder-1 for kernel 5.9.13-1.el8.elrepo.x86_64 (x86_64)
Thu Dec 10 19:27:08 IST 2020
make -C /lib/modules/5.9.13-1.el8.elrepo.x86_64/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/kernels/5.9.13-1.el8.elrepo.x86_64'
  AR      /var/lib/dkms/anbox-binder/1/build/built-in.a
  CC [M]  /var/lib/dkms/anbox-binder/1/build/deps.o
  CC [M]  /var/lib/dkms/anbox-binder/1/build/binder.o
/var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘binder_update_page_range’:
/var/lib/dkms/anbox-binder/1/build/binder.c:633:19: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
   down_write(&mm->mmap_sem);
                   ^~~~~~~~
                   mmap_base
/var/lib/dkms/anbox-binder/1/build/binder.c:683:17: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
   up_write(&mm->mmap_sem);
                 ^~~~~~~~
                 mmap_base
/var/lib/dkms/anbox-binder/1/build/binder.c:710:17: error: ‘struct mm_struct’ has no member named ‘mmap_sem’; did you mean ‘mmap_base’?
   up_write(&mm->mmap_sem);
                 ^~~~~~~~
                 mmap_base
make[2]: *** [scripts/Makefile.build:283: /var/lib/dkms/anbox-binder/1/build/binder.o] Error 1
make[1]: *** [Makefile:1784: /var/lib/dkms/anbox-binder/1/build] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.9.13-1.el8.elrepo.x86_64'
make: *** [Makefile:8: all] Error 2
hunkjazz commented 3 years ago

This is also happening in Fedora 32.

The logs are identical.

sp1ritCS commented 3 years ago

Same on openSUSE Tumbleweed

(i just ran make, without dmks)

ashmem:

make -C /lib/modules/5.10.5-1-default/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-5.10.5-1-obj/x86_64/default'
  CC [M]  /tmp/anbox-modules/ashmem/deps.o
  CC [M]  /tmp/anbox-modules/ashmem/ashmem.o
  LD [M]  /tmp/anbox-modules/ashmem/ashmem_linux.o
  MODPOST /tmp/anbox-modules/ashmem/Module.symvers
ERROR: modpost: "kallsyms_lookup_name" [/tmp/anbox-modules/ashmem/ashmem_linux.ko] undefined!
make[3]: *** [/usr/src/linux-5.10.5-1/scripts/Makefile.modpost:116: /tmp/anbox-modules/ashmem/Module.symvers] Error 1
make[3]: *** Deleting file '/tmp/anbox-modules/ashmem/Module.symvers'
make[2]: *** [/usr/src/linux-5.10.5-1/Makefile:1723: modules] Error 2
make[1]: *** [../../../linux-5.10.5-1/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-5.10.5-1-obj/x86_64/default'
make: *** [Makefile:12: all] Error 2

binder:

make -C /lib/modules/5.10.5-1-default/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-5.10.5-1-obj/x86_64/default'
  CC [M]  /tmp/anbox-modules/binder/deps.o
  CC [M]  /tmp/anbox-modules/binder/binder.o
/tmp/anbox-modules/binder/binder.c: In function 'binder_update_page_range':
/tmp/anbox-modules/binder/binder.c:633:19: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_base'?
  633 |   down_write(&mm->mmap_sem);
      |                   ^~~~~~~~
      |                   mmap_base
/tmp/anbox-modules/binder/binder.c:683:17: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_base'?
  683 |   up_write(&mm->mmap_sem);
      |                 ^~~~~~~~
      |                 mmap_base
/tmp/anbox-modules/binder/binder.c:710:17: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_base'?
  710 |   up_write(&mm->mmap_sem);
      |                 ^~~~~~~~
      |                 mmap_base
make[3]: *** [/usr/src/linux-5.10.5-1/scripts/Makefile.build:280: /tmp/anbox-modules/binder/binder.o] Error 1
make[2]: *** [/usr/src/linux-5.10.5-1/Makefile:1819: /tmp/anbox-modules/binder] Error 2
make[1]: *** [../../../linux-5.10.5-1/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-5.10.5-1-obj/x86_64/default'
make: *** [Makefile:8: all] Error 2
sltruman commented 3 years ago

you need to recompile the linux kernel of host. just at kernel/kallsyms.c adding EXPORT_SYMBOL("kallsyms_lookup_name")

Christianb233 commented 3 years ago

hello @sltruman can you explain where to find kernel/kallsyms.c and then how to recompile the linux kernel host ? I try to install anbox on Raspberry OS and I have the same issue :-(

SoulInfernoDE commented 3 years ago

If i remember correct if you are using kernel 5.7+ it is not possible anymore to easily build binder and ashmem as some things have been removed from those kernels in mind of security.

The fix is to revert patch your kernel / those kernel things or just compile a kernel with ashmem and binder integrated.

You could try to follow my guide how to do this for yourself: (or download my pre-compiled kernel [ubuntu like linux only] - without any warranty that it will work for you or any other warranties...) https://github.com/anbox/anbox-modules/issues/75#issuecomment-794079944

mazunki commented 3 years ago

A quick searched revealed this solution elsewhere:

https://github.com/xcellerator/linux_kernel_hacking/issues/3

Is this something we could implement?

SoulInfernoDE commented 3 years ago

A quick searched revealed this solution elsewhere:

xcellerator/linux_kernel_hacking#3

Is this something we could implement?

I'm just a user but my opinion about such solutions is: The problem i would see here is in the long term. With a kernel hack we try to revert something that has been changed for good. It's unclear how long that patch will last with upcoming new kernel releases and the way they work will change quite fast. So if you want to open up your kernel and are fine with a hack I'd say go for it. If not just build the kernel with the modules inside.

nehveytnecillim commented 2 years ago

How the duck this suppose to work on Ubuntu 22 when there're tons of articles about your cooooliness(esp. performant), but your piece of [shit|cheat] doesn't even included in latest kernel nor compiled from sources? And when bug do exist for almost 2 years without fix, and with reference articles.

Linux, Canonical, how many meters between guys who patch kernel and who develop anbox? Try to shout out loudly sometimes to communicate between each other to fix this. Literally. Motherduckers, people in Ukraine still try your shit.

nehveytnecillim commented 2 years ago

You're a sincerely idiots, if even your docs aren't updated: "You can enable them, by looking at the following configuration..." Next goes the link to /android/Kconfig

Challenge yourself at least to paste here the link to your non updated docs, software artificial developer.