错误1:
init: init.target.rc: 121: invalid service name 'sshservice_enable'
原因:
init.rc service name 过长,正确的命名:
1.service name 长度不能超出16个字符
2.service name 命名时可以使用的字符只能是字母数字(0-9a-zA-Z),’_'和 ‘-’
参考:
https://blog.csdn.net/shijie19930806/article/details/72834824?utm_source=blogxgwz5
错误2:
init: Service ssh_enable does not have a SELinux domain defined.
原因:
需要添加domain defined.
1.修改 system/seplicy/file_contexts 文件,添加以下内容:
/sbin/ssh_enable u:object_r:ssh_enable_exec:s0
2.system/seplicy目录下新增 ssh_enable.te 文件,并在其中添加以下内容:
#需要为新增的进程增加域、执行权限
type ssh_enable, domain;
type ssh_enable_exec, exec_type, file_type;
#然后启用这个域
init_daemon_domain(ssh_enable)
3.在ssh_enable.te文件中增加相应selinux权限
allow ssh_enable rootfs:file { getattr };
allow ssh_enable storage_file:dir { getattr };
allow ssh_enable persist_file:dir { getattr };
allow ssh_enable init_exec:file { getattr };
allow ssh_enable adsprpcd_file:dir { getattr };
allow ssh_enable cache_file:dir { getattr };
参考:
https://blog.csdn.net/jianchi88/article/details/78417202
错误3:
init: cannot find '/ssh-enable.sh' (No such file or directory), disabling 'ssh_enable'
原因:
脚本文件没有生成。
查看out目录下是否有此文件,如果没有,先利用mm单独编译该目录,然后再全编译。