RK3568添加开机启动shell脚本
时间: 2023-08-29 09:07:10 浏览: 464
要在RK3568上添加开机启动shell脚本,你需要执行以下步骤:
1. 在系统的/bin目录下创建名为myshell的shell脚本文件。你可以使用以下命令进行创建:`touch /system/bin/myshell`
2. 编辑init.rc文件,将以下内容添加到文件的末尾:
```
service myshell /system/bin/myshell.sh
user root
group root
disabled
on property:sys.boot_completed=1
start myshell
```
这将在系统启动完成后执行myshell.sh脚本,并以root用户和root组的身份运行。
3. 在device/rockchip/common/sepolicy目录下创建名为myshell.te的文件,并将以下内容添加到文件中:
```
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脚本提供必要的权限和访问控制。
请注意,这些步骤是基于提供的引用内容,具体实施可能会因系统环境和配置而有所不同。在进行任何修改前,请确保你对系统的了解和备份。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *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: 100%"]
[ .reference_list ]
阅读全文
相关推荐















