自实现的 android.hardware.xxxx@1.0-service 没有开机自启动

问题描述

push android.hardware.xxxx@1.0-service/vednor/bin/hw;
push ‘android.hardware.xxxx@1.0-service.rc’ 到 /vendor/etc/init/;
reboot 设备后,xxx 服务没有自动启动。
经检查 rc 文件与同类 service 无差异。

问题分析

直接运行 xxx 服务正常。同时经检查 rc 文件与同类 service 无差异。
怀疑是权限问题。
使用 ls -al -Z 查看,rc 文件权限相同,但 xxxx 文件 SELinux 权限不同:

-rwxr-xr-x 1 root   shell  u:object_r:hal_mcucomm_default_exec:s0                   11648 2009-01-01 08:00 android.hardware.mcucomm@1.0-service
-rwxr-xr-x 1 root   shell  u:object_r:vendor_file:s0                                  82856 2024-08-02 16:25 android.hardware.xxxx@1.0-service
-rwxr-xr-x 1 root   shell  u:object_r:hal_settings_default_exec:s0                  29904 2009-01-01 08:00 android.hardware.settings@1.0-service

所以问题应该是 SELinux 权限不同导致。

问题解决

使用命令修改 xxxx 文件 SELinux 权限与同类一致即可。

chcon u:object_r:hal_mcucomm_default_exec:s0 android.hardware.xxxx@1.0-service
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值