在移植openharmony过程中,由于添加了新组件,启动后,一直打印binder驱动程序报错,错误如下所示。
01-01 00:00:45.218 1 1 E 00719/Init: ServiceStart : start service deviceauth_service invalid, please check /bin/deviceauth_service.
01-01 00:00:45.218 1 1 E 00719/Init: StartServiceByName : StartServiceByName, service deviceauth_service start failed!
01-01 00:00:45.219 994 994 I 00719/Init: ServiceStart : service->name is appspawn
01-01 00:00:45.220 1 1 E 00719/Init: ServiceStart : start service softbus_server invalid, please check /bin/softbus_server.
01-01 00:00:45.220 1 1 E 00719/Init: StartServiceByName : StartServiceByName, service softbus_server start failed!
01-01 00:00:45.221 1 1 E 00719/Init: ServiceStart : start service devicemanagerservice invalid, please check /bin/devicemanagerservice.
01-01 00:00:45.221 1 1 E 00719/Init: StartServiceByName : StartServiceByName, service devicemanagerservice start failed!
01-01 00:00:45.221 1 1 I 00719/Init: main : main, time used: sigInfo 10 ms, rcs 710 ms, cfg 44 ms.
01-01 00:00:45.221 1 1 I 00719/Init: main : main, entering wait.
01-01 00:00:45.303 994 994 I 00000/(null): [appspawn] get service name appspawn.
01-01 00:00:45.306 994 994 I 00000/(null): [appspawn] register service succeed. 0x48092c.
01-01 00:00:45.306 994 994 I 00000/(null): [appspawn] get service name appspawn.
01-01 00:00:45.306 994 994 I 00000/(null): [appspawn] register featureapi succeed.
[ 7.380712] hdmi_hpd_sys_config_release
01-01 00:00:46.306 994 994 I 00000/(null): [appspawn] main, enter.
01-01 00:00:46.306 994 994 I 01800/Samgr: Bootstrap core ser[ 7.962694] binder: 994:997 ioctl c0186201 b6cb4bdc returned -22
vices(count:1).
01-01 00:00:46.[ 7.971534] binder: 994:997 ioctl c0186201 b6cb4c74 returned -22
306 994 994 I 00000/(null): [app[ 7.981952] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
spawn] get service name appspawn[ 7.990347] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
.
01-01 00:00:46.306 994 994 I [ 7.999904] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
01800/Samgr: Init service:appspa[ 8.009377] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
wn TaskPool:0xb6fe0310
01-01 00[ 8.018897] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
:00:46.306 994 994 I 00000/(null[ 8.028389] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
): [appspawn] get service name a[ 8.037893] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
ppspawn.
01-01 00:00:46.306 995[ 8.047399] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
995 I 00000/(null): [appspawn] [ 8.056904] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
initialize, identity<0, -1, 0xb6[ 8.066412] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
f3c010>
01-01 00:00:46.306 995 [ 8.075918] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
995 I 00000/(null): [appspawn] g[ 8.085423] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
et service name appspawn.
01-01[ 8.094937] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
00:00:46.306 995 995 I 01800/Sa[ 8.104438] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
mgr: Initialize Client Registry![ 8.113950] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
01-01 00:00:46.307 994 994 I 0[ 8.123461] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
0000/(null): [appspawn] HOS_Syst[ 8.132961] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
emInit is called!
01-01 00:00:4[ 8.142463] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
6.308 994 994 I 00000/(null): [a[ 8.151969] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
ppspawn] main, entering wait.
0[ 8.161474] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
1-01 00:00:46.311 995 995 I 0000[ 8.170981] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
0/(null): [appspawn] get service[ 8.180475] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
name appspawn.
01-01 00:00:46.[ 8.189992] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
311 995 995 I 01800/Samgr: Init [ 8.199504] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
service appspawn <time: 1005ms> [ 8.209005] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
success!
01-01 00:00:46.311 995[ 8.218511] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
995 I 01800/Samgr: Initialized [ 8.228018] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
all core system services!
01-01[ 8.237523] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
00:00:46.311 995 995 I 00000/(n[ 8.247033] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
ull): [appspawn] get service nam[ 8.256543] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
e appspawn.
01-01 00:00:46.311 [ 8.266048] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
995 995 I 01800/Samgr: Goto next[ 8.275553] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
boot step return code:-9
[Bind[ 8.285060] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
erWrite : 363]ioctl failed ret =[ 8.294573] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
-1
[StartLoop : 611]ioctl fail[ 8.304075] binder: 994:996 ioctl c0186201 b6dc19d0 returned -22
通过对比驱动发现,其实是有一些openharmony对linux内核修改的补丁没有打造成的,通过查看kernel/linux/patches/linux-5.10/hi3516dv300_patch文件夹下的文件,参考hi3516dv300_small.patch文件和hi3516dv300.patch,添加相关补丁问价拿到自己的文件中
t113_nand_linux.patch文件
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 85a6a7cb3..fae16495f 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
[url=home.php?mod=space&uid=1999721]@@[/url] -3114,7 +3114,7 @@ static void binder_transaction(struct binder_proc *proc,
return_error = BR_FAILED_REPLY
return_error_param = -EINVAL
return_error_line = __LINE__
t113_nand_linux_small.patch文件
diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
index ec84ad106568..9d7b05055726 100644
--- a/include/uapi/linux/android/binder.h
+++ b/include/uapi/linux/android/binder.h
@@ -27,6 +27,7 @@
#define B_PACK_CHARS(c1, c2, c3, c4)
((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
#define B_TYPE_LARGE 0x85
+#define BINDER_IPC_32BIT 1
enum {
BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
添加之后重新编译,可以看到如下图,没有报错了。
原作者:赵开心先森