You are not logged in.

#1 2022-05-31 12:04:49

Morta
Member
Registered: 2019-07-07
Posts: 655

[SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

Hi!

Is there a way to have one of this AUR packages installed with a Kernel above 5.17.9?

It's fails with following message

(3/3) Install DKMS modules
==> dkms install --no-depmod binder/1 -k 5.18.1-arch1-1
Error! Bad return status for module build on kernel: 5.18.1-arch1-1 (x86_64)
Consult /var/lib/dkms/binder/1/build/make.log for more information.
==> WARNING: `dkms install --no-depmod binder/1 -k 5.18.1-arch1-1' exited 10
==> dkms install --no-depmod ashmem/1 -k 5.18.1-arch1-1
==> dkms install --no-depmod binder/1 -k 5.15.43-1-lts
==> dkms install --no-depmod ashmem/1 -k 5.15.43-1-lts
==> dkms install --no-depmod ashmem/1 -k 5.17.9-arch1-1
==> dkms install --no-depmod binder/1 -k 5.17.9-arch1-1
==> depmod 5.18.1-arch1-1
==> depmod 5.15.43-1-lts
==> depmod 5.17.9-arch1-1

Thanks for your inputs....

Last edited by Morta (2022-06-01 05:49:15)

Offline

#2 2022-05-31 12:26:47

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

Moving to AUR issues.

Offline

#3 2022-05-31 14:00:43

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

Offline

#4 2022-05-31 18:56:26

Morta
Member
Registered: 2019-07-07
Posts: 655

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

# Maintainer: Sick Codes <info at sick dot codes>
# Maintainer: Christian Hoff <https://github.com/choff>
# Contributor: Tobias Martin <tm-x at gmx dot net>

pkgname=anbox-modules-dkms
_pkgname=anbox-modules
pkgver=5.15
arch="$(uname -r)"
url='https://github.com/choff/anbox-modules'
pkgrel=1
pkgdesc='Android kernel driver fork by @choff (binder/binderfs & ashmem) in DKMS format'
arch=('x86_64' 'aarch64' 'i386')
license=('GPL3')
provides=("${pkgname}")
depends=('dkms')
makedepends=('git')
source=("git+https://github.com/choff/${_pkgname}.git#commit=8148a162755bf5500a07cf41a65a02c8f3eb0af9"
"https://github.com/choff/anbox-modules/pull/2/commits/f06ba5869503f8bc07cede1ed77241438d1fea20.patch")
sha256sums=('SKIP'
'SKIP')
conflicts=(anbox-modules-dkms-git)


prepare() {
  cd "${srcdir}/${_pkgname}"

  # Patch for 5.18
  patch -p1 -i "${srcdir}"/f06ba5869503f8bc07cede1ed77241438d1fea20.patch
}


package() {
  
  install -dm755 "${pkgdir}/usr/src/binder-1"
  install -dm755 "${pkgdir}/usr/src/ashmem-1"
  
  cp -r "${srcdir}/${_pkgname}/binder/"* "${pkgdir}/usr/src/binder-1/"
  cp -r "${srcdir}/${_pkgname}/ashmem/"* "${pkgdir}/usr/src/ashmem-1/"
  
  cd "${srcdir}/${_pkgname}/binder"
  make
  make DESTDIR="${pkgdir}/usr/src/binder-1" install
  
  cd "${srcdir}/${_pkgname}/ashmem"
  make
  make DESTDIR="${pkgdir}/usr/src/ashmem-1" install
  
  echo '** To activate binder_linux and ashmem_linux **
# $ sudo modprobe binder_linux devices=binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder
# $ sudo modprobe ashmem_linux'

}

If someone interested

Last edited by Morta (2022-05-31 18:58:42)

Offline

#5 2022-12-22 19:32:14

M1CK431
Member
Registered: 2015-11-28
Posts: 16

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

Issue is here again with kernel 6.1.1:

DKMS make.log for binder-1 for kernel 6.1.1-arch1-1 (x86_64)
Thu Dec 22 20:31:21 CET 2022
make -C /lib/modules/6.1.1-arch1-1/build V=0 M=$PWD
make[1]: Entering directory '/usr/lib/modules/6.1.1-arch1-1/build'
  CC [M]  /var/lib/dkms/binder/1/build/deps.o
  CC [M]  /var/lib/dkms/binder/1/build/binder.o
  CC [M]  /var/lib/dkms/binder/1/build/binder_alloc.o
  CC [M]  /var/lib/dkms/binder/1/build/binderfs.o
/var/lib/dkms/binder/1/build/binder.c: In function 'binder_wait_for_work':
/var/lib/dkms/binder/1/build/binder.c:4112:9: error: implicit declaration of function 'freezer_do_not_count' [-Werror=implicit-function-declaration]
 4112 |         freezer_do_not_count();
      |         ^~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/binder/1/build/binder.c:4132:9: error: implicit declaration of function 'freezer_count'; did you mean 'preempt_count'? [-Werror=implicit-function-declaration]
 4132 |         freezer_count();
      |         ^~~~~~~~~~~~~
      |         preempt_count
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:250: /var/lib/dkms/binder/1/build/binder.o] Error 1
make[1]: *** [Makefile:1992: /var/lib/dkms/binder/1/build] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.1.1-arch1-1/build'
make: *** [Makefile:8: all] Error 2

Offline

#6 2022-12-22 19:42:44

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

https://github.com/torvalds/linux/commi … 4aa83613b2 open an issue on https://github.com/choff/anbox-modules
Edit:
The changes below allow the module to build for me with linux 6.1.

diff --git a/PKGBUILD b/PKGBUILD
index 2f024f1..6650f0f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,11 +17,13 @@ makedepends=('git')
 source=("git+https://github.com/choff/${_pkgname}.git#commit=8148a162755bf5500a07cf41a65a02c8f3eb0af9"
   "[url]https://github.com/sickcodes/anbox-modules/commit/7c19d3c66758747d854c63e4c34ef127ce201fa6.patch[/url]"
   "[url]https://github.com/choff/anbox-modules/pull/4.patch[/url]"
-  "linux-6.patch")
+  "linux-6.patch"
+  "linux-6.1.patch")
 sha256sums=('SKIP'
             '7589f311fd9a503c30a214b54f1f687c26a2f160d4339098c65f655e9b1e3556'
             'fced11f849692dd1f0f36b50bb859d85aa244a536c2cef529a14bb73f568bb5e'
-            'SKIP')
+            '2e54658b2b123665860fbe64a0b102b13d47cc70acbbc1a1b7446bde3fce0d48'
+            '29f099605331f43989358c91d5cf1957f8a6fcfc95bbce9426191dc15c0ecb6a')
 conflicts=(anbox-modules-dkms-git)
 
 prepare() {
@@ -35,6 +37,8 @@ prepare() {
 
   # # Patch for kernel 6.xx
   patch --forward --strip=1 --input="${srcdir}/linux-6.patch"
+
+  patch -Np1 -i ../linux-6.1.patch
 }
 
 package() {
@@ -45,13 +49,13 @@ package() {
   cp -r "${srcdir}/${_pkgname}/binder/"* "${pkgdir}/usr/src/binder-1/"
   cp -r "${srcdir}/${_pkgname}/ashmem/"* "${pkgdir}/usr/src/ashmem-1/"
   
-  cd "${srcdir}/${_pkgname}/binder"
-  make
-  make DESTDIR="${pkgdir}/usr/src/binder-1" install
+#  cd "${srcdir}/${_pkgname}/binder"
+#  make
+#  make DESTDIR="${pkgdir}/usr/src/binder-1" install
   
-  cd "${srcdir}/${_pkgname}/ashmem"
-  make
-  make DESTDIR="${pkgdir}/usr/src/ashmem-1" install
+#  cd "${srcdir}/${_pkgname}/ashmem"
+#  make
+#  make DESTDIR="${pkgdir}/usr/src/ashmem-1" install
   
   echo '** To activate binder_linux and ashmem_linux **
 # $ sudo modprobe binder_linux devices=binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder
diff --git a/linux-6.1.patch b/linux-6.1.patch
new file mode 100644
index 0000000..6add3fa
--- /dev/null
+++ b/linux-6.1.patch
@@ -0,0 +1,31 @@
+diff --git a/binder/binder.c b/binder/binder.c
+index d6c6c1f..ede8edb 100644
+--- a/binder/binder.c
++++ b/binder/binder.c
+@@ -4109,10 +4109,16 @@ static int binder_wait_for_work(struct binder_thread *thread,
+ 	struct binder_proc *proc = thread->proc;
+ 	int ret = 0;
+ 
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+ 	freezer_do_not_count();
++#endif
+ 	binder_inner_proc_lock(proc);
+ 	for (;;) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+ 		prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE);
++#else
++		prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE|TASK_FREEZABLE);
++#endif
+ 		if (binder_has_work_ilocked(thread, do_proc_work))
+ 			break;
+ 		if (do_proc_work)
+@@ -4129,7 +4135,9 @@ static int binder_wait_for_work(struct binder_thread *thread,
+ 	}
+ 	finish_wait(&thread->wait, &wait);
+ 	binder_inner_proc_unlock(proc);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+ 	freezer_count();
++#endif
+ 
+ 	return ret;
+ }

Last edited by loqs (2022-12-22 20:00:03)

Offline

#7 2022-12-23 10:11:16

M1CK431
Member
Registered: 2015-11-28
Posts: 16

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

It works! Thanks @loqs

Offline

#8 2023-03-31 17:10:27

mhassan
Member
Registered: 2023-03-31
Posts: 1

Re: [SOLVED]anbox-modules-dkms fails to install with Kernel 5.18

@loqs @M1CK431 How can i solve this, facing same issue . can you please help?

Offline

Board footer

Powered by FluxBB