Giter Site home page Giter Site logo

sickcodes / anbox-modules-dkms Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 3.0 21 KB

anbox-modules-dkms for kernel - resurrected aur.archlinux.org/anbox-modules-dkms for ongoing maintaining. Next Generation Box Modules DKMS (ngbox). WayDroid, Anbox Halium, Droid Native, Dock Droid + BlissOS!

License: GNU General Public License v3.0

Shell 100.00%
anbox anbox-git waydroid dkms modules android

anbox-modules-dkms's Introduction

anbox-modules-dkms for kernel 5.7+ (ngbox-modules-dkms)

Next Generation Box Modules DKMS (ngbox)

Maintained by Christian Hoff @choff: https://github.com/choff/anbox-modules

The AUR package is maintained here: https://github.com/sickcodes/aur/tree/master/anbox-modules-dkms

Resurrected aur.archlinux.org/anbox-modules-dkms for maintenance

As per the Arch Wiki, https://wiki.archlinux.org/title/Anbox#Old_kernels

The dkms modules do not work on kernels ≥5.7 anymore. Follow the instructions below instead. For older kernels see Old kernels.

However, a user named @Choff has included some patches here:

anbox/anbox-modules#76

This repo will be used to fix the anbox modules for 5.7+.

This project was created for use in:

Patches

git submodule add https://github.com/choff/anbox-modules We will use commit https://github.com/choff/anbox-modules/commit/6ddae194592451d604726a286f566d0246aef567

https://github.com/choff/anbox-modules/commit/4af9d5d591f33a0d8d7fb0735e280fa51ccef53e

Fix compilation of binder and ashmem on kernel 5.7 and later

On kernel 5.7 and later, kallsyms_lookup_name() can no longer be called from a kernel module for reasons described here: https://lwn.net/Articles/813350/ As binder really needs to use kallsysms_lookup_name() to access some kernel functions that otherwise wouldn't be accessible, KProbes are used on later kernels to get the address of kallsysms_lookup_name(). The function is afterwards used just as before. This is a very dirty hack though and the much better solution would be if all the functions that are currently resolved with kallsysms_lookup_name() would get an EXPORT_SYMBOL() annotation to make them directly accessible to kernel modules.

https://github.com/choff/anbox-modules/commit/443f984b1a4eecf464b0081820e87e351c5d7c36

Compile fixes for kernel >= 5.8

With the commit 64fe66e8a95e in the Linux kernel, the member "mmap_sem" in the struct mm_struct was renamed to "mmap_lock". This patch fixes the resulting compile errors.

https://github.com/choff/anbox-modules/commit/6ddae194592451d604726a286f566d0246aef567

Another compile fix for kernel >= 5.8

With kernel 5.8, the return value of map_kernel_range_noflush() was changed. This function now returns 0 on success (instead of the number of successfully mapped pages).

This commit adjusts binder accordingly.

Thank you so much @choff!

anbox-modules-dkms's People

Contributors

sickcodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

anbox-modules-dkms's Issues

DEbian kernel 5.19.3

DKMS make.log for anbox-ashmem-1 for kernel 5.19.3-armmp-lpae (armv7l)
Wed 07 Sep 2022 10:29:45 PM UTC
make -C /lib/modules/5.19.3-armmp-lpae/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.19.3-armmp-lpae'
CC [M] /var/lib/dkms/anbox-ashmem/1/build/deps.o
CC [M] /var/lib/dkms/anbox-ashmem/1/build/ashmem.o
/var/lib/dkms/anbox-ashmem/1/build/deps.c:9:3: error: #error "Your kernel does not support KProbes, but this is required to compile ashmem as a kernel module on kernel 5.7 and later"
9 | # error "Your kernel does not support KProbes, but this is required to compile ashmem as a kernel module on kernel 5.7 and later"
| ^~~~~
make[2]: *** [scripts/Makefile.build:249: /var/lib/dkms/anbox-ashmem/1/build/deps.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1849: /var/lib/dkms/anbox-ashmem/1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.19.3-armmp-lpae'
make: *** [Makefile:12: all] Error 2

binder doesn't compile (gcc 11.4.0, kernel 5.15.0-79-generic)

Binder doesn't compile correctly.

Build log is

DKMS make.log for anbox-binder-1 for kernel 5.15.0-79-generic (x86_64)
So 27. Aug 19:45:06 CEST 2023
make -C /lib/modules/5.15.0-79-generic/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-79-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
  You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  CC [M]  /var/lib/dkms/anbox-binder/1/build/deps.o
  CC [M]  /var/lib/dkms/anbox-binder/1/build/binder.o
  CC [M]  /var/lib/dkms/anbox-binder/1/build/binder_alloc.o
  CC [M]  /var/lib/dkms/anbox-binder/1/build/binderfs.o
In file included from ././include/linux/kconfig.h:5,
                 from <command-line>:
./include/generated/autoconf.h:4499: warning: "CONFIG_ANDROID_BINDER_DEVICES" redefined
 4499 | #define CONFIG_ANDROID_BINDER_DEVICES ""
      | 
<command-line>: note: this is the location of the previous definition
In file included from ././include/linux/kconfig.h:5,
                 from <command-line>:
./include/generated/autoconf.h:4499: warning: "CONFIG_ANDROID_BINDER_DEVICES" redefined
 4499 | #define CONFIG_ANDROID_BINDER_DEVICES ""
      | 
<command-line>: note: this is the location of the previous definition
In file included from ././include/linux/kconfig.h:5,
                 from <command-line>:
./include/generated/autoconf.h:4499: warning: "CONFIG_ANDROID_BINDER_DEVICES" redefined
 4499 | #define CONFIG_ANDROID_BINDER_DEVICES ""
      | 
<command-line>: note: this is the location of the previous definition
In file included from ././include/linux/kconfig.h:5,
                 from <command-line>:
./include/generated/autoconf.h:4499: warning: "CONFIG_ANDROID_BINDER_DEVICES" redefined
 4499 | #define CONFIG_ANDROID_BINDER_DEVICES ""
      | 
<command-line>: note: this is the location of the previous definition
/var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘binder_transaction’:
/var/lib/dkms/anbox-binder/1/build/binder.c:3130:55: error: passing argument 2 of ‘security_task_getsecid_obj’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 3130 |                 security_task_getsecid_obj(proc->tsk, &secid);
      |                                                       ^~~~~~
      |                                                       |
      |                                                       u32 * {aka unsigned int *}
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:546:72: note: expected ‘struct lsmblob *’ but argument is of type ‘u32 *’ {aka ‘unsigned int *’}
  546 | void security_task_getsecid_obj(struct task_struct *p, struct lsmblob *blob);
      |                                                        ~~~~~~~~~~~~~~~~^~~~
/var/lib/dkms/anbox-binder/1/build/binder.c:3134:55: error: passing argument 2 of ‘security_secid_to_secctx’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 3134 |                 ret = security_secid_to_secctx(secid, &secctx, &secctx_sz);
      |                                                       ^~~~~~~
      |                                                       |
      |                                                       char **
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:592:71: note: expected ‘struct lsmcontext *’ but argument is of type ‘char **’
  592 | int security_secid_to_secctx(struct lsmblob *blob, struct lsmcontext *cp,
      |                                                    ~~~~~~~~~~~~~~~~~~~^~
/var/lib/dkms/anbox-binder/1/build/binder.c:3183:41: error: passing argument 1 of ‘security_release_secctx’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 3183 |                 security_release_secctx(secctx, secctx_sz);
      |                                         ^~~~~~
      |                                         |
      |                                         char *
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:596:49: note: expected ‘struct lsmcontext *’ but argument is of type ‘char *’
  596 | void security_release_secctx(struct lsmcontext *cp);
      |                              ~~~~~~~~~~~~~~~~~~~^~
/var/lib/dkms/anbox-binder/1/build/binder.c:3183:17: error: too many arguments to function ‘security_release_secctx’
 3183 |                 security_release_secctx(secctx, secctx_sz);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:596:6: note: declared here
  596 | void security_release_secctx(struct lsmcontext *cp);
      |      ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/anbox-binder/1/build/binder.c:3518:41: error: passing argument 1 of ‘security_release_secctx’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 3518 |                 security_release_secctx(secctx, secctx_sz);
      |                                         ^~~~~~
      |                                         |
      |                                         char *
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:596:49: note: expected ‘struct lsmcontext *’ but argument is of type ‘char *’
  596 | void security_release_secctx(struct lsmcontext *cp);
      |                              ~~~~~~~~~~~~~~~~~~~^~
/var/lib/dkms/anbox-binder/1/build/binder.c:3518:17: error: too many arguments to function ‘security_release_secctx’
 3518 |                 security_release_secctx(secctx, secctx_sz);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/anbox-binder/1/build/binder.c:63:
./include/linux/security.h:596:6: note: declared here
  596 | void security_release_secctx(struct lsmcontext *cp);
      |      ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /var/lib/dkms/anbox-binder/1/build/binder.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1909: /var/lib/dkms/anbox-binder/1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-79-generic'
make: *** [Makefile:8: all] Error 2

Work in Progress - Help much appreciated

We are trying to create ngbox modules dkms that were removed as per the readme due to security risks and license stuff related to life before using kprobes.

This will allow Anbox, WayDroid, Droid Native, and many other LXC based android solutions to work like 🔥

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.