remote-android / redroid-modules

redroid kernel modules (binderfs, ashmem etc.)
GNU General Public License v2.0
82 stars 56 forks source link

CentOS7 怎么安装这个内核模块 #10

Closed hzl000 closed 1 year ago

hzl000 commented 1 year ago

你好我的一台X86的服务器打算运行一个ReDroid实例,在docker启动了之后一直无法连上adb,看了issue应该就是缺少binder,ashmem。 我看了一下确实是没有这2个模块。看了文档都是以ubuntu做示例,由于我不太熟linux,翻查了好久也不知道该怎么安装这些内核模块。

System info following: cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)

Kernel info following: cat /proc/version Linux version 5.10.81-1.el7.x86_64 (builder@buildbot) (gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2), GNU ld version 2.32-16.el7) #1 SMP Mon Nov 22 03:24:26 UTC 2021

zhouziyang commented 1 year ago

try build your own kernel, check https://github.com/remote-android/redroid-doc/blob/master/deploy/centos.md

hzl000 commented 1 year ago

try build your own kernel, check https://github.com/remote-android/redroid-doc/blob/master/deploy/centos.md

yes, actually i follow the centos.md to do, and then i successfully to launch the redroid in the docker. but adb didn't found the redroid, i saw a tips Binder driver could not be opened. Terminating. in logcat. that because my env doesn't have binder ashmem kernel modules.

now i found a way to install those modules that by dkms. i follow DKMS step of https://github.com/remote-android/redroid-modules/blob/master/README.md so sad i meet some error when i invoke dkms install redroid-ashmem/1 dkms install redroid-binder/1

i had upgrade kernel gcc my command line history following:

[root@ip-***-**-**-*** redroid-ashmem-1]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# cat /proc/version 
Linux version 6.0.11-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2), GNU ld version 2.32-16.el7) #1 SMP PREEMPT_DYNAMIC Thu Dec 1 18:16:35 EST 2022
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# dkms install redroid-ashmem/1
Sign command: /lib/modules/6.0.11-1.el7.elrepo.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.0.11-1.el7.elrepo.x86_64 all KERNEL_SRC=/lib/modules/6.0.11-1.el7.elrepo.x86_64/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.0.11-1.el7.elrepo.x86_64 (x86_64)
Consult /var/lib/dkms/redroid-ashmem/1/build/make.log for more information.
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# 
[root@ip-***-**-**-*** redroid-ashmem-1]# dkms install redroid-binder/1
Sign command: /lib/modules/6.0.11-1.el7.elrepo.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=6.0.11-1.el7.elrepo.x86_64 all KERNEL_SRC=/lib/modules/6.0.11-1.el7.elrepo.x86_64/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.0.11-1.el7.elrepo.x86_64 (x86_64)
Consult /var/lib/dkms/redroid-binder/1/build/make.log for more information.

i tidy up related file into zip fileTree.zip

zhouziyang commented 1 year ago

The modules here are out of tree porting, and may not work out of the box. It's created primary for some old kernels (pre 5.0) and public cloud (AWS, Aliyun etc.)

For CentOS, suggest to build your own custom kernel.