RK3568开机启动shell脚本
时间: 2023-08-29 10:05:50 浏览: 434
在RK3568上开机启动shell脚本的方法如下所示:
1. 首先,在系统的init.rc文件中添加以下内容:
```
service myshell /system/bin/myshell.sh
user root
group root
disabled
on property:sys.boot_completed=1
start myshell
```
这段代码会启动一个名为myshell的服务,并在系统启动完成后执行`/system/bin/myshell.sh`脚本。
2. 然后,创建一个名为myshell.te的文件,将其放置在`device/rockchip/common/sepolicy`目录下,并添加以下内容:
```
type myshell, domain;
type myshell_exec, exec_type, file_type;
init_daemon_domain(myshell)
allow myshell init_tmpfs:file create_file_perms;
allow myshell self:capability { dac_override net_admin net_raw setgid setuid };
allow myshell device:dir { open read };
allow myshell shell:lnk_file { read };
allow myshell rootfs:lnk_file { getattr };
allow myshell socket_device:sock_file { write };
allow myshell shell_exec:file { getattr read};
allow myshell fuse:dir { search write add_name getattr};
allow myshell fuse:file { create write open getattr};
allow myshell system_file:file { execute_no_trans};
```
这段代码是为了授权myshell脚本执行所需的功能和权限。
通过以上步骤,你可以在RK3568上实现开机启动shell脚本的需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Android系统10 RK3399 init进程启动(四十四) 实战Android开机自启动脚本](https://blog.csdn.net/ldswfun/article/details/128279000)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [RK3399 Android 添加开机启动shell脚本](https://blog.csdn.net/weixin_41720013/article/details/120034087)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文